mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Let IDLE use the HTMLHelp docs on Windows, if found.
Already 'backported' to release23-maint.
This commit is contained in:
parent
ccfbfb9ea5
commit
84ef153c74
1 changed files with 6 additions and 2 deletions
|
@ -50,6 +50,7 @@ class EditorWindow:
|
||||||
|
|
||||||
def __init__(self, flist=None, filename=None, key=None, root=None):
|
def __init__(self, flist=None, filename=None, key=None, root=None):
|
||||||
if EditorWindow.help_url is None:
|
if EditorWindow.help_url is None:
|
||||||
|
dochome = os.path.join(sys.prefix, 'Doc', 'index.html')
|
||||||
if sys.platform.count('linux'):
|
if sys.platform.count('linux'):
|
||||||
# look for html docs in a couple of standard places
|
# look for html docs in a couple of standard places
|
||||||
pyver = 'python-docs-' + '%s.%s.%s' % sys.version_info[:3]
|
pyver = 'python-docs-' + '%s.%s.%s' % sys.version_info[:3]
|
||||||
|
@ -59,8 +60,11 @@ class EditorWindow:
|
||||||
basepath = '/usr/share/doc/' # standard location
|
basepath = '/usr/share/doc/' # standard location
|
||||||
dochome = os.path.join(basepath, pyver,
|
dochome = os.path.join(basepath, pyver,
|
||||||
'Doc', 'index.html')
|
'Doc', 'index.html')
|
||||||
else:
|
elif sys.platform.count('win') or sys.platform.count('nt'):
|
||||||
dochome = os.path.join(sys.prefix, 'Doc', 'index.html')
|
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)
|
dochome = os.path.normpath(dochome)
|
||||||
if os.path.isfile(dochome):
|
if os.path.isfile(dochome):
|
||||||
EditorWindow.help_url = dochome
|
EditorWindow.help_url = dochome
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue