| Age | Commit message (Collapse) | Author |
|
Not available with TERM=xterm (as opposed to xterm-256color).
Use fg:white instead of fg:brightwhite for dialog box bodies. Not a huge
difference.
Came up in https://github.com/espressif/esp-idf/issues/4387.
|
|
The bright colors in the range 8-15 are not ANSI and are not guaranteed
to be available.
Previously, the code assumed that all named colors are always available
on color terminals, and skipped the check against curses.COLORS. This
led to this error e.g. with TERM=xterm (as opposed to xterm-256color)
and the aquatic theme, which uses 'brightwhite':
_curses.error: init_pair() returned ERR
Fix it by checking the number returned for named colors against
curses.COLORS as well.
Came up in https://github.com/espressif/esp-idf/issues/4387.
|
|
Stuff like this is not the pinnacle of helpful design, and hides that
the commands actually have long help texts (that can be viewed with
pydoc):
$ ./menuconfig.py --help
[Errno 2] No such file or directory: '--help'
Fix it by converting standard_kconfig() to argparse, and add a
'description' argument to it for the command-specific help text. --help
now shows the same help text shown by pydoc, and some other error
messages are improved as well.
Also fix some copy-paste errors and outdated paths in the help texts for
the all*config commands.
|
|
|
|
Tell people to install something like windows-curses. Might help avoid
some trouble after commit 21b4c1e ("Do not automatically install
windows-curses on Windows").
|
|
It breaks installation with pip on MSYS2, and Kconfiglib can still be
useful without the terminal menuconfig.
Unfortunately, MSYS2 seems tricky to identify via environment markers
(https://www.python.org/dev/peps/pep-0508/#environment-markers).
This has breakage/annoyance potential, as windows-curses now needs to be
installed manually. The major Kconfiglib version will be increased.
Sorry if this change caused problems!
Fixes: #77
|
|
Most common case, and makes the symbol info read better.
|
|
menuconfig.py tended to crash on I/O errors on Python 2, due to
forgetting to update some 'except OSError's. Catch EnvironmentError
instead.
EnvironmentError is a common base class of IOError and OSError on Python
2, and an alias for OSError on Python 3. Use it elsewhere too, as it
might help catch obscure I/O errors on Python 2.
|
|
Forgot that they show defaults separately. Use orig_defaults instead of
'defaults' to de-spam it a bit. The direct dependencies are shown above
the defaults.
|
|
Might be less confusing in the context of locales.
|
|
Having LC_ALL=C and the like in Makefiles is probably pretty common, to
get consistent collation and messages from commands and stuff. It
currently makes menuconfig.py spit out a warning about changing the
locale to a UTF-8 locale though.
Just remove the message, and silently change the locale. The Python 3.7
PEP 538 code is silent as well.
|
|
Just cosmetic.
|
|
textwrap.indent() was added in Python 3.3.
|
|
|
|
Consistent with the other utilities, and now works even when 'python' is
Python 2.
|
|
|
|
Avoids turning it into a Unicode string on Python 2, which gets messy
when strings are compared.
|
|
Preparation for Python 2 compatibility. Also indirectly makes it
compatible with Python 3.2 and earlier (get_wch() was added in 3.3).
|
|
Preparation for Python 2 compatibility.
|
|
A wart of the warning control API (enable/disable_*_warnings()) is that
the current warning settings can't be queried. Querying warning settings
is useful in functions that want to temporarily enable/disable some
warning and then put things back to how they were.
kconfiglib.load_allconfig() ran into this, for example.
Make the internal warning control variables public (improve the naming
at the same time), and encourage just setting them directly. Keep the
old API for backwards compatibility.
Also remove _warn_redun_assign() and _warn_override(). They're trivial
and were called in a single place.
|
|
Hardcoding load_config() and write_(min_)config() to write any message
to stdout is awkward, because it means that the message can't be easily
reused when stdout is the wrong place to write it to (e.g. in
menuconfig/guiconfig). This gets extra bad now that there's also the "No
change to ..." message.
Modify load_config() and write_(min_)config() to return the message as a
string instead, and have them always return a message, instead of just
when 'filename' is None and verbose=True. This makes things flexible and
straightforward.
Use the new behavior in menuconfig.py and guiconfig.py. They now show
"No change to ..." when saving a file doesn't modify it.
Tools that want to write messages to stdout should now do
print(kconf.load_config()) / print(kconf.write_config()).
There's no clean way to preserve perfect backwards compatibility here,
but keep accepting the 'verbose' argument and print a deprecation
warning if a value is ever passed for it. That way, scripts will keep
running, though possibly with less output on stdout.
This changes the meaning of the load_config() return value as well,
though I suspect it was only ever used by the menuconfig/guiconfig
interfaces.
The new behavior applies for kconfiglib.VERSION >= (12, 0, 0).
|
|
Commit e81a77b ("Consistently put direct deps. last when propagating")
makes the position of the direct deps. in property conditions
predictable after dependency propagation, making it easy to strip them
as needed.
Use this to implement MenuNode.orig_{prompt,defaults,selects,implies,ranges},
which work like the non-orig_* versions but omit the direct deps. Use
those in turn to omit the direct deps in Symbol/Choice.__str__().
The direct deps. (with propagated parent deps.) can still be seen after
'depends on ...', so there is no loss of information.
This unclutters Kconfig definitions shown in menuconfig/guiconfig and in
any generated documentation. The old output also had duplicated
dependencies, though it doesn't matter for evaluation.
Before:
config A
bool
prompt "A" if DEP
default y if FOO && DEP
depends on DEP
After:
config A
bool
prompt "A"
default y if FOO
depends on DEP
|
|
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.
|