summaryrefslogtreecommitdiff
path: root/menuconfig.py
AgeCommit message (Collapse)Author
2018-06-24menuconfig: Style nitUlf Magnusson
2018-06-24menuconfig: Remove redundant _update_menu() callUlf Magnusson
The _update_menu() call at the end of _change_node() is redundant, because _set_val() already calls _update_menu() if the value changes
2018-06-22menuconfig: Fix some pylint code nitsUlf Magnusson
Wrong indentation, unused imports.
2018-06-22menuconfig: Simplify [N]/[M]/[Y] implementationUlf Magnusson
All three act on the currently selected node, so the code that fetches it can be moved into the helper function.
2018-06-22menuconfig: Simplify is_num() a bitUlf Magnusson
2018-06-18Add Nordic Semiconductor ASA as shared menuconfig copyright holderUlf Magnusson
Largely paid work, and it's copied into Zephyr, so it was a request. All other source files are still copyright me. Nothing changes in practice. I went for shared copyright to make sure the ISC license can never be changed.
2018-06-15menuconfig: Remove redundant int() argumentUlf Magnusson
Base 10 is the default.
2018-06-12menuconfig: Fix searching for nonexistent objectsTomasz Gorochowik
This commit fixes an issue when user searches for a nonexistent object (e.g. adsdsaasda) and presses enter. Having all the key checks in one continuous if statement makes sure that the very last 'else' statement does not get executed when enter is pressed. Note - backported from: https://github.com/zephyrproject-rtos/zephyr/pull/8332
2018-06-11menuconfig: Support viewing symbol info from within the jump-to dialogUlf Magnusson
Ctrl-F (Ctrl-H clashes with backspace) brings up the information dialog for the selected item in the jump-to dialog. Since it's now possible to jump directly from the information dialog to the jump-to dialog and vice versa, recursive invocation becomes possible. Work around it with a flag to _info_dialog() that makes '/' return if the information dialog was launched from within the jump-to dialog. (Recursive invocations work code-wise, but act in a confusing way.)
2018-06-11menuconfig: Support starting a search from the info dialogUlf Magnusson
It's annoying to have to leave the information dialog just to do a search related to something you saw in the information dialog. Stay in the information dialog if the search is canceled.
2018-06-06Add license tags to scriptsUlf Magnusson
Everything's ISC.
2018-05-31menuconfig: Fix outdated commentUlf Magnusson
cached_search_strings was renamed to cached_search_nodes.
2018-05-30Add tool helper for loading/saving .config filesUlf Magnusson
Removes repeated KCONFIG_CONFIG boilerplate. Also make allyesconfig use KCONFIG_CONFIG when writing (oversight), and document the sys.exit() behavior for standard_kconfig().
2018-05-30Add tool helper for selecting the top-level KconfigUlf Magnusson
standard_kconfig() gets the top-level Kconfig file from the first command-line argument, defaulting to "Kconfig". This removes some boilerplate from tools.
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-27Simplify error exitsUlf Magnusson
Had missed sys.exit(msg).
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-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-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-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-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-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-14menuconfig: Fix _CONVERT_C_LC_CTYPE_TO_UTF8 commentUlf Magnusson
Was using an older name.
2018-05-13menuconfig: Add Ctrl-W support to edit boxesUlf Magnusson
Works like in readline/Vim.
2018-05-11menuconfig: Style nitUlf Magnusson
2018-05-11menuconfig: Jump-to code nitUlf Magnusson
2018-05-11menucomment: Comment clarity nitUlf Magnusson
2018-05-11menuconfig: Code style nitUlf Magnusson
2018-05-11Fix _search_strings() cacheUlf Magnusson
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.
2018-05-11menuconfig: Add prompts to incremental searchUlf Magnusson
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.
2018-05-10menuconfig: Add search with multiple search stringsUlf Magnusson
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.
2018-05-10menuconfig: Refactor resizing after fullscreen dialogsUlf Magnusson
Cleaner to do it in _menuconfig(), as it makes the fullscreen dialogs fully independent. Saves some code too.
2018-05-10menuconfig: Remove confusing menu list commentUlf Magnusson
Might have made it sound like _parent_menu() returns a list.
2018-05-10Style nitsUlf Magnusson
Air some long conditionals out a bit. Be more consistent with format().
2018-05-09menuconfig: Misleading comment nitUlf Magnusson
Can't get { } since {} implies n isn't assignable.
2018-05-09menuconfig: Fix rendering of long prefilled edit box stringUlf Magnusson
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.
2018-05-08menuconfig: Convert the C locale to a UTF-8 locale for LC_CTYPEUlf Magnusson
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).