| Age | Commit message (Collapse) | Author |
|
Automatically turn on show-all mode if the currently selected node
becomes invisible after loading the new configuration.
Show an are-you-sure dialog if there are unsaved changes.
A wart here is that there currently isn't a way to get 'errno' and
'strerror' from the IOError exception returned by load_config(). Hack
around it by opening the configuration file separately with open()
first, just to catch any obvious errors.
|
|
Don't show A in the menu path at the top when entering the menu "B"
below, which will be indented relative to A. It looks confusing, and can
lead to really long menu paths.
config A
bool "A"
menu "B"
depends on A
...
|
|
This is less twisty, and generates slightly smaller bytecode. Probably
doesn't help to special-case the first line.
|
|
More readable.
|
|
Now that environment variables are expanded directly with
os.path.expandvars(), "$SRCARCH" will be kept as is if SRCARCH isn't
set. arch/$SRCARCH/Kconfig won't exist, unlike arch//Kconfig.
|
|
Get rid of some code duplication.
|
|
Get rid of some code duplication.
|
|
|
|
This allows accurate documentation to be generated for symbols and
choices defined in multiple locations. There are now MenuNode.defaults,
MenuNode.selects, etc., lists that mirror the corresponding
Symbol/Choice lists.
Symbol/Choice.__str__() now correctly show property locations as well,
by simply concatenating the strings returned by MenuNode.__str__() for
each node.
_parse_properties() was modified to add all properties directly to the
menu node instead of adding them to the contained symbol or choice. The
properties are then copied up to symbols and choices in
_finalize_tree(). Dependency propagation is handled at the same time.
As a side effect, this cleans up the code a bit and de-bloats
_parse_properties().
Update the menuconfig implementation to use the new functionality. It
now lists the menu nodes for symbols and choices with the correct
properties for each node (previously, all defaults, selects, implies,
and ranges appeared on the first definition).
|
|
Make "$FOO" directly reference the environment variable $FOO in e.g.
'source' statements, instead of the symbol FOO. Use os.path.expandvars()
to expand strings (which preserves "$FOO" as-is if no environment
variable FOO exists).
This gets rid of the 'option env' "bounce" symbols, which are mostly
just spam and are buggy in the C tools (dependencies aren't always
respected, due to parsing and evaluation getting mixed up). The same
change will probably appear soon in the C tools as well.
Keep accepting 'option env' to preserve some backwards compatibility,
but ignore it when expanding strings. For compatibility with the C
tools, bounce symbols will need to be named the same as the environment
variables they reference (which is the case for the Linux kernel).
This is a compatibility break, so the major version will be bumped to 6
at the next release.
The main motivation for adding this now is to allow recording properties
on each MenuNode in a clean way. 'option env' symbols interact badly
with delayed dependency propagation.
Side note: I have a feeling that recording environment variable values
might be redundant to trigger rebuilds if sync_deps() is run at each
compile. It should detect all changes to symbol values due to
environment variables changing value.
|
|
Was using an older name.
|
|
Works like in readline/Vim.
|
|
|
|
|
|
|
|
|
|
The cache was broken due to using an old variable name.
Piggyback a neat trick for storing globals in default arguments that I
had missed until now.
|
|
Search and display prompts for menu nodes that have them. They often
contain useful strings.
Add a pre-search pass that generates a string to search/display for each
menu node, to allow the search regex(es) to run over a single string.
That also makes 'foo bar' match for a symbol that has 'FOO' in its name
and 'bar' in its prompt, which is handy.
Remove the '(in menu X)' string that was added previously for symbols
defined in multiple locations. You'd usually be able to tell which menu
node is which from the (lack of) prompt.
|
|
A search like 'host usb' now finds all symbol names that match both
'host' and 'usb' (as regular expressions), including e.g. USB_MTU3_HOST.
This saves typing a bunch of '.*' and makes it easier to find symbols
when you aren't sure what order the components appear in.
|
|
Cleaner to do it in _menuconfig(), as it makes the fullscreen dialogs
fully independent. Saves some code too.
|
|
Might have made it sound like _parent_menu() returns a list.
|
|
Air some long conditionals out a bit. Be more consistent with format().
|
|
Can't get { } since {} implies n isn't assignable.
|
|
The horizontal scroll (hscroll) wasn't initialized properly when the
initial (prefilled) contents of an edit box was longer than the edit box
itself (e.g. when saving with a long path in KCONFIG_CONFIG). Things
snapped back into place once a key was pressed.
Initialize hscroll properly to fix the initial rendering.
|
|
If LC_CTYPE is set to the C locale, try to convert it to a UTF-8 locale.
Use a list of commonly available UTF-8 locales. Give up and use the C
locale if none of them are available.
This fixes curses Unicode I/O issues on systems with bad defaults:
ncurses configures itself from the locale settings, and the C locale
implies ASCII.
The logic mirrors https://www.python.org/dev/peps/pep-0538/. I took the
list of locales to try from the CPython code (in Python/pylifecycle.c).
|
|
Makes it easier to see the menu structure.
Make the indent configurable via a _SUBMENU_INDENT configuration
variable.
|
|
Should probably move the screenshots out into a separate section soon.
|
|
Pressing [/] brings up a dialog with an edit box where a regex can be
entered. The list of matching symbols is always shown below it.
Selecting a symbol and pressing [Enter] jumps directly to it in the menu
tree. If the symbol is invisible, show-all mode is turned on
automatically.
This commit also includes a bunch of more-or-less unrelated changes from
poking around with the code:
- Some redundant styles were merged. Probably wouldn't want to have a
different style for each separator line, for example...
- [ESC] in the top menu now works like [Q]
- Returning to a parent menu now makes sure that the selected row is
visible, even if the terminal was shrunk between entering the child
menu and leaving it.
- A _max_scroll() helper was factored out to reduce code duplication.
It takes a list of items and a window in which the list is
displayed, with one row per item, and returns the minimum scroll
value that will make the final item visible.
- The save dialog now pops up a message to confirm that the save was
successful.
- Lots of minor code nits all over (renamings, etc.)
|
|
Previously, the title of the current menu disappeared off the right edge
of the terminal for long menu paths. Scroll the menu path to the right
if needed to make sure it is always shown.
|
|
Don't bother to show the save-and-quit dialog.
Also quit immediately if the configuration hasn't been changed since the
last time it was explicitly saved with the save dialog.
Rename _set_node() to _set_node_tri_val(), as the old name gets
confusing with the new _set_val() function.
|
|
Works the same as in mconf.
|
|
When show-all mode is enabled, all items in the current menu are shown,
including promptless and invisible items. Promptless items are shown
with their name within <> brackets in place of the prompt.
This will make it possible to jump to invisible items once the jump-to
feature is added. It is also a handy feature on its own.
.config loading from within the interface will make use of it as well,
in case the current menu becomes complete invisible.
Piggyback various code cleanups. Rename _visible* to _shown*, as it now
includes invisible items in show-all mode.
|
|
Enough people have run into exceptions due to running in the C locale
that it seems worthwhile.
Add a new 'encoding' parameter to Kconfig.__init__() that specifies the
encoding to use and make it default to "utf-8". Passing None gives the
old behavior of using the encoding specified in the environment.
Related PEP: https://www.python.org/dev/peps/pep-0538/
|
|
|
|
New features:
- ed3ceaa ("Make warnings available in a list")
API changes:
- 8983f7e ("Make disable_warnings() disable all warnings")
This is a minor API behavior change, so the major version is bumped.
It's unlikely to break anything people were depending on.
|
|
Also make printing of warnings to stderr optional. It's on by default,
since it's almost always what you want.
This makes printing and processing of warnings more flexible, compared
to always printing warnings to stderr as soon as they're generated. It
was inspired by wanting to promote certain warnings to errors in Zephyr,
which previously required capturing stderr.
|
|
|
|
...including the optional ones. Previously, those were independent.
This is more intuitive, and it seems unlikely that you'd want some of
the optional warnings printed without having general warnings printed.
This is a small API behavior change, so the major version will be bumped
to 5 at the next release. Programs that enabled optional warnings
without enabling general warnings will be affected.
This means that all warnings now go through the same code path, which
will come in handy for later changes (making the warnings available in a
list, though with stderr printing still enabled by default).
Add some more documentation for the Kconfig.__init__() 'warn' parameter
and the enable_redun_warnings() function as well, and clean up the
variable naming a bit.
|
|
4.2.1 should have been 4.3.0. That was not a bugfix release. Braino.
|
|
New features:
- 105c835 ("Add helper for splitting expressions")
- 509e374 ("Add Choice.direct_dep field")
A terminal menuconfig implementation has been added which relies on
these features.
Other improvements:
- c1c5ef2 ("Print a warning for malformed .config lines")
- 09b8c58 ("Give filename and context for UnicodeDecodeError")
|
|
To avoid confusing it with the new terminal menuconfig implementation.
Clean up the README a bit at the same time, removing some stuff that's
less essential now (e.g. the menuconfig_example.py "screenshot").
|
|
|
|
|
|
|
|
|
|
Uses the 'curses' module, which is in the Python standard library. Only
Python 3 is supported, mostly due to Unicode support.
Windows support is provided through an external package which adds
support for the 'curses' module on Windows.
See the changes and the docstring in the newly added menuconfig.py for
more information.
Piggyback a README notes mentioning that Kconfiglib supports Unicode.
|
|
These errors are a pain to debug otherwise, and might look like
Kconfiglib brokenness.
Another option would be ignore decoding errors, or do the
'surrogateescape' thing on reading and writing, but keep it simple for
now. Pointing out the problem might be more helpful.
|
|
Flag lines matching neither 'CONFIG_FOO=...' nor
'# CONFIG_FOO is not set' that aren't blank or comments.
|
|
Same as Symbol.direct_dep (OR of node dependencies from all definition
locations). It's handy to have available when generating information
about choices.
|
|
I've had to implement the logic for walking reverse dependencies (from
select) a couple of times now, and it's always a bit tricky to get
right. Reduce code duplication and simplify things by adding a helper
function split_expr() that splits an expression into a list of either
its AND or OR operands.
A nice side effect is that e.g. the warning generated for selecting a
symbol with unsatisfied direct dependencies now lists the selecting
symbols in the order that they appear in the Kconfig files.
split_expr() might be helpful for splitting other types of expressions
as well, e.g. to put operands on separate lines when generating
documentation.
|