summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2003-09-23 20:53:10 (GMT)
committerThomas Heller <theller@ctypes.org>2003-09-23 20:53:10 (GMT)
commit84ef153c74decf0b036042b5ca3f5cb3cd785edd (patch)
tree6b89dd664c4ddd60b98511081dec3f75c3648acc /Lib/idlelib/EditorWindow.py
parentccfbfb9ea587b6a6cc21d9ae05cb4778ca333fc9 (diff)
downloadcpython-84ef153c74decf0b036042b5ca3f5cb3cd785edd.zip
cpython-84ef153c74decf0b036042b5ca3f5cb3cd785edd.tar.gz
cpython-84ef153c74decf0b036042b5ca3f5cb3cd785edd.tar.bz2
Let IDLE use the HTMLHelp docs on Windows, if found.
Already 'backported' to release23-maint.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index d574b05..0f0961c 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -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,11 @@ 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'):
+ chmfile = os.path.join(sys.prefix, "Python%d%d.chm" % sys.version_info[:2])
+ if os.path.isfile(chmfile):
+ dochome = chmfile
+ print "dochome =", dochome
dochome = os.path.normpath(dochome)
if os.path.isfile(dochome):
EditorWindow.help_url = dochome