summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSteven M. Gava <elguavas@python.net>2002-04-22 00:38:26 (GMT)
committerSteven M. Gava <elguavas@python.net>2002-04-22 00:38:26 (GMT)
commit931625dc77cfd527b059e579615d517d8d994110 (patch)
tree5ef71f16e9d312c9ac06991154c7c63b90ae55a2 /Lib
parent8ee3cd47a9bf4f4ce9f4ac7ec0c5558cfb43a44c (diff)
downloadcpython-931625dc77cfd527b059e579615d517d8d994110.zip
cpython-931625dc77cfd527b059e579615d517d8d994110.tar.gz
cpython-931625dc77cfd527b059e579615d517d8d994110.tar.bz2
tracking python idle changes:
Patch #540583: Open MS Help Docs if available.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/EditorWindow.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 26400f3..4f3c945 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)