tools: Update kconfiglib to 13.7.1

This fixes the crash on MacOs under Python 3 and improves the menuconfig
colors on some terminals.
This commit is contained in:
Roland Dobai
2020-01-13 12:04:54 +01:00
parent 647cb628a1
commit 3909208852
2 changed files with 118 additions and 104 deletions

View File

@@ -328,10 +328,10 @@ _STYLES = {
# Blue-tinted style loosely resembling lxdialog
"aquatic": """
path=fg:cyan,bg:blue,bold
separator=fg:white,bg:cyan,bold
path=fg:white,bg:blue
separator=fg:white,bg:cyan
help=path
frame=fg:white,bg:cyan,bold
frame=fg:white,bg:cyan
body=fg:white,bg:blue
edit=fg:black,bg:white
"""
@@ -1107,8 +1107,7 @@ def _enter_menu(menu):
global _menu_scroll
if not menu.is_menuconfig:
# Not a menu
return False
return False # Not a menu
shown_sub = _shown_nodes(menu)
# Never enter empty menus. We depend on having a current node.
@@ -1349,7 +1348,6 @@ def _draw_main():
term_width = _width(_stdscr)
#
# Update the separator row below the menu path
#
@@ -1396,7 +1394,6 @@ def _draw_main():
_menu_win.noutrefresh()
#
# Update the bottom separator window
#
@@ -1421,7 +1418,6 @@ def _draw_main():
_bot_sep_win.noutrefresh()
#
# Update the help window, which shows either key bindings or help texts
#
@@ -1442,7 +1438,6 @@ def _draw_main():
_help_win.noutrefresh()
#
# Update the top row with the menu path.
#
@@ -2302,7 +2297,6 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win,
edit_width = _width(edit_box) - 2
#
# Update list of matches
#
@@ -2333,7 +2327,6 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win,
matches_win.noutrefresh()
#
# Update bottom separator line
#
@@ -2346,7 +2339,6 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win,
bot_sep_win.noutrefresh()
#
# Update help window at bottom
#
@@ -2358,7 +2350,6 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win,
help_win.noutrefresh()
#
# Update edit box. We do this last since it makes it handy to position the
# cursor.
@@ -2448,12 +2439,10 @@ def _info_dialog(node, from_jump_to_dialog):
# Support starting a search from within the information dialog
if from_jump_to_dialog:
# Avoid recursion
return
return # Avoid recursion
if _jump_to_dialog():
# Jumped to a symbol. Cancel the information dialog.
return
return # Jumped to a symbol. Cancel the information dialog.
# Stay in the information dialog if the jump-to dialog was
# canceled. Resize it in case the terminal was resized while the
@@ -2500,7 +2489,6 @@ def _draw_info_dialog(node, lines, scroll, top_line_win, text_win,
text_win_height, text_win_width = text_win.getmaxyx()
# Note: The top row is deliberately updated last. See _draw_main().
#
@@ -2514,7 +2502,6 @@ def _draw_info_dialog(node, lines, scroll, top_line_win, text_win,
text_win.noutrefresh()
#
# Update bottom separator line
#
@@ -2527,7 +2514,6 @@ def _draw_info_dialog(node, lines, scroll, top_line_win, text_win,
bot_sep_win.noutrefresh()
#
# Update help window at bottom
#
@@ -2539,7 +2525,6 @@ def _draw_info_dialog(node, lines, scroll, top_line_win, text_win,
help_win.noutrefresh()
#
# Update top row
#
@@ -2598,8 +2583,7 @@ def _info_str(node):
_kconfig_def_info(choice)
)
# node.item in (MENU, COMMENT)
return _kconfig_def_info(node)
return _kconfig_def_info(node) # node.item in (MENU, COMMENT)
def _name_info(sc):
@@ -2956,7 +2940,6 @@ def _edit_text(c, s, i, hscroll, width):
max_scroll = max(len(s) - width + 1, 0)
hscroll = min(i - width + _SCROLL_OFFSET + 1, max_scroll)
return s, i, hscroll
@@ -3106,8 +3089,7 @@ def _check_valid(sym, s):
# Otherwise, displays an error and returns False.
if sym.orig_type not in (INT, HEX):
# Anything goes for non-int/hex symbols
return True
return True # Anything goes for non-int/hex symbols
base = 10 if sym.orig_type == INT else 16
try:
@@ -3164,12 +3146,17 @@ def _is_num(name):
def _getch_compat(win):
# Uses get_wch() if available (Python 3.3+) and getch() otherwise. Also
# handles a PDCurses resizing quirk.
# Uses get_wch() if available (Python 3.3+) and getch() otherwise.
#
# Also falls back on getch() if get_wch() raises curses.error, to work
# around an issue when resizing the terminal on at least macOS Catalina.
# See https://github.com/ulfalizer/Kconfiglib/issues/84.
#
# Also handles a PDCurses resizing quirk.
if hasattr(win, "get_wch"):
try:
c = win.get_wch()
else:
except (AttributeError, curses.error):
c = win.getch()
if 0 <= c <= 255:
c = chr(c)