]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Let IDLE use the HTMLHelp docs, if found.
authorThomas Heller <theller@ctypes.org>
Mon, 22 Sep 2003 14:56:11 +0000 (14:56 +0000)
committerThomas Heller <theller@ctypes.org>
Mon, 22 Sep 2003 14:56:11 +0000 (14:56 +0000)
Lib/idlelib/EditorWindow.py

index d574b05fa1c5caa4da13032feebe937122a9ca6b..b1f19fced5706b75f888b099f2eea98cc2dea634 100644 (file)
@@ -50,6 +50,7 @@ class EditorWindow:
 
     def __init__(self, flist=None, filename=None, key=None, root=None):
         if EditorWindow.help_url is None:
+            dochome =  os.path.join(sys.prefix, 'Doc', 'index.html')
             if sys.platform.count('linux'):
                 # look for html docs in a couple of standard places
                 pyver = 'python-docs-' + '%s.%s.%s' % sys.version_info[:3]
@@ -59,8 +60,12 @@ class EditorWindow:
                     basepath = '/usr/share/doc/'  # standard location
                     dochome = os.path.join(basepath, pyver,
                                            'Doc', 'index.html')
-            else:
-                dochome =  os.path.join(sys.prefix, 'Doc', 'index.html')
+            elif sys.platform.count('win') or sys.platform.count('nt'):
+                # Try the HTMLHelp file
+                chmpath = os.path.join(sys.prefix, 'Doc',
+                                       'Python%d%d.chm' % sys.version_info[:2])
+                if os.path.isfile(chmpath):
+                    dochome = chmpath
             dochome = os.path.normpath(dochome)
             if os.path.isfile(dochome):
                 EditorWindow.help_url = dochome