summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-30allyesconfig: Prepare for packagingUlf Magnusson
Move to the root, simplify a bit, provide an entry point function (for setuptools's entry_points).
2018-05-28Simplify allyesconfig.py example with Kconfig.choicesUlf Magnusson
Could do something similar to allnoconfig.py for the packaged version.
2018-05-27Provide lists with all menus and commentsUlf Magnusson
Handy e.g. when implementing advanced search features.
2018-05-27Make Kconfig._choices publicUlf Magnusson
Useful in various places outside the library, e.g. in the upcoming packaged allyesconfig implementation, and when generating documentation.
2018-05-27Actually commit new allnoconfig.pyUlf Magnusson
Oops.
2018-05-27allnoconfig: Move from examples/ to rootUlf Magnusson
Put to-be-packaged stuff in the root. Use allnoconfig_simpler.py, and rename allnoconfig.py to allnoconfig_walk.py and keep it as an example.
2018-05-27oldconfig: Move from examples/ to rootUlf Magnusson
All the packaged code will appear in the root.
2018-05-27oldconfig: Prepare for packagingUlf Magnusson
setuptools' 'entry_points' gives nice behavior on Windows. It requires that the module has an entry point function. Create one and move the command line argument handling to it. Piggyback KCONFIG_CONFIG support, and make the script executable (oversight).
2018-05-27menuconfig: Always prompt for save when output file is missingUlf Magnusson
An output file should still be generated if you're happy with the default settings.
2018-05-27oldconfig: Show help with '?' instead of '??'Ulf Magnusson
This matches the C tools. Hadn't noticed they had the same feature.
2018-05-27Simplify error exitsUlf Magnusson
Had missed sys.exit(msg).
2018-05-27Get rid of the predefined UNAME_RELEASE symbolUlf Magnusson
Commit cbf32e2 ("Expand environment variables in strings directly") added direct expansion of environment variables is strings, with commit b9384a1 ("Restore compatibility with $UNAME_RELEASE") adding a hack to restore compatibility with the predefined $UNAME_RELEASE symbol, used by DEFCONFIG_LIST in the Linux kernel. With the compatibility hack in place, there's no longer any need to define UNAME_RELEASE as a proper symbol. Remove it.
2018-05-27menuconfig: Prepare for packagingUlf Magnusson
setuptools' 'entry_points' gives nice behavior on Windows. It requires that the module has an entry point function. Create one and move the command line argument handling to it.
2018-05-27Simplify unquoted string default checkUlf Magnusson
D'oh
2018-05-26Micro-optimize _parse_help() loopUlf Magnusson
Shaves ~6% off the _parse_help() runtime for the x86 Kconfigs in cProfile.
2018-05-25Style nitUlf Magnusson
2018-05-25Warn if quotes are omitted around string defaultsUlf Magnusson
This takes some heuristics, as it's indistinguishable from a reference to an undefined symbol. Guess that the quotes are missing if the 'default' value isn't all-uppercase.
2018-05-23Update genrest.py link to new locationUlf Magnusson
2018-05-22menuconfig: Move symbol name from title into info textUlf Magnusson
It's easy to miss at the top, especially as it's centered. Have a generic 'Symbol information', 'Choice information', etc., title instead.
2018-05-22menuconfig: Rearrange symbol name printing conditionUlf Magnusson
The name is always shown for items without prompts (which are always promptless symbols). Only show-name mode needs the symbol/choice check.
2018-05-22menuconfig: Add mode for showing all symbol namesUlf Magnusson
Pressing 'c' toggles show-name mode, where names of symbols are displayed before their prompt.
2018-05-21Fix link to genrest.pyUlf Magnusson
2018-05-21menuconfig: Don't show implicit menus in symbol infoUlf Magnusson
Only show "real" (non-indented) menus, like in the menu path at the top.
2018-05-21menuconfig: Quote symbol values in jump-to dialogUlf Magnusson
This is consistent with how they're shown in the info dialog. Looks less confusing for empty strings too.
2018-05-21menuconfig: Show symbol values in search resultsUlf Magnusson
Makes it double as a quick way to check if something is enabled. Suggested by Randy Dunlap.
2018-05-20menuconfig: Use lower() instead of re.IGNORECASE in searchUlf Magnusson
This gets rid of some slight input jerkiness while inputting e.g. '.*debug' on my machine (though the '.*' is redundant there), due to faster matching. The '.*' probably has bad interactions with re.search(), which matches anywhere in the string. A plain "debug" matches about 70% faster, though it's fast enough to feel instant anyway.
2018-05-20menuconfig: Style nitUlf Magnusson
2018-05-20menuconfig: Fix outdated 'matches' commentUlf Magnusson
2018-05-20menuconfig: Search names and prompts separatelyUlf Magnusson
Instead of doing a single search of the '<symbol name> "<prompt>"' string. This avoids gotchas like '_DEBUG$' not matching FOO_DEBUG if FOO_DEBUG has a prompt.
2018-05-20menuconfig: Formatting nitUlf Magnusson
2018-05-20menuconfig: Fix bad regex crash on Python 3.4-Ulf Magnusson
re.error.msg was added in Python 3.5. Show a generic error message when it isn't available.
2018-05-19menuconfig: Implement scroll offset for text boxesUlf Magnusson
This makes it clearer when an edit box is scrolled, especially when backspacing. The cursor will now only go to the far left/right of the edit box at the start/end of the string. Reuse _SCROLL_OFFSET to specify the scroll offset.
2018-05-19menuconfig: Add info and allow ~ in save/load dialogsUlf Magnusson
List the working directory, which might not be obvious, and support referring to the home directory with ~. Support for multiple lines of help text in input dialogs was added as well.
2018-05-19Warn for incompatible uses of 'option env=...'Ulf Magnusson
Since commit cbf32e2 ("Expand environment variables in strings directly"), Kconfiglib expands environment variables directly in strings instead of using the 'option env=...' mechanism (this is planned for the C tools too). This new behavior is backwards-compatible as long as all 'option env=...' symbols have the same name as the environment variables they reference. Warn if 'option env="FOO"' appears on a symbol that isn't named FOO, to point out compatibility issues and help with debugging.
2018-05-19Micro-optimize help text parsing some moreUlf Magnusson
This code is surprisingly hot.
2018-05-18menuconfig: Remove redundant information for menus and commentsUlf Magnusson
The Kconfig definition already lists the location and menu path, and now shows up at the top.
2018-05-18Get rid of _dedent_rstrip()Ulf Magnusson
Only a single caller left now, in a hot loop.
2018-05-18Warn if prompt contains leading or trailing whitespaceUlf Magnusson
Also strip the prompt in that case. Leading/trailing whitespace in prompts leads to ugly workarounds in e.g. reStructuredText documentation, where '*prompt *' is invalid.
2018-05-18Restore compatibility with $UNAME_RELEASEUlf Magnusson
UNAME_RELEASE is expanded in one of the 'default's of the DEFCONFIG_LIST symbol in the Linux kernel. This broke after "$FOO" was changed to directly expand to the value of the environment variable FOO, rather than to the value of the symbol FOO. Restore compatibility with a small wrapper.
2018-05-18menuconfig: Add .config loading dialogUlf Magnusson
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.
2018-05-18menuconfig: Don't show indentation-based menus in menu pathUlf Magnusson
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 ...
2018-05-18Refactor help text parsing loopUlf Magnusson
This is less twisty, and generates slightly smaller bytecode. Probably doesn't help to special-case the first line.
2018-05-17Move help text parsing into a separate functionUlf Magnusson
More readable.
2018-05-17Remove SRCARCH-related gotcha from module docstringUlf Magnusson
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.
2018-05-17Factor out adding of promptsUlf Magnusson
Get rid of some code duplication.
2018-05-17Factor out symbol type settingUlf Magnusson
Get rid of some code duplication.
2018-05-17Conditional reversal nitUlf Magnusson
2018-05-16Record which MenuNode has each propertyUlf Magnusson
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).
2018-05-16Expand environment variables in strings directlyUlf Magnusson
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.
2018-05-14menuconfig: Fix _CONVERT_C_LC_CTYPE_TO_UTF8 commentUlf Magnusson
Was using an older name.