From d0732cff9cef507d79d5c53fbcc648dd6f560ce5 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 10 Aug 2018 06:23:53 +0200 Subject: Improve naming in the custom expr. printing functions - *_fn() prefixes on functions are a bit silly. It makes more sense for the expr_str() parameter, so keep it there. - Use *_expr_str() instead of just *_str(), to make it clearer that these deal with expressions. --- menuconfig.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'menuconfig.py') diff --git a/menuconfig.py b/menuconfig.py index b1ca896..66ccca7 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -93,7 +93,7 @@ from kconfiglib import Symbol, Choice, MENU, COMMENT, MenuNode, \ BOOL, TRISTATE, STRING, INT, HEX, UNKNOWN, \ AND, OR, NOT, \ expr_str, expr_value, split_expr, \ - standard_sc_str_fn, \ + standard_sc_expr_str, \ TRI_TO_STR, TYPE_TO_STR, \ standard_kconfig, standard_config_filename @@ -243,7 +243,7 @@ def _style(fg_color, bg_color, attribs, no_color_extra_attribs=0, return color_attribs[(fg_color, bg_color)] | attribs -def _name_and_val_str_fn(sc): +def _name_and_val_str(sc): # Custom symbol printer that shows the symbol value after the symbol, used # for the information display @@ -262,11 +262,11 @@ def _name_and_val_str_fn(sc): return '{}(={})'.format(sc.name, sc.str_value) # For other symbols, use the standard format - return standard_sc_str_fn(sc) + return standard_sc_expr_str(sc) def _expr_str(expr): # Custom expression printer that shows symbol values - return expr_str(expr, _name_and_val_str_fn) + return expr_str(expr, _name_and_val_str) # Entry point when run as an executable, split out so that setuptools' @@ -1635,7 +1635,7 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win, sym = matches[i].item - sym_str = _name_and_val_str_fn(sym) + sym_str = _name_and_val_str(sym) if matches[i].prompt: sym_str += ' "{}"'.format(matches[i].prompt[0]) @@ -2087,7 +2087,7 @@ def _kconfig_def_info(item): s += "\n\n".join("At {}:{}, in menu {}:\n\n{}".format( node.filename, node.linenr, _menu_path_info(node), - textwrap.indent(node.custom_str(_name_and_val_str_fn), + textwrap.indent(node.custom_str(_name_and_val_str), " ")) for node in nodes) -- cgit v1.2.3