| Age | Commit message (Collapse) | Author |
|
I wonder if there's a nicer way to get an italic link with RST...
|
|
|
|
|
|
|
|
Add the esp-idf script too.
|
|
|
|
|
|
|
|
To demonstrate some different possibilities. Will need to move some stuff around
later too.
|
|
Kconfiglib 2 has proper menuconfig support, and currently uses __slots__ too.
|
|
|
|
Less documentation duplication.
|
|
Also move it directly after the intro.
|
|
|
|
Copied straight from the module docstring, with some formatting added.
Need to update other parts too.
|
|
Add test coverage for that Choice.__repr__() path too.
|
|
|
|
Hit way too seldomly for it to make a performance difference, but a bit
neater. We know n, m, and y already exist since they're precreated.
|
|
Was only used by allyesconfig.py. Easy to add back if needed at any
point.
|
|
|
|
Doing a (hopefully) final pass through the docs before release.
|
|
Turns out to be kinda awkward to implement print_tree.py iteratively,
because the indent.
|
|
Consistent with e.g. _TOKEN_TO_REL.
|
|
Only symbols appear in choice.syms. Clearer.
|
|
Will be automatically calculated and cached as needed. Less magic code.
|
|
Always a MenuNode or None. Can be tested simpler.
|
|
|
|
Consistency
|
|
conf -> kconf, for consistency, plus various nits.
|
|
Can be implemented in a simpler/better way with Choice.assignable.
Also rename 'conf' to 'kconf' in allnoconfig.py for consistency.
|
|
Now in all paths that cache values.
|
|
Menu node pointers and .choice in particular is always either an object
or None. Prompts are always either a (text, cond) tuple or None. Some
other things could (though unlikely) be empty strings, and some things
use symbolic constants that might be 0, so keep the None tests there.
Cleaner, especially for menu nodes.
Also remove redundant 'node2.dep is None' test. Expressions are never
None.
Also fix node.prompt == "" comparison in _flatten(). Should be
node.prompt[0] == "". Not sure why the C implementation checks for an
existing but empty prompt to begin with. It's just cosmetic menu stuff
at least.
|
|
|
|
Don't need to handle them at all now that .assignable doesn't claim that
choice symbols in y-mode choices can be set to n. 20/20 hindsight.
|
|
Argument must be "X86" to get that output. "x86" just returns some
constant symbols.
|
|
Demonstrates expression fetching and walking. Basically a much better
version of get_ref_locations() from Kconfiglib 1, now that the user API
is flexible enough to implement it.
Should be it for new examples before release.
|
|
|
|
Handy for running menuconfig.py
|
|
|
|
Also avoid printing (None) as the name for unnamed (normal) choices.
|
|
- Detect a 0 weak reverse dependency earlier. Being implied is
rare, and the direct deps don't need to be calculated for symbols
that aren't.
Bit cleaner too, and closer to the rev. dep code.
Shaves a few % off the time spent in tri_value() while writing a
.config.
- Look at the symbol's visibility to determine the choice mode instead
of going to the choice itself. Works since the mode acts as an upper
bound on the visibility of choice symbols. No detectable performance
difference, but a bit cleaner anyway.
Piggyback some nits.
|
|
"List comprehensions no longer support the...",
https://docs.python.org/3.0/whatsnew/3.0.html
|
|
Still needs documentation and some cleanup.
Interface deliberately kept super simple/clunky to focus on the
concepts. Not something you'd actually want to use.
Sample session:
$ python Kconfiglib/examples/menuconfig.py Kconfiglib/examples/Kmenuconfig
======== Example Kconfig configuration ========
[*] Enable loadable module support (MODULES)
Bool and tristate symbols
[*] Bool symbol (BOOL)
[ ] Dependent bool symbol (BOOL_DEP)
< > Dependent tristate symbol (TRI_DEP)
[ ] First prompt (TWO_MENU_NODES)
< > Tristate symbol (TRI)
[ ] Second prompt (TWO_MENU_NODES)
*** These are selected by TRI_DEP ***
< > Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
< > Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
String, int, and hex symbols
(foo) String symbol (STRING)
(747) Int symbol (INT)
(0xABC) Hex symbol (HEX)
Various choices
-*- Bool choice (BOOL_CHOICE)
--> Bool choice sym 1 (BOOL_CHOICE_SYM_1)
Bool choice sym 2 (BOOL_CHOICE_SYM_2)
{M} Tristate choice (TRI_CHOICE)
< > Tristate choice sym 1 (TRI_CHOICE_SYM_1)
< > Tristate choice sym 2 (TRI_CHOICE_SYM_2)
[ ] Optional bool choice (OPT_BOOL_CHOICE)
Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): BOOL
Value for BOOL (available: n, y): n
======== Example Kconfig configuration ========
[*] Enable loadable module support (MODULES)
Bool and tristate symbols
[ ] Bool symbol (BOOL)
< > Tristate symbol (TRI)
[ ] Second prompt (TWO_MENU_NODES)
*** These are selected by TRI_DEP ***
< > Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
< > Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
String, int, and hex symbols
(foo) String symbol (STRING)
(747) Int symbol (INT)
(0xABC) Hex symbol (HEX)
Various choices
-*- Bool choice (BOOL_CHOICE)
--> Bool choice sym 1 (BOOL_CHOICE_SYM_1)
Bool choice sym 2 (BOOL_CHOICE_SYM_2)
{M} Tristate choice (TRI_CHOICE)
< > Tristate choice sym 1 (TRI_CHOICE_SYM_1)
< > Tristate choice sym 2 (TRI_CHOICE_SYM_2)
[ ] Optional bool choice (OPT_BOOL_CHOICE)
Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): MODULES
Value for MODULES (available: n, y): n
======== Example Kconfig configuration ========
[ ] Enable loadable module support (MODULES)
Bool and tristate symbols
[ ] Bool symbol (BOOL)
[ ] Tristate symbol (TRI)
[ ] Second prompt (TWO_MENU_NODES)
*** These are selected by TRI_DEP ***
[ ] Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
[ ] Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
String, int, and hex symbols
(foo) String symbol (STRING)
(747) Int symbol (INT)
(0xABC) Hex symbol (HEX)
Various choices
-*- Bool choice (BOOL_CHOICE)
--> Bool choice sym 1 (BOOL_CHOICE_SYM_1)
Bool choice sym 2 (BOOL_CHOICE_SYM_2)
-*- Tristate choice (TRI_CHOICE)
--> Tristate choice sym 1 (TRI_CHOICE_SYM_1)
Tristate choice sym 2 (TRI_CHOICE_SYM_2)
[ ] Optional bool choice (OPT_BOOL_CHOICE)
Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): ^D
Unsetting modules demonstrates one reason why it makes sense to have
.type be magic and change from TRISTATE to BOOL without modules
(<> = tristate, [] = bool). The C implementation uses the same trick.
(The original type is still available in .orig_type though.)
Piggyback printing of tristates as n, m, y in the warning for invalid
values in set_value().
|
|
Just return (2,). More intuitive, and makes y-mode choices just work in
the menuconfig example.
Turns out to be simple to implement with choice symbol visibility
depending on the Choice.
|
|
Usability improvement discovered while putting together menuconfig
example. Would have to duplicate validity checking otherwise.
Also reject negative values for HEX symbols, just to be compatible with
the C implementation.
Keep TRI_TO_STR and STR_TO_TRI public. They're pretty handy even if
they're trivial.
|
|
s/absolute/relative/
|
|
Used to set a bunch of other options too on MODULES in the test, but
it's cleaner to do it separately.
|
|
Tests for .assignable have been added.
|
|
Just add a column for the expected values for the no-modules case to the
existing tests.
Also automatically detect choice symbols in choices with y mode and
disable the value setting test, instead of having to pass a flag.
|
|
|