From: Steven M. Gava Date: Mon, 22 Apr 2002 00:38:26 +0000 (+0000) Subject: tracking python idle changes: X-Git-Tag: v2.3c1~5848 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=931625dc77cfd527b059e579615d517d8d994110;p=thirdparty%2FPython%2Fcpython.git tracking python idle changes: Patch #540583: Open MS Help Docs if available. --- diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 26400f378e5f..4f3c945b754a 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -325,14 +325,22 @@ class EditorWindow: help_url = "http://www.python.org/doc/current/" if sys.platform[:3] == "win": fn = os.path.dirname(__file__) - fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html") + fn = os.path.join(fn, os.pardir, os.pardir, "pythlp.chm") fn = os.path.normpath(fn) if os.path.isfile(fn): help_url = fn + else: + fn = os.path.dirname(__file__) + fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html") + fn = os.path.normpath(fn) + if os.path.isfile(fn): + help_url = fn del fn - - def python_docs(self, event=None): - self.display_docs(self.help_url) + def python_docs(self, event=None): + os.startfile(self.help_url) + else: + def python_docs(self, event=None): + self.display_docs(self.help_url) def display_docs(self, url): webbrowser.open(url)