summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-04-14 10:30:51 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-04-14 10:30:51 (GMT)
commitdcd2dc2fffce8614c5d2b8d303a303a599b88a23 (patch)
treed958b795e7ef94281d84e879026de1caeb8ed82b /Tools
parent2f6d4da2784c79bfc8f3c38fda1ac4c95f6a3b11 (diff)
downloadcpython-dcd2dc2fffce8614c5d2b8d303a303a599b88a23.zip
cpython-dcd2dc2fffce8614c5d2b8d303a303a599b88a23.tar.gz
cpython-dcd2dc2fffce8614c5d2b8d303a303a599b88a23.tar.bz2
Patch #540583: Open MS Help Docs if available.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/idle/EditorWindow.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py
index 9dd51b6..47d2242 100644
--- a/Tools/idle/EditorWindow.py
+++ b/Tools/idle/EditorWindow.py
@@ -294,14 +294,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")