From de0b451c7f48cc51a16fa873b95cb7c63f0ee87c Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Thu, 13 Jul 2017 14:30:46 -0400 Subject: [PATCH 1/4] Document variables and methods for font and theme tabs. --- Lib/idlelib/configdialog.py | 419 +++++++++++++++++++++++++++++++++--- 1 file changed, 391 insertions(+), 28 deletions(-) diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index a2cfaab0d0acbe..b8bec1b7c0106d 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -38,10 +38,27 @@ class ConfigDialog(Toplevel): def __init__(self, parent, title='', _htest=False, _utest=False): """Show the tabbed dialog for user configuration. - parent - parent of this dialog - title - string which is the title of this popup dialog - _htest - bool, change box location when running htest - _utest - bool, don't wait_window when running unittest + Args: + parent - parent of this dialog + title - string which is the title of this popup dialog + _htest - bool, change box location when running htest + _utest - bool, don't wait_window when running unittest + + Instance Data Attributes: + parent: parent for dialog + title: Dialog title. + theme_elements: Dictionary of tags for text highlighting. + The key is the display name and the value is a tuple of + (tag name, display sort order). + + Widgets Bound to self: + fontlist: Set focus. + + Methods: + create_widgets + cancel: Bound to DELETE_WINDOW protocol. + load_configs + attach_var_callbacks """ Toplevel.__init__(self, parent) self.parent = parent @@ -92,7 +109,19 @@ def __init__(self, parent, title='', _htest=False, _utest=False): self.wait_window() def create_widgets(self): - "Create and place widgets for tabbed dialog." + """Create and place widgets for tabbed dialog. + + Widgets Bound to self: + tab_pages: TabbedPageSet + + Methods: + create_page_font_tab + create_page_highlight + create_page_keys + create_page_general + create_page_extensions + create_action_buttons + """ self.tab_pages = TabbedPageSet(self, page_names=['Fonts/Tabs', 'Highlighting', 'Keys', 'General', 'Extensions']) @@ -105,7 +134,23 @@ def create_widgets(self): self.create_action_buttons().pack(side=BOTTOM) def create_action_buttons(self): - "Return frame of action buttons for dialog." + """Return frame of action buttons for dialog. + + Methods: + ok + apply + cancel + help + + Widget Structure: + outer: Frame + buttons: Frame + (no assignment): Button (ok) + (no assignment): Button (apply) + (no assignment): Button (cancel) + (no assignment): Button (help) + (no assignment): Frame + """ if macosx.isAquaTk(): # Changing the default padding on OSX results in unreadable # text in the buttons. @@ -129,12 +174,36 @@ def create_action_buttons(self): def create_page_font_tab(self): """Return frame of widgets for Font/Tabs tab. - Configuration attributes: + Tk Variables: font_size: Font size. font_bold: Select font bold or not. font_name: Font face. space_num: Indentation width. edit_font: Font widget with default font name, size, and weight. + + Methods: + on_fontlist_select: Bound to fontlist button release + or key release. + set_font_sample: Command for opt_menu_font_size and + check_font_bold. + + Widget Structure: (*) widgets bound to self + frame + frame_font: LabelFrame + frame_font_name: Frame + font_name_title: Label + (*)fontlist: ListBox + scroll_font: Scrollbar + frame_font_param: Frame + font_size_title: Label + (*)opt_menu_font_size: DynOptionMenu - font_size + check_font_bold: Checkbutton - font_bold + frame_font_sample: Frame + (*)font_sample: Label + frame_indent: LabelFrame + frame_indent_size: Frame + indent_size_title: Label + (*)scale_indent_size: Scale - space_num """ parent = self.parent self.font_size = StringVar(parent) @@ -207,13 +276,40 @@ def create_page_font_tab(self): def create_page_highlight(self): """Return frame of widgets for Highlighting tab. - Configuration attributes: + Tk Variables: builtin_theme: Menu variable for built-in theme. custom_theme: Menu variable for custom theme. fg_bg_toggle: Toggle for foreground/background color. colour: Color of selected target. is_builtin_theme: Selector for built-in or custom theme. highlight_target: Menu variable for the highlight tag target. + + Methods: + get_colour: Command for button_set_colour. + set_colour_sample_binding: Command for fg_bg_toggle. + save_as_new_theme: Command for button_save_custom_theme. + set_theme_type: Command for is_builtin_theme. + delete_custom_theme: Command for button_delete_custom_theme. + + Widget Structure: (*) widgets bound to self + frame + frame_custom: LabelFrame + (*)text_highlight_sample: Text + (*)frame_colour_set: Frame + button_set_colour: Button + (*)opt_menu_highlight_target: DynOptionMenu - highlight_target + frame_fg_bg_toggle: Frame + (*)radio_fg: Radiobutton - fg_bg_toggle + (*)radio_bg: Radiobutton - fg_bg_toggle + button_save_custom_theme: Button + frame_theme: LabelFrame + theme_type_title: Label + (*)radio_theme_builtin: Radiobutton - is_builtin_theme + (*)radio_theme_custom: Radiobutton - is_builtin_theme + (*)opt_menu_theme_builtin: DynOptionMenu - builtin_theme + (*)opt_menu_theme_custom: DynOptionMenu - custom_theme + (*)button_delete_custom_theme: Button + (*)new_custom_theme: Label """ parent = self.parent self.builtin_theme = StringVar(parent) @@ -327,11 +423,38 @@ def tem(event, elem=element): def create_page_keys(self): """Return frame of widgets for Keys tab. - Configuration attributes: + Tk Variables: builtin_keys: Menu variable for built-in keybindings. custom_keys: Menu variable for custom keybindings. are_keys_builtin: Selector for built-in or custom keybindings. keybinding: Action/key bindings. + + Methods: + keybinding_selected: Bound to list_bindings button release. + get_new_keys: Command for button_new_keys. + set_keys_type: Command for are_keys_builtin. + delete_custom_keys: Command for button_delete_custom_keys. + save_as_new_key_set: Command for button_save_custom_keys. + + Widget Structure: (*) widgets bound to self + frame + frame_custom: LabelFrame + frame_target: Frame + target_title: Label + scroll_target_y: Scrollbar + scroll_target_x: Scrollbar + (*)list_bindings: ListBox + (*)button_new_keys: Button + frame_key_sets: LabelFrame + frames[0]: Frame + (*)radio_keys_builtin: Radiobutton - are_keys_builtin + (*)radio_keys_custom: Radiobutton - are_keys_builtin + (*)opt_menu_keys_builtin: DynOptionMenu - builtin_keys + (*)opt_menu_keys_custom: DynOptionMenu - custom_keys + (*)new_custom_keys: Label + frames[1]: Frame + (*)button_delete_custom_keys: Button + button_save_custom_keys: Button """ parent = self.parent self.builtin_keys = StringVar(parent) @@ -413,11 +536,42 @@ def create_page_keys(self): def create_page_general(self): """Return frame of widgets for General tab. - Configuration attributes: + Tk Variables: win_width: Initial window width in characters. win_height: Initial window height in characters. startup_edit: Selector for opening in editor or shell mode. autosave: Selector for save prompt popup when using Run. + + Methods: + help_source_selected: Bound to list_help button release. + helplist_item_edit: Command for button_helplist_edit. + helplist_item_add: Command for button_helplist_add. + helplist_item_remove: Command for button_helplist_remove. + + Widget Structure: (*) widgets bound to self + frame + frame_run: LabelFrame + startup_title: Label + (*)radio_startup_edit: Radiobutton - startup_edit + (*)radio_startup_shell: Radiobutton - startup_edit + frame_save: LabelFrame + run_save_title: Label + (*)radio_save_ask: Radiobutton - autosave + (*)radio_save_auto: Radiobutton - autosave + frame_win_size: LabelFrame + win_size_title: Label + win_width_title: Label + (*)entry_win_width: Entry - win_width + win_height_title: Label + (*)entry_win_height: Entry - win_height + frame_help: LabelFrame + frame_helplist: Frame + frame_helplist_buttons: Frame + (*)button_helplist_edit + (*)button_helplist_add + (*)button_helplist_remove + scroll_helplist: Scrollbar + (*)list_help: ListBox """ parent = self.parent self.win_width = StringVar(parent) @@ -683,7 +837,23 @@ def var_changed_autosave(self, *params): changes.add_option('main', 'General', 'autosave', value) def set_theme_type(self): - "Set available screen options based on builtin or custom theme." + """Set available screen options based on builtin or custom theme. + + Attributes accessed: + is_builtin_theme + + Attributes updated: + opt_menu_theme_builtin + opt_menu_theme_custom + button_delete_custom_theme + radio_theme_custom + + Called from: + handler for radio_theme_builtin and radio_theme_custom + delete_custom_theme + create_new_theme + load_theme_cfg + """ if self.is_builtin_theme.get(): self.opt_menu_theme_builtin.config(state=NORMAL) self.opt_menu_theme_custom.config(state=DISABLED) @@ -865,6 +1035,21 @@ def delete_custom_theme(self): The current theme is deactivated and the default theme is activated. The custom theme is permanently removed from the config file. + + Attributes accessed: + custom_theme + + Attributes updated: + radio_theme_custom + opt_menu_theme_custom + is_builtin_theme + builtin_theme + + Methods: + deactivate_current_config + save_all_changed_extensions + activate_config_changes + set_theme_type """ theme_name = self.custom_theme.get() delmsg = 'Are you sure you wish to delete the theme %r ?' @@ -896,6 +1081,18 @@ def get_colour(self): If a new color is selected while using a builtin theme, a name must be supplied to create a custom theme. + + Attributes accessed: + highlight_target + frame_colour_set + is_builtin_theme + + Attributes updated: + colour + + Methods: + get_new_theme_name + create_new_theme """ target = self.highlight_target.get() prev_colour = self.frame_colour_set.cget('bg') @@ -936,7 +1133,12 @@ def get_new_theme_name(self, message): return new_theme def save_as_new_theme(self): - "Prompt for new theme name and create the theme." + """Prompt for new theme name and create the theme. + + Methods: + get_new_theme_name + create_new_theme + """ new_theme_name = self.get_new_theme_name('New Theme Name:') if new_theme_name: self.create_new_theme(new_theme_name) @@ -947,6 +1149,18 @@ def create_new_theme(self, new_theme_name): Create the new theme based on the previously active theme with the current changes applied. Once it is saved, then activate the new theme. + + Attributes accessed: + builtin_theme + custom_theme + + Attributes updated: + opt_menu_theme_custom + is_builtin_theme + + Method: + save_new_theme + set_theme_type """ if self.is_builtin_theme.get(): theme_type = 'default' @@ -974,6 +1188,12 @@ def on_fontlist_select(self, event): Event can result from either mouse click or Up or Down key. Set font_name and example display to selection. + + Attributes updated: + font_name: Set to name selected from fontlist. + + Methods: + set_font_sample """ font = self.fontlist.get( ACTIVE if event.type.name == 'KeyRelease' else ANCHOR) @@ -981,7 +1201,22 @@ def on_fontlist_select(self, event): self.set_font_sample() def set_font_sample(self, event=None): - "Update the screen samples with the font settings from the dialog." + """Update the screen samples with the font settings from the dialog. + + Attributes accessed: + font_name + font_bold + font_size + + Attributes updated: + font_sample: Set to selected font name, size, and weight. + text_highlight_sample: Set to selected font name, size, and weight. + + Called from: + handler for opt_menu_font_size and check_font_bold + on_fontlist_select + load_font_cfg + """ font_name = self.font_name.get() font_weight = tkFont.BOLD if self.font_bold.get() else tkFont.NORMAL new_font = (font_name, self.font_size.get(), font_weight) @@ -989,7 +1224,23 @@ def set_font_sample(self, event=None): self.text_highlight_sample.configure(font=new_font) def set_highlight_target(self): - "Set fg/bg toggle and color based on highlight tag target." + """Set fg/bg toggle and color based on highlight tag target. + + Instance variables accessed: + highlight_target + + Attributes updated: + radio_fg + radio_bg + fg_bg_toggle + + Methods: + set_colour_sample + + Called from: + var_changed_highlight_target + load_theme_cfg + """ if self.highlight_target.get() == 'Cursor': # bg not possible self.radio_fg.config(state=DISABLED) self.radio_bg.config(state=DISABLED) @@ -1001,11 +1252,25 @@ def set_highlight_target(self): self.set_colour_sample() def set_colour_sample_binding(self, *args): - "Change color sample based on foreground/background toggle." + """Change color sample based on foreground/background toggle. + + Methods: + set_colour_sample + """ self.set_colour_sample() def set_colour_sample(self): - "Set the color of the frame background to reflect the selected target." + """Set the color of the frame background to reflect the selected target. + + Instance variables accessed: + theme_elements + highlight_target + fg_bg_toggle + text_highlight_sample + + Attributes updated: + frame_colour_set + """ # Set the colour sample area. tag = self.theme_elements[self.highlight_target.get()][0] plane = 'foreground' if self.fg_bg_toggle.get() else 'background' @@ -1013,7 +1278,25 @@ def set_colour_sample(self): self.frame_colour_set.config(bg=colour) def paint_theme_sample(self): - "Apply the theme colors to each element tag in the sample text." + """Apply the theme colors to each element tag in the sample text. + + Instance attributes accessed: + theme_elements + is_builtin_theme + builtin_theme + custom_theme + + Attributes updated: + text_highlight_sample: Set the tag elements to the theme. + + Methods: + set_colour_sample + + Called from: + var_changed_builtin_theme + var_changed_custom_theme + load_theme_cfg + """ if self.is_builtin_theme.get(): # Default theme theme = self.builtin_theme.get() else: # User theme @@ -1105,7 +1388,21 @@ def update_user_help_changed_items(self): ';'.join(self.user_helplist[num-1][:2])) def load_font_cfg(self): - "Load current configuration settings for the font options." + """Load current configuration settings for the font options. + + Retrieve current font values from idleConf.GetFont to set + as initial values for font widgets. + + Attributes updated: + fontlist: Populate with fonts from tkinter.font. + font_name: Set to current font. + opt_menu_font_size: Populate valid options tuple and set + to current size. + font_bold: Set to current font weight. + + Methods: + set_font_sample + """ # Set base editor font selection list. fonts = list(tkFont.families(self)) fonts.sort() @@ -1135,14 +1432,36 @@ def load_font_cfg(self): self.set_font_sample() def load_tab_cfg(self): - "Load current configuration settings for the tab options." + """Load current configuration settings for the tab options. + + Attributes updated: + space_num: Set to value from idleConf. + """ # Set indent sizes. space_num = idleConf.GetOption( 'main', 'Indent', 'num-spaces', default=4, type='int') self.space_num.set(space_num) def load_theme_cfg(self): - "Load current configuration settings for the theme options." + """Load current configuration settings for the theme options. + + Based on the is_builtin_theme toggle, the theme is set as + either builtin or custom and the initial widget values + reflect the current settings from idleConf. + + Attributes updated: + is_builtin_theme: Set from idleConf. + opt_menu_theme_builtin: List of default themes from idleConf. + opt_menu_theme_custom: List of custom themes from idleConf. + radio_theme_custom: Disabled if there are no custom themes. + custom_theme: Message with additional information. + opt_menu_highlight_target: Create menu from self.theme_elements. + + Methods: + set_theme_type + paint_theme_sample + set_highlight_target + """ # Set current theme type radiobutton. self.is_builtin_theme.set(idleConf.GetOption( 'main', 'Theme', 'default', type='bool', default=1)) @@ -1230,6 +1549,13 @@ def load_configs(self): Load configuration from default and user config files and populate the widgets on the config dialog pages. + + Methods: + load_font_cfg + load_tab_cfg + load_theme_cfg + load_key_cfg + load_general_cfg """ self.load_font_cfg() self.load_tab_cfg() @@ -1251,7 +1577,7 @@ def save_new_key_set(self, keyset_name, keyset): idleConf.userCfg['keys'].SetOption(keyset_name, event, value) def save_new_theme(self, theme_name, theme): - """Save a newly created theme. + """Save a newly created theme to idleConf. theme_name - string, the name of the new theme theme - dictionary containing the new theme @@ -1263,7 +1589,11 @@ def save_new_theme(self, theme_name, theme): idleConf.userCfg['highlight'].SetOption(theme_name, element, value) def deactivate_current_config(self): - "Remove current key bindings." + """Remove current key bindings. + + Iterate over window instances defined in parent and remove + the keybindings. + """ # Before a config is saved, some cleanup of current # config must be done - remove the previous keybindings. win_instances = self.parent.instance_dict.keys() @@ -1271,7 +1601,11 @@ def deactivate_current_config(self): instance.RemoveKeybindings() def activate_config_changes(self): - "Dynamically apply configuration changes" + """Apply configuration changes to current windows. + + Dynamically update the current parent window instances + with some of the configuration changes. + """ win_instances = self.parent.instance_dict.keys() for instance in win_instances: instance.ResetColorizer() @@ -1281,23 +1615,45 @@ def activate_config_changes(self): instance.reset_help_menu_entries() def cancel(self): - "Dismiss config dialog." + """Dismiss config dialog. + + Methods: + destroy: inherited + """ self.destroy() def ok(self): - "Apply config changes, then dismiss dialog." + """Apply config changes, then dismiss dialog. + + Methods: + apply + destroy: inherited + """ self.apply() self.destroy() def apply(self): - "Apply config changes and leave dialog open." + """Apply config changes and leave dialog open. + + Methods: + deactivate_current_config + save_all_changed_extensions + activate_config_changes + """ self.deactivate_current_config() changes.save_all() self.save_all_changed_extensions() self.activate_config_changes() def help(self): - "Create textview for config dialog help." + """Create textview for config dialog help. + + Attrbutes accessed: + tab_pages + + Methods: + view_text: Method from textview module. + """ page = self.tab_pages._current_page view_text(self, title='Help for IDLE preferences', text=help_common+help_pages.get(page, '')) @@ -1459,7 +1815,14 @@ def set_extension_value(self, section, opt): return self.ext_userCfg.SetOption(section, name, value) def save_all_changed_extensions(self): - """Save configuration changes to the user config file.""" + """Save configuration changes to the user config file. + + Attributes accessed: + extensions + + Methods: + set_extension_value + """ has_changes = False for ext_name in self.extensions: options = self.extensions[ext_name] From 4c8d6576d8129e7a7881d1d4f883debfdb659e0a Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Thu, 13 Jul 2017 15:11:54 -0400 Subject: [PATCH 2/4] Document variables and methods for font and theme tabs. --- Lib/idlelib/configdialog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index b8bec1b7c0106d..859e6f1fe9e06b 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -1816,10 +1816,10 @@ def set_extension_value(self, section, opt): def save_all_changed_extensions(self): """Save configuration changes to the user config file. - + Attributes accessed: extensions - + Methods: set_extension_value """ From 2ad0d3790d8db6ce1e9255b5231698eb8c088aa4 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 13 Jul 2017 22:52:19 -0400 Subject: [PATCH 3/4] Add missing function, move data definition. --- Lib/idlelib/configdialog.py | 97 ++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 34 deletions(-) diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 859e6f1fe9e06b..5d818bb40e9a5e 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -44,21 +44,11 @@ def __init__(self, parent, title='', _htest=False, _utest=False): _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unittest - Instance Data Attributes: - parent: parent for dialog - title: Dialog title. - theme_elements: Dictionary of tags for text highlighting. - The key is the display name and the value is a tuple of - (tag name, display sort order). - - Widgets Bound to self: - fontlist: Set focus. + Note: Focus set on font page fontlist. Methods: create_widgets cancel: Bound to DELETE_WINDOW protocol. - load_configs - attach_var_callbacks """ Toplevel.__init__(self, parent) self.parent = parent @@ -74,22 +64,6 @@ def __init__(self, parent, title='', _htest=False, _utest=False): # Each theme element key is its display name. # The first value of the tuple is the sample area tag name. # The second value is the display name list sort index. - self.theme_elements={ - 'Normal Text': ('normal', '00'), - 'Python Keywords': ('keyword', '01'), - 'Python Definitions': ('definition', '02'), - 'Python Builtins': ('builtin', '03'), - 'Python Comments': ('comment', '04'), - 'Python Strings': ('string', '05'), - 'Selected Text': ('hilite', '06'), - 'Found Text': ('hit', '07'), - 'Cursor': ('cursor', '08'), - 'Editor Breakpoint': ('break', '09'), - 'Shell Normal Text': ('console', '10'), - 'Shell Error Text': ('error', '11'), - 'Shell Stdout Text': ('stdout', '12'), - 'Shell Stderr Text': ('stderr', '13'), - } self.create_widgets() self.resizable(height=FALSE, width=FALSE) self.transient(parent) @@ -121,6 +95,10 @@ def create_widgets(self): create_page_general create_page_extensions create_action_buttons + load_configs: Load pages except for extensions. + attach_var_callbacks + remove_var_callbacks + activate_config_changes: Tell editors to reload. """ self.tab_pages = TabbedPageSet(self, page_names=['Fonts/Tabs', 'Highlighting', 'Keys', 'General', @@ -178,14 +156,19 @@ def create_page_font_tab(self): font_size: Font size. font_bold: Select font bold or not. font_name: Font face. + Note: these 3 share var_changed_font callback. space_num: Indentation width. + + Data Attribute: edit_font: Font widget with default font name, size, and weight. Methods: + load_font_cfg: Set vars and fontlist. on_fontlist_select: Bound to fontlist button release or key release. set_font_sample: Command for opt_menu_font_size and check_font_bold. + load_tab_cfg: Get current. Widget Structure: (*) widgets bound to self frame @@ -277,19 +260,33 @@ def create_page_highlight(self): """Return frame of widgets for Highlighting tab. Tk Variables: + colour: Color of selected target. builtin_theme: Menu variable for built-in theme. custom_theme: Menu variable for custom theme. fg_bg_toggle: Toggle for foreground/background color. - colour: Color of selected target. + Note: this has no callback. is_builtin_theme: Selector for built-in or custom theme. highlight_target: Menu variable for the highlight tag target. - Methods: - get_colour: Command for button_set_colour. - set_colour_sample_binding: Command for fg_bg_toggle. - save_as_new_theme: Command for button_save_custom_theme. - set_theme_type: Command for is_builtin_theme. - delete_custom_theme: Command for button_delete_custom_theme. + Instance Data Attributes: + theme_elements: Dictionary of tags for text highlighting. + The key is the display name and the value is a tuple of + (tag name, display sort order). + + Methods [attachment]: + load_theme_cfg: Load current highlight colors. + get_colour: Invoke colorchooser [button_set_colour]. + set_colour_sample_binding: Call set_colour_sample [fg_bg_toggle]. + set_highlight_target: set fg_bg_toggle, set_color_sample(). + set_colour_sample: Set frame background to target. + on_new_colour_set: Set new color and add option. + paint_theme_sample: Recolor sample. + get_new_theme_name: Get from popup. + create_new_theme: Combine theme with changes and save. + save_as_new_theme: Save [button_save_custom_theme]. + set_theme_type: Command for [is_builtin_theme]. + delete_custom_theme: Ativate default [button_delete_custom_theme]. + save_new_theme: Save to userCfg['theme'] (is function). Widget Structure: (*) widgets bound to self frame @@ -311,6 +308,22 @@ def create_page_highlight(self): (*)button_delete_custom_theme: Button (*)new_custom_theme: Label """ + self.theme_elements={ + 'Normal Text': ('normal', '00'), + 'Python Keywords': ('keyword', '01'), + 'Python Definitions': ('definition', '02'), + 'Python Builtins': ('builtin', '03'), + 'Python Comments': ('comment', '04'), + 'Python Strings': ('string', '05'), + 'Selected Text': ('hilite', '06'), + 'Found Text': ('hit', '07'), + 'Cursor': ('cursor', '08'), + 'Editor Breakpoint': ('break', '09'), + 'Shell Normal Text': ('console', '10'), + 'Shell Error Text': ('error', '11'), + 'Shell Stdout Text': ('stdout', '12'), + 'Shell Stderr Text': ('stderr', '13'), + } parent = self.parent self.builtin_theme = StringVar(parent) self.custom_theme = StringVar(parent) @@ -430,11 +443,17 @@ def create_page_keys(self): keybinding: Action/key bindings. Methods: + load_key_config: Set table. + load_keys_list: Reload active set. keybinding_selected: Bound to list_bindings button release. get_new_keys: Command for button_new_keys. + get_new_keys_name: Call popup. + create_new_key_set: Combine active keyset and changes. set_keys_type: Command for are_keys_builtin. delete_custom_keys: Command for button_delete_custom_keys. save_as_new_key_set: Command for button_save_custom_keys. + save_new_key_set: Save to idleConf.userCfg['keys'] (is function). + deactivate_current_config: Remove keys bindings in editors. Widget Structure: (*) widgets bound to self frame @@ -543,10 +562,13 @@ def create_page_general(self): autosave: Selector for save prompt popup when using Run. Methods: + load_general_config: help_source_selected: Bound to list_help button release. + set_helplist_button_states: Toggle based on list. helplist_item_edit: Command for button_helplist_edit. helplist_item_add: Command for button_helplist_add. helplist_item_remove: Command for button_helplist_remove. + update_user_help_changed_items: Fill in changes. Widget Structure: (*) widgets bound to self frame @@ -1674,6 +1696,13 @@ def create_page_extensions(self): All values are treated as text, and it is up to the user to supply reasonable values. The only exception to this are the 'enable*' options, which are boolean, and can be toggled with a True/False button. + + Methods: + load_extentions: + extension_selected: Handle selection from list. + create_extension_frame: Hold widgets for one extension. + set_extension_value: Set in userCfg['extensions']. + save_all_changed_extensions: Call extension page Save(). """ parent = self.parent frame = self.tab_pages.pages['Extensions'].frame From a593ed58773c18f92d93f385e9d01a014dbf6e6d Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 13 Jul 2017 23:11:37 -0400 Subject: [PATCH 4/4] Blurb --- Misc/NEWS.d/next/IDLE/2017-07-13-23-07-33.bpo-30913.aezn_e.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/IDLE/2017-07-13-23-07-33.bpo-30913.aezn_e.rst diff --git a/Misc/NEWS.d/next/IDLE/2017-07-13-23-07-33.bpo-30913.aezn_e.rst b/Misc/NEWS.d/next/IDLE/2017-07-13-23-07-33.bpo-30913.aezn_e.rst new file mode 100644 index 00000000000000..23a9fe86ccbd32 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2017-07-13-23-07-33.bpo-30913.aezn_e.rst @@ -0,0 +1,3 @@ +IDLE: Document ConfigDialog tk Vars, methods, and widgets in docstrings This +will facilitate improving the dialog and splitting up the class. Original +patch by Cheryl Sabella.