MCPcopy Index your code
hub / github.com/python/cpython / reset_help_menu_entries

Method reset_help_menu_entries

Lib/idlelib/editor.py:911–926  ·  view source on GitHub ↗

Update the additional help entries on the Help menu.

(self)

Source from the content-addressed store, hash-verified

909 type='int')
910
911 def reset_help_menu_entries(self):
912 """Update the additional help entries on the Help menu."""
913 help_list = idleConf.GetAllExtraHelpSourcesList()
914 helpmenu = self.menudict['help']
915 # First delete the extra help entries, if any.
916 helpmenu_length = helpmenu.index(END)
917 if helpmenu_length > self.base_helpmenu_length:
918 helpmenu.delete((self.base_helpmenu_length + 1), helpmenu_length)
919 # Then rebuild them.
920 if help_list:
921 helpmenu.add_separator()
922 for entry in help_list:
923 cmd = self._extra_help_callback(entry[1])
924 helpmenu.add_command(label=entry[0], command=cmd)
925 # And update the menu dictionary.
926 self.menudict['help'] = helpmenu
927
928 def _extra_help_callback(self, resource):
929 """Return a callback that loads resource (file or web page)."""

Callers 2

createmenubarMethod · 0.95

Calls 6

_extra_help_callbackMethod · 0.95
add_separatorMethod · 0.80
add_commandMethod · 0.80
indexMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected