| Age | Commit message (Collapse) | Author |
|
The scroll offset when scrolling up was one more than when scrolling
down, due to an off-by-one.
|
|
Only appeared in two of the scripts, and main() is such a common
convention anyway.
|
|
Mention that the old version of an overwritten configuration file is
saved to <filename>.old in a few different places, to make it easier to
discover.
|
|
|
|
A symbol with unsatisfied direct dependencies can end up with visible
children in an implicit submenu if it is selected (though that generates
a warning), so the optimization in _shown_nodes() isn't safe, and causes
the child nodes to not be shown outside show-all mode.
Just remove the optimization. Trying things out some more, everything's
plenty fast enough anyway.
Checking the direct dependencies of the parent instead would be safe.
|
|
|
|
|
|
|
|
Space toggles value is possible, and enters menus otherwise. Enter works
the other way around.
Make this explicit in the code, which also fixes some corner cases, like
space doing nothing on a y-selected menuconfig symbol.
|
|
Consistent with guiconfig.py and shorter.
|
|
Symbol.type is only needed when there might be tristates demoted to
bools due to modules being disabled. Symbol.orig_type is faster to read
otherwise (no @property magic).
|
|
Make a comment consistent with guiconfig.py.
|
|
Remember the last path that was manually saved/loaded instead of
reverting back to standard_config_filename() (e.g. .config).
Remember the path to the last saved minimal configuration separately as
well.
Also improve the _conf_changed behavior when loading a .config within
the interface. Instead of always treating it as needing to be saved,
check if it's outdated, like for the .config file loaded on startup.
Also make the exit message ("No changes to save", etc.) always include
the target .config file, which is helpful. Previously, only the save
message did.
|
|
When looking for visible children of invisible symbol nodes,
_shown_nodes() was always recursing all the way out the leaf nodes.
That's a ton of redundant work, though it doesn't seem to have lead to
noticeable slowness (it does in the GUI menuconfig).
Stop the search at symbol nodes with node.dep = n (from
'if'/'depends on'). Those can never have visible children, because
node.dep gets propagated to prompts.
|
|
Shorten a bit.
|
|
|
|
removing the matches.append lookup saves a few %, as measured with
line_profiler.
It's fast enough already on any reasonable machine, so it's a bit silly,
but it's pretty trivial.
|
|
Make things a bit more compact.
|
|
Won't affect behavior, but it was intended.
|
|
_shown_nodes() needs to check whether invisible 'menuconfig' symbols
with optional prompts have visible children, so that they can be shown
outside show-all mode. Previously, only 'config' symbols were checked.
|
|
|
|
Previously, symbols not defined with 'menuconfig' with children weren't
listed in the children's menu paths. It was deliberate, but it's
probably an anti-feature in retrospect, because it can make it harder to
find stuff by following the menu path.
Don't try to be clever and just list all the parent nodes in the menu
path.
|
|
This function isn't defined at the module level.
|
|
Bit shorter, as clear.
|
|
|
|
Items being added above the selected item would mess with the cursor
position too, if we didn't compensate.
|
|
Loading a new configuration with the cursor on an invisible item with
visible children (can happen with optional prompts) would needlessly
turn on show-all, even though such invisible items are always shown.
Fix it by doing a more explicit check for whether the selected item
shows up in the menu after loading the configuration, like
_toggle_show_all() and _jump_to() do.
|
|
Show-all mode is turned on if the node becomes invisible. The comment
said the opposite if you didn't include the parenthesis.
Piggyback some code nits.
|
|
Previously they were shown in white, due to an oversight in
_draw_main().
_draw_main() should use the same logic as _shown_nodes(). Move it into a
separate _visible() function and call it from both.
|
|
Roll the reversing into the slice.
|
|
|
|
|
|
People might miss it otherwise, and think they have to download and
install the wheels manually.
|
|
Test for Windows with os.name == 'nt' instead. Saves around 10 ms of
startup time.
|
|
Replace _menu_win_height() with two generic _height(win)/_width(win)
helpers and use them for other windows as well. Makes things a bit
easier to read.
|
|
|
|
Be consistent with the other utilities.
|
|
|
|
Previously, menuconfig.py only prompted for saving the configuration if
.config didn't exist or the user changed symbol values within the
interface.
Also make it prompt for save if Kconfig symbols have been added,
removed, or have had their defaults changed, provided it would make the
saved .config differ from the loaded one.
This usually won't matter for correctness, because loading an outdated
configuration performs an implicit olddefconfig, but it's less
confusing.
Also add a Kconfig.missing_syms attribute that records all assignments
to undefined symbols in the most recently loaded .config file. This is
needed to implement the check for whether the saved .config would be
different.
As an unrelated change, always prompt for saving if a .config has been
loaded from within the menuconfig interface. The intention is probably
often to save the configuration somewhere else, even if it isn't
modified.
|
|
Pressing F toggles show-help mode, where the help window at the bottom
displays the help text of the currently selected item, if any. Can be
handy when browsing through symbols.
Also mention the different modes that are available in the module
docstring.
|
|
Make the previously obligatory 'filename' argument to load_config() and
write_config() default to None, and have that implement the behavior
you'd usually want: read/write either KCONFIG_CONFIG or ".config" if
unset, and read the 'option defconfig_list' configuration file if
KCONFIG_CONFIG/".config" doesn't exist.
For load_config(), filename=None also allows the configuration file to
be missing without raising an error. load_config() returns True if a
local configuration file was loaded, which is useful to check in the
menuconfig (if no local configuration file exists, we always want to
prompt for saving the configuration when exiting).
Also add a 'verbose' argument (default True) to load_config() and
read_config() that makes them print which files were read/written in
filename=None mode.
Also generalize olddefconfig.py and oldconfig.py to not require there to
already be a local configuration file. This was a bit silly for
olddefconfig.py in particular.
Remove the examples/defconfig.py script. It's a duplicate of
olddefconfig.py.
|
|
|
|
One thing that irks me a bit about it is that it might give the idea
that menuconfigs have to include it, making things seem more complex
than they really are.
|
|
The thing it's talking about usually happens when some file with a named
choice is included multiple times with different dependencies.
|
|
|
|
When a Kconfig file defined a named choice and was included multiple
times, the choice symbols were listed multiple times in the menuconfig
as well (due to commit 17d7c1e ("menuconfig: Show all symbols at each
menu location for multi.def. choices")).
That's probably not what you want. Tweak it so that each symbol is only
shown once, with the prompt that was used for it at whatever choice
definition location is entered.
Also change how the choice selection is displayed before the choice is
entered, so that the prompt used for the selected symbol at that
particular location is used. Previously, the prompt at the first
definition location for the symbol was always used.
(Note that all of this is only about how things are displayed. It's not
essential to functionality, in case you're writing your own menuconfig.)
|
|
They're either proper menus, choices, or 'menuconfig' symbols.
|
|
This matches the C tools and is a bit less spammy. Maybe it's less clear
what it means at a glance, but it's probably less confusing for disabled
'menuconfig' symbols at least.
|
|
When scroll > max_scroll (blank space at the bottom of the menu, and
also scrolled down), moving the cursor down would snap the scroll back
to max_scroll, with a small annoying jump. This could happen when going
into show-all mode and moving the cursor down near the bottom of a menu,
for example.
Fix it by leaving the scroll as-is when scroll >= max_scroll (increasing
it by one otherwise).
|
|
Move the addition of the visible child nodes and use += instead of
extend().
|