| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Adds two small library/menuconfig improvements:
- Commit 7992519 ("Always strip trailing whitespace in 'MenuNode.help'
and __str__()") tightens up the format of strings a bit, and
documents it.
- Commit b810bda ("menuconfig: Support HOME and END in the jump-to
dialog") adds support for some keys that were missing from the
jump-to dialog.
|
|
Oversight. END can be handy for viewing all choices, menus, and
comments, which appear at the end.
Also support Ctrl-D as an alias for Page Down. Ctrl-U is already used by
the edit box (erase to beginning of line).
Also change the jump-to dialog title to hint that other things besides
symbols can be jumped to.
|
|
For strings with no $ or \ in them (99.86% of all strings in the Linux
x86 Kconfigs), we can just find() the matching quote directly.
Saves a few % of tokenization time.
|
|
|
|
Previously, you could get either one or two newlines at the end of
MenuNode.help and the various __str__() methods, though this wasn't
documented.
Always stripping trailing whitespace is cleaner e.g. when using print(),
which automatically appends a trailing newline, and makes things
consistent.
Hopefully nothing relied on the old undocumented behavior. It's fine for
genrest.py at least.
|
|
|
|
|
|
Adds a small menuconfig improvement: Commit 35af004 ("menuconfig: Move
cursor to choice selection when entering choices").
|
|
Previously, the first entry was selected, like for menus.
Also tweak _center_vertically() so that the menu is never scrolled down
when all entries fit on the screen.
|
|
Set UNKNOWN (representing 'no type') to 0, which is falsy, to simplify
some checks.
Also reorder some dictionary keys for consistency.
|
|
Adds fixes for two obscure crashes, related to consecutive empty if's
and toggling symbols without a type in the menuconfig:
- Commit 0e6cd82 ("Fix removal of multiple consecutive 'if' nodes")
- Commit db60270 ("menuconfig: Fix crash when toggling symbols without
a type")
|
|
Trying to toggle the following symbol crashed the menuconfig:
config FOO
prompt "foo"
Symbols defined without a type are pointless and generate a warning
(particular definition locations can omit the type, but some definition
location should give a type if the symbol is defined in multiple
locations). We should never crash for them though.
Fix the crash. The code assumed that the symbol's current value would
appear in Symbol.assignable, like for a visible bool/tristate, but
symbols without types get their name as their value.
Also skip printing "(NEW)" next to symbols without a type.
|
|
Despite 'if' nodes being flattened before 'if' removal, consecutive 'if'
nodes can still show up for code like the following:
...
if X
endif
if X
endif
...
_remove_ifs() failed to remove the second 'if' node, leading to a crash
e.g. when turning on show-all mode in the menuconfig in a menu with such
code (due to the unexpected 'if' node).
Stuff like the above could potentially result from 'osource's with no
matches, though I just spotted the error while looking over the code.
Fix the 'if' removal logic to properly handle consecutive 'if' nodes.
|
|
Adds commit 8be38f2 ("Don't show backtraces for expected exceptions in
tools"), which hides backtraces for expected errors from tools (like
Kconfig syntax errors and missing files).
|
|
KconfigError and IOError are part of normal operation and don't indicate
a problem with the library itself. Catch and print them in
standard_kconfig() and sys.exit(), to avoid spammy backtraces from e.g.
menuconfig.py when Kconfig files don't exist or have errors.
|
|
Can get away with a single variable by assigning node.list earlier, and
save a tiny bit of work with a chained assignment.
Also clarify what the tricky Python chained assignments correspond to,
where it matters.
|
|
Turns into a weird-looking 'Error loading ' otherwise.
Maybe Enter should be ignored for empty filenames instead...
|
|
Commit 14603c0 ("Make errno/strerror/filename available on IOError")
makes IOError/OSError.errno/strerror/filename available to scripts, when
it is raised from e.g. Kconfig.load_config().
Previously, some implementation trickery related to custom exception
messages meant that they weren't available.
|
|
An error reporting flaw was that most raised IOErrors got their
errno/strerror/filename fields stripped, due to wanting to show a custom
messages. The problem was that adding back 'errno' and 'strerror' made
IOError.__str__() always return a fixed string
("[Errno <errno>] <strerror>"), ignoring any custom message.
This is friendly to users, but unfriendly to scripts (the menuconfig had
a workaround). Make things friendly to both by raising an internal
subclass of IOError instead, that preserves errno/strerror/filename but
prints a custom message. The exception can then still be caught as
IOError/OSError by scripts.
|
|
|
|
After commit e0256b6 ("Have MENU and COMMENT match _T_MENU and
_T_COMMENT"), the only falsy value for node.item is None, since all
token constants are truthy (since they're never 0).
|
|
Tiny bit faster and smaller. Clear in context.
|
|
Same approach as for the expression type symbolic constants. Removes a
tiny bit of conversion and makes things a bit more consistent.
|
|
|
|
Made more sense when the code was part of _build_dep(). The same thing
is explained in the function docstring now.
|
|
Turn the _check_dep_loop_sym lookup into a LOAD_FAST inside the loop.
|
|
Adds commit 699fd81 ("Support enabling the assignment-to-undef. symbol
warning via the environment"). This makes it possible to enable the
warning for assigning an undefined symbol within a .config file, while
using the bundled tools.
Previously, enabling the warning required modifying the tools to call
Kconfig.enable_undef_warnings().
|
|
This makes it possible to enable it for the bundled tools, by setting
KCONFIG_WARN_UNDEF_ASSIGN=y. Previously, the code had to be modified to
call Kconfig.enable_undef_warnings().
Also rename KCONFIG_STRICT to KCONFIG_WARN_UNDEF, for consistency. Keep
supporting KCONFIG_STRICT as an alias for backwards compatibility.
|
|
_check_undef_syms() is the only caller.
|
|
- Commit 85ba6b2 ("menuconfig: Mention jump-to in info dialog help")
makes it a bit easier to discover that jump-to can be entered from
the info dialog.
- Commit d920dbe ("Use standard_sc_expr_str() in _name_and_loc()")
makes named choices show up as '<choice NAME>' in warnings, instead
of just as 'NAME'.
Some small parsing optimizations are included as well.
|
|
Makes choices show up as <choice (name, if any)>, which is nice.
Previously, just the name was shown for named choices.
|
|
Might be hard to discover that [/] works inside the info dialog
otherwise.
|
|
This makes the calls to Kconfig._warn() a bit less awkward (self._warn()
instead of sym/choice.kconfig._warn()).
Also move the loops over the symbols/choices into the functions, as a
small optimization.
|
|
Store the function in a local variable outside the loop in _build_dep().
|
|
- Commit 9a4127a ("Allow programmatically expanding preprocessor
functions with args") adds a Variable.expanded_value_w_args()
function for calling preprocessor functions programmatically.
Not being able to pass arguments to Variable.expanded_value was an
oversight.
- Commit 516deb4 ("menuconfig: Show the selected symbol for promptless
choices") makes menuconfig show the selected symbol next to
promptless choices in show-all mode. This is relevant for named
choices defined in multiple locations.
Some minor parsing optimizations are included as well.
|
|
Add a Variable.expanded_value_w_args() function for expanding a
preprocessor function with particular arguments. This is what
expanded_value should have been, because expanded_value_w_args() is more
general (expanded_value corresponds to zero arguments). Keep
expanded_value for backwards compatibility though.
Also add a simple __repr__() to Variable. It could show the expanded
value, but that might mean calling shell functions or user-defined
functions as a side effect (possibly with missing arguments). Not sure
that's a good idea, so just show the unexpanded value.
|
|
Can be treated as just another case, and moved later so that the cases
become sorted by frequency.
|
|
Use the Linux x86 Kconfig frequencies.
Most cases were already sorted, but the blank line case was treated
specially. 'imply' was checked too early too (though it's used more in
some other projects).
|
|
Turn _add_props_to_sc() into _add_props_to_sym(), and handle choices
separately, as they're trivial.
This gets rid of some if's too.
|
|
If a choice is defined in multiple locations to add symbols, and
show-all mode is turned on to reveal one of the promptless definitions,
then it doesn't hurt to show the selected symbol next to it.
|
|
|
|
Adds commit 98af94d ("Make Kconfig.choices match its description").
Previously, Kconfig.choices was accidentally identical to
Kconfig.unique_choices. It's now crappy as advertised, and keeps
duplicates.
Removing duplicates (while preserving order) was the original reason for
adding Kconfig.unique_defined_syms and Kconfig.unique_choices. It'd be
rare to need Kconfig.choices.
|
|
Kconfig.choices has accidentally been identical to
Kconfig.unique_choices all along, because named choices defined in
multiple locations (which are pretty obscure) were only added once.
Fix Kconfig.choices to match its description. This simplifies the code a
bit too.
Kconfig.unique_choices is usually what you want.
|
|
Use Kconfig.unique_choices instead of Kconfig.choices in the jump-to
dialog, as choices defined in multiple locations should only get their
menu nodes added once (to avoid redundant entries).
I noticed a related Kconfiglib issue while working on this:
Kconfig.choices has been identical to Kconfig.unique_choices all long,
so things were never actually broken.
That means Kconfig.choices should be fixed to match its description
though. The next commit will do that.
|
|
Can use the same function for both sort keys, and the logic
can be simplified a bit too.
The += is deliberate, to do in-place modification.
|
|
|
|
Adds two small menuconfig improvements/fixes:
- Commit 9a7b374 ("menuconfig: Fix some minor resizing jumpiness on
gnome-terminal")
- Commit 3d0dc9f ("menuconfig: Switch back to "very visible" cursor
after Ctrl-F")
|
|
gnome-terminal jerks a bit whenever the terminal is shrunk so that the
row with the cursor on it disappears. This is probably gnome-terminal
shoddiness, but it's pretty easy to work around by drawing stuff at the
top last, so do it.
No need to do it for the jump-to dialog, because the cursor is already
in the edit box at the top there.
|