summaryrefslogtreecommitdiff
path: root/examples/print_tree.py
AgeCommit message (Collapse)Author
2019-03-06Use a consistent style in examplesUlf Magnusson
Also remove some unused imports.
2018-09-27Use a consistent import style in the examplesUlf Magnusson
Do the PEP 8 ordering thingy with standard library imports first.
2018-08-22Add a generic node iteratorUlf Magnusson
Suggested by Mitja Horvat (pinkfluid) in https://github.com/ulfalizer/Kconfiglib/pull/50. Kconfig.node_iter() iterates through all menu nodes in the menu tree in Kconfig order. This saves scripts the trouble of implementing their own tree walking code. Have node_iter() take a 'unique_syms' flag that can be enabled to only include symbols defined in multiple locations once. This is often what you want when generating output (and is used by write_config()). Order is still preserved. Piggyback a fix to a syntax error test comment. Parsing has been tightened up now.
2017-11-26print_tree.py: Style nitsUlf Magnusson
- Remove redundant parentheses in indent_print(). - Use unnumbered replacement fields with format().
2017-11-06Clean up examples a bitUlf Magnusson
conf -> kconf, for consistency, plus various nits.
2017-11-05Simplify redundant 'is (not) None' tests in examplesUlf Magnusson
2017-10-30Consistently use 0/1/2 for tristate valuesUlf Magnusson
Easier to work with, allowing e.g. direct comparisons with < and >. Make set_value() take 0, 1, 2 for bool and tristate symbols, and fix other APIs to match. Also: - Add introductions to various concepts in the module docstring. Document some more attributes. Still TODOs. - Rename the Config class to Kconfig. - Escape " and \ in the name of constant symbols when printing them. Also make the (un)escaping 100% consistent with how the C tools do it (\ before non-magic character should be unescaped too). - Clean up the escaping/unescaping code and provide two public escape()/unescape() functions. - Export the original MODULES-independent type in orig_type. It's needed for printing symbols in the reparsable __str__() Kconfig format with just public APIs. - Lots of other minor reorganizing and nits all over.
2017-10-25BackupUlf Magnusson
2017-10-24Kconfiglib 2 backupUlf Magnusson
WIP
2015-06-20Make all examples Python 3-friendly.Ulf Magnusson
print -> print(). Skip 'from __future__ import print_function' by only having a single argument (to avoid interpretation as tuples in Python 2). Keeps the examples simple.
2012-12-06Move examples into separate directory.Ulf Magnusson