| Age | Commit message (Collapse) | Author |
|
Adds commit 3b692df ("olddefconfig: Add script"), which bundles a new
script that mimics 'make olddefconfig'. This could also be accomplished
by entering the menuconfig interface and saving, but its more awkward.
Some minor internal documentation clarifications and cleanups are
included as well:
- Commit 53db3ee ("Clarify node_iter() documentation re. iteration order")
- Commit c1dcaa3 ("Refactor parsing to get rid of _saved_line")
- Commit 6aab113 ("Don't set filename and linenr on 'if' menu nodes")
|
|
Works like 'make olddefconfig', updating a configuration by filling in
default values for all new symbols.
This could also be accomplished by entering the 'menuconfig' interface
and saving the configuration, but it's more awkward and less obvious.
Piggyback two oldconfig changes:
- Mention KCONFIG_CONFIG
- Check if the .config file exists before parsing the Kconfig files,
instead of after
|
|
There's no way to query them later, as 'if's get flattened and removed,
and they're not needed during parsing either.
|
|
The old version might not have made it obvious that a node is visited
before its children.
|
|
Handle the line-after-help-text case specially, which allows _has_tokens
(renamed to _reuse_tokens) to be used as the unget mechanism for help
texts as well, leaving _saved_line unused. Move the _reuse_tokens check
into _next_line().
This makes _parse_block() as straightforward as _parse_properties(), and
simplifies _parse_properties() a tiny bit too by getting rid of the
'_tokens_i = -1' assignment.
|
|
Consistently indent with tabs, like in the actual output.
|
|
Do the PEP 8 ordering thingy with standard library imports first.
|
|
Style nits.
|
|
|
|
Adds commit c91e17c ("Give clearer errors for bad
endchoice/endif/endmenu nesting"). Previously, an
endchoice/endif/endmenu without a corresponding choice/if/menu generated
a cryptic "unrecognized construct" error.
|
|
Easier to read.
|
|
An endchoice/endif/endmenu with no corresponding choice/if/menu
generated a cryptic 'unrecognized construct' parse error. Improve the
error message so that the problem is pointed out explicitly:
kconfiglib.KconfigError: Kconfig:37: couldn't parse 'endmenu': no corresponding 'menu'
Reported in https://github.com/ulfalizer/Kconfiglib/issues/56.
|
|
|
|
|
|
Adds support for user-defined preprocessor functions in Python, which
can be used to get information from existing Python tools into Kconfig,
e.g. to have Kconfig symbols depend on hardware information stored in
some other format.
See commit b6827ca ("Add support for user-defined Python preprocessor
functions").
|
|
Allow preprocessor functions to be defined in Python by putting a module
called 'kconfigfunctions' into sys.path. Internally, this simply adds
the functions to the predefined functions in Kconfig._functions.
User-defined Python functions make it simple to integrate information
from existing Python tools into Kconfig, e.g. to have Kconfig symbols
depend on hardware information stored in some other format. This might
be used to get device tree information into Kconfig in Zephyr.
Piggyback module docstring documentation for some extensions that were
previously only mentioned in the README.
|
|
- Remove some unused imports
- Replace a lambda with a plain function
- Shorten some long lines
- Remove some redundant backslashes within brackets
|
|
Also remove some redundant backslashes within brackets.
|
|
Simplifies the code. Should promote new APIs.
Also fix list_undefined.py for recent kernels. More environment
variables are referenced now.
|
|
No idea where "menu." came from.
|
|
Adds commit b9b2ebb ("menuconfig: Add RGB color support to styles."),
which makes it possible to specify colors in MENUCONFIG_STYLE
using #RRGGBB notation.
The rendered colors may be more or less exact depending on terminal
capabilities. In the best case, we can redefine colors. Otherwise, we
fall back on the closest available color.
Contributed by Mitja Horvat (punkfluid).
|
|
- Point out where the styling part starts and ends
- Move _style_attr() into the styling part (by moving the comment)
- Move _name_and_val_str() and _expr_str() to later in the file, closer
to where they're used (mostly in the help dialog)
- Turn _input_dialog() input handling into one if-elif-... chain, like
for the other dialogs.
|
|
Prevent the 'Symbol/choice/menu/comment information' title string from
disappearing when it won't fit on the terminal.
Piggyback some code nits:
- Remove a redundant 'global _style'
- Use 'elif' after checking for KEY_RESIZE
- Consistently use '_sel_node_i = _menu_scroll = 0' to reset positions,
e.g. when entering menus
|
|
- Make the coding style a bit more consistent with the rest of the code
- Allow colors to be allocated from the xterm 256-color grayscale
range, and emulate it when dynamically allocating colors. Never
allocate above color number 255 though, as anything there would be
unknown territory.
- Switch back to consistently passing tuples to functions. This was the
original design, before I suggested changing it...
- Remove some repeated information from docstrings and fix some small
typos
- Make use of the element1=element2 feature in the style definition
for the 'default' style
|
|
Styles can now take a HTML notation as a color value:
- on terminals that support RGB color mode these are rendered
perfeclty
- on 256 color terminals the closes matching color is used
- on other terminals, the current color palette is scanned
and the closes matching color is used. This has few quirks
Example: Use "pure" red as selection foreground and "pure" blue as
background:
MENUCONFIG_STYLE="selection=fg:#ff0000,bg:#0000ff"
Additionally, it is possible to copy the style from other elements,
for example:
MENUCONFIG_STYLE="selection=fg:#ff0000,bg:#0000ff path=selection"
In the notation above, the "path" style will be copied from "selection".
|
|
Adds commit af6c8dc ("menuconfig: Fix some glitching on small
terminals"), which fixes some minor graphical glitching in the
menuconfig interface when the terminal is too small for things to fit.
Commit 374f488 ("Clean up kernel Makefile patch and add new targets")
adds some new targets to the Linux makefile patch as well, though the
makefile patch isn't bundled on PyPI.
|
|
|
|
|
|
Makes the README much less spammy.
|
|
- 'mainmenu' and dialog titles now get clipped instead of disappearing
when they don't fit
- Lines of text no longer wrap to the next line (this glitch was mostly
hidden if something was printed on the next line)
- Text in a dialog can no longer end up on top of the dialog's frame
|
|
The LD environment variable needs to be set now (in 4.19-rc2). It's
referenced by LD_DEAD_CODE_DATA_ELIMINATION.
The tests probably ought to run everything run via 'scriptconfig' in a
clean environment, because 'scriptconfig' automatically picks up
environment variables anyway. The current setup is nice in that it
indirectly catches stuff that might affect the defconfig tests though,
which don't use scriptconfig.
|
|
Add two new targets:
- 'make kmenuconfig' runs the menuconfig interface
- 'make dumpvarsconfig' lists all referenced environment variables
together with their values (assuming they used the preprocessor
syntax)
Remove the 'kconfiglibtestconfig' target, which is no longer used.
Also clean up the target definitions. The joys of ancient code.
|
|
|
|
New features:
- Commit ac8d152 ("menuconfig: Add support for custom color schemes
(aka styles)"), contributed by Mitja Horvat (pinkfluid), adds support
for configuring the style (colors and attributes) of menuconfig
interface elements by setting a new MENUCONFIG_STYLE environment
variable.
The format of MENUCONFIG_STYLE is documented in the menuconfig.py
module docstring. This format is now used internally as well to
define the predefined styles.
- Commit a092257 ("Allow macro expansion within symbol names") adds
support for expanding macros within symbol names. This could be used
e.g. to define template Kconfig files that get instantiated by
setting preprocessor variables before including them.
Other changes:
- Commit 6683213 ("Allow user values on 'option env' symbols") makes it
possible to give 'option env' symbols user values. There's no good
reason to disallow it (it's a leftover from an older way of
implementing them), and it simplifies the code a bit.
Note that 'option env' symbols are only supported for backwards
compatibility at this point. Environment variables can be expanded
directly.
|
|
Enforces that all windows are created from styles defined via the new
styling mechanism.
|
|
Mostly motivated by curses.COLORS, which depends on the terminal.
It's probably friendlier to run even if the style gets a bit messed up,
but it's also nice to point out problems.
Missing style templates and missing styles to the left of '=' are
pointed out now too, with the help of some flag hackery.
Prefix the warnings with 'menuconfig warning:' to make it easier to
distinguish them from warnings from Kconfiglib.
|
|
This is consistent with non-existent styles being ignored, and gives
some forwards/backwards compatibility.
I wonder if there should be a warning for both instead.
Piggyback some nits.
|
|
"color values are expected to be in the range 0 to COLORS-1", from
init_color(3ncurses).
|
|
Make the syntax 'fg:123' instead of 'fg:color123'. This is a bit easier
to type. Hex and octal constants are accepted as well.
|
|
- introduce the _parse_styles() function which can take a string
defintion and parse it into a color structure that can be used
by UI elements
- the _parse_styles() function modifies a global dictionary (_style)
which is subsequentially used to style the UI elements
- the _style_to_curses() function takes a string representation
of style colors and converts it to ncurses attributes.
For eaxmple: fg:brightred,bg:black,bold -> returns a color
pair representing brightred and black ORed with A_BOLD
- simplify _init_styles() as now the majority of the heavy lifting
is done by _parse_styles(). _init_styles() initializes the
default theme (either "defualt" or "monochrome")
- terminals without color capabilities are now handled by using
the "monochrome" theme. This theme doesn't use any colors
but rather just bold and standout attribtes.
- add support for the "underline" attribute
- add doctstring at the beginning describing the style syntax
- rename the _style() function to _style_attr() as it was conflicting
with the global _style dictionary
- introduce the StyleError exception; this one is thrown if an error
in the style syntax is encountered
|
|
Some grammar, some copy-paste errors ('string' should be 'name').
|
|
This is handled earlier in _tokenize() now.
|
|
The C implementation supports this (though it's undocumented, and unused
to far).
This can be used e.g. to dynamically instatiate symbols from template
files:
Kconfig.template:
config $(subsys)_LOG
bool "Enable logging for $(subsys)"
depends on $(subsys)_HAS_LOG
... other stuff dependent on $(subsys)
Elsewhere:
subsys = FOO
source "Kconfig.template"
subsys = BAR
source "Kconfig.template"
Pretty sure this can easily be abused, but it should be supported at
least.
|
|
Saves a few % of total parsing time, and probably some evaluation time
too. Microbenchmarking on Python 3 shows that 'is' is about 30% faster
than '==' for comparing integers on my machine.
This is safe even without assuming Python's small-integer optimization
(which caches objects for small integers, guaranteeing that small
integer literals always refer to the same object): We always refer to
symbolic constants using their symbolic names (_T_*, etc.), so they're
guaranteed to always refer to the same integer objects anyway.
This optimization is safe for client code too, unless you get some
unlikely situation where (1) there is no small-integer optimization, (2)
expressions get pickled and unpickled or the like, which would be unsafe
across Kconfiglib versions anyway, and (3) the client code tests
symbolic constants with 'is' instead of '==' (which isn't advertised as
safe, and a bad idea in general when pickling is involved). That's
probably too obscure to worry about.
|
|
Gets rid of a check, doesn't hurt. The check was added before
'option env' was changed to just add a 'default' under the hood.
Note: New Kconfig code doesn't need 'option env'. Environment variables
are now expanded directly, including in the C tools. 'option env' is
only maintained for backwards compatibility.
|
|
Invisible symbols are no longer shown in red outside of show-all mode.
|
|
Adds a small menuconfig tweak that could avoid some user confusion:
Commit 66a2bf5 ("menuconfig: Do not use red for invisible symbols
outside of show-all mode")
|
|
Invisible symbols can show up outside show-all mode if an invisible
symbol has visible symbols in an implicit (indented) submenu. Printing
them in red like in show-all mode is the perfectly consistent thing to
do, but might look confusing/broken.
Only print invisible symbols in red in show-all mode.
Also change the bracket style for all invisible bool/tristate symbols to
- - N_SYM
-M- M_SYM
-*- Y_SYM
That makes it clear that they can't be changed, even when they show up
outside show-all mode, and makes logical sense if that style is taken to
always mean that the symbol value can't be changed.
You lose a quick reference for whether a symbol is a bool or tristate,
but it's not a huge deal.
|
|
New features:
- Commit 84bd863 ("menuconfig: Add a more 'make menuconfig'-like color
scheme") adds an alternative menuconfig color scheme contributed by
contributed by Mitja Horvat (pinkfluid).
The new color scheme can be enabled by setting the environment
variable MENUCONFIG_THEME to 'aquatic'.
The default color scheme now also uses bold text for the selected
entry, like the 'aquatic' theme.
Fixes:
- Commit d1e2a65 ("menuconfig: Always show implicit submenus with
visible nodes") fixes a display issue involving prompt-only
conditions where visible child nodes could disappear outside of
show-all mode.
Other changes:
- Commit 0ed2ba0 ("Improve the running-without-Makefile-patch
documentation") updates the documentation on how to run Kconfiglib on
the Linux kernel without using the Makefile patch.
- Misc. internal menuconfig refactoring.
|
|
Show-all mode does not need to be enabled when jumping to an invisible
symbol with visible children from an implicit submenu, because the
invisible symbol will be shown anyway in that case.
Explicitly check whether the jumped-to node would be shown instead, and
enable show-all mode otherwise.
|