]> granicus.if.org Git - python/commitdiff
tracking python idle changes:
authorSteven M. Gava <elguavas@python.net>
Mon, 22 Apr 2002 00:38:26 +0000 (00:38 +0000)
committerSteven M. Gava <elguavas@python.net>
Mon, 22 Apr 2002 00:38:26 +0000 (00:38 +0000)
Patch #540583: Open MS Help Docs if available.

Lib/idlelib/EditorWindow.py

index 26400f378e5fa727b3bac2ca6e54c77a703fe087..4f3c945b754a160d38111c2604b5e96d88de68fe 100644 (file)
@@ -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)