From: Raymond Hettinger Date: Mon, 23 Sep 2002 14:17:15 +0000 (+0000) Subject: Backport patch #540583: Open MS Help Docs if available. X-Git-Tag: v2.2.2b1~160 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30d4ceb2778cceb0b8b01a69984dded5ed6746a7;p=thirdparty%2FPython%2Fcpython.git Backport patch #540583: Open MS Help Docs if available. --- diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index 35395310a68f..c8f7cb38f575 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -295,14 +295,23 @@ 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): - webbrowser.open(self.help_url) + def python_docs(self, event=None): + os.startfile(self.help_url) + else: + def python_docs(self, event=None): + webbrowser.open(self.help_url) def select_all(self, event=None): self.text.tag_add("sel", "1.0", "end-1c")