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

Method _extra_help_callback

Lib/idlelib/editor.py:928–941  ·  view source on GitHub ↗

Return a callback that loads resource (file or web page).

(self, resource)

Source from the content-addressed store, hash-verified

926 self.menudict['help'] = helpmenu
927
928 def _extra_help_callback(self, resource):
929 """Return a callback that loads resource (file or web page)."""
930 def display_extra_help(helpfile=resource):
931 if not helpfile.startswith(('www', 'http')):
932 helpfile = os.path.normpath(helpfile)
933 if sys.platform[:3] == 'win':
934 try:
935 os.startfile(helpfile)
936 except OSError as why:
937 messagebox.showerror(title='Document Start Failure',
938 message=str(why), parent=self.text)
939 else:
940 webbrowser.open(helpfile)
941 return display_extra_help
942
943 def update_recent_files_list(self, new_file=None):
944 "Load and update the recent files list and menus"

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected