From d4d31b2e901a3fbb46363cc9b2dc7efcb258a980 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 6 May 2019 12:36:59 +0200 Subject: guiconfig: Comment nits Move the global variable descriptions earlier, remove some redundant comments, and clarify that the Python 3-only comment in setup.py is talking about the terminal menuconfig. --- guiconfig.py | 119 +++++++++++++++++++++++++++++------------------------------ setup.py | 4 +- 2 files changed, 61 insertions(+), 62 deletions(-) diff --git a/guiconfig.py b/guiconfig.py index 8520ec0..1d0bf6f 100755 --- a/guiconfig.py +++ b/guiconfig.py @@ -78,9 +78,8 @@ from kconfiglib import Symbol, Choice, MENU, COMMENT, MenuNode, \ standard_kconfig, standard_config_filename -# If True, use .gif image data embedded in this file instead of separate image -# files. This avoids having to carry around a bunch of .gifs. See -# _load_images(). +# If True, use GIF image data embedded in this file instead of separate GIF +# files. See _load_images(). _USE_EMBEDDED_IMAGES = True @@ -96,6 +95,62 @@ def _main(): menuconfig(standard_kconfig()) +# Global variables used below: +# +# _root: +# The Toplevel instance for the main window +# +# _tree: +# The Treeview in the main window +# +# _jump_to_tree: +# The Treeview in the jump-to dialog. None if the jump-to dialog isn't +# open. Doubles as a flag. +# +# _jump_to_matches: +# List of Nodes shown in the jump-to dialog +# +# _menupath: +# The Label that shows the menu path of the selected item +# +# _backbutton: +# The button shown in single-menu mode for jumping to the parent menu +# +# _status_label: +# Label with status text shown at the bottom of the main window +# ("Modified", "Saved to ...", etc.) +# +# _id_to_node: +# We can't use Node objects directly as Treeview item IDs, so we use their +# id()s instead. This dictionary maps Node id()s back to Nodes. (The keys +# are actually str(id(node)), just to simplify lookups.) +# +# _cur_menu: +# The current menu. Ignored outside single-menu mode. +# +# _show_all_var/_show_name_var/_single_menu_var: +# Tkinter Variable instances bound to the corresponding checkboxes +# +# _show_all/_single_menu: +# Plain Python bools that track _show_all_var and _single_menu_var, to +# speed up and simplify things a bit +# +# _conf_filename: +# File to save the configuration to +# +# _minconf_filename: +# File to save minimal configurations to +# +# _conf_changed: +# True if the configuration has been changed. If False, we don't bother +# showing the save-and-quit dialog. +# +# We reset this to False whenever the configuration is saved. +# +# _*_img: +# PhotoImage instances for images + + def menuconfig(kconf): """ Launches the configuration interface, returning after the user exits. @@ -212,62 +267,6 @@ def _needs_save(): return False -# Global variables used below: -# -# _root: -# The Toplevel instance for the main window -# -# _tree: -# The Treeview in the main window -# -# _jump_to_tree: -# The Treeview in the jump-to dialog. None if the jump-to dialog isn't -# open. Doubles as a flag. -# -# _jump_to_matches: -# List of Nodes shown in the jump-to dialog -# -# _menupath: -# The Label that shows the menu path of the selected item -# -# _backbutton: -# The button shown in single-menu mode for jumping to the parent menu -# -# _status_label: -# Label with status text shown at the bottom of the main window -# ("Modified", "Saved to ...", etc.) -# -# _id_to_node: -# We can't use Node objects directly as Treeview item IDs, so we use their -# id()s instead. This dictionary maps Node id()s back to Nodes. (The keys -# are actually str(id(node)), just to simplify lookups.) -# -# _cur_menu: -# The current menu. Ignored outside single-menu mode. -# -# _show_all_var/_show_name_var/_single_menu_var: -# Tkinter Variable instances bound to the corresponding checkboxes -# -# _show_all/_single_menu: -# Plain Python bools that track _show_all_var and _single_menu_var, to -# speed up and simplify things a bit -# -# _conf_filename: -# File to save the configuration to -# -# _minconf_filename: -# File to save minimal configurations to -# -# _conf_changed: -# True if the configuration has been changed. If False, we don't bother -# showing the save-and-quit dialog. -# -# We reset this to False whenever the configuration is saved. -# -# _*_img: -# PhotoImage instances for images - - def _create_id_to_node(): global _id_to_node @@ -597,7 +596,7 @@ def _create_kconfig_desc(parent): def _add_vscrollbar(parent, widget): - # Adds a vertical scrollbar to widget that's only shown as needed + # Adds a vertical scrollbar to 'widget' that's only shown as needed vscrollbar = ttk.Scrollbar(parent, orient="vertical", command=widget.yview) diff --git a/setup.py b/setup.py index d8882a0..4ae6b0d 100644 --- a/setup.py +++ b/setup.py @@ -43,8 +43,8 @@ setuptools.setup( "setconfig", ), - # TODO: Don't install the menuconfig on Python 2. It won't run there. - # setuptools needs better documentation... + # TODO: Don't install the terminal menuconfig on Python 2. It won't run + # there. setuptools needs better documentation... entry_points={ "console_scripts": ( "menuconfig = menuconfig:_main", -- cgit v1.2.3