diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2009-04-26 01:33:55 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2009-04-26 01:33:55 (GMT) |
commit | c34ed8e86972510f8a3ab161b175ef4a7619d6ab (patch) | |
tree | f4a2f5d9adf5fa568b460c91dc40b43dd85a219e /Lib/idlelib/EditorWindow.py | |
parent | 71efeb7cbf9645815f6bc565dee1f0787359356a (diff) | |
download | cpython-c34ed8e86972510f8a3ab161b175ef4a7619d6ab.zip cpython-c34ed8e86972510f8a3ab161b175ef4a7619d6ab.tar.gz cpython-c34ed8e86972510f8a3ab161b175ef4a7619d6ab.tar.bz2 |
Merged revisions 71812 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71812 | kurt.kaiser | 2009-04-22 22:36:01 -0400 (Wed, 22 Apr 2009) | 2 lines
Produce correct version string to access the .chm
docs on Windows. Patch 5783 gpolo. Will port.
........
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index cee7767..a38cdd1 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -24,6 +24,16 @@ from idlelib import macosxSupport # The default tab setting for a Text widget, in average-width characters. TK_TABWIDTH_DEFAULT = 8 +def _sphinx_version(): + "Format sys.version_info to produce the Sphinx version string used to install the chm docs" + major, minor, micro, level, serial = sys.version_info + release = '%s%s' % (major, minor) + if micro: + release += '%s' % micro + if level != 'final': + release += '%s%s' % (level[0], serial) + return release + def _find_module(fullname, path=None): """Version of imp.find_module() that handles hierarchical module names""" @@ -66,15 +76,13 @@ class EditorWindow(object): 'Doc', 'index.html') elif sys.platform[:3] == 'win': chmfile = os.path.join(sys.prefix, 'Doc', - 'Python%d%d.chm' % sys.version_info[:2]) + 'Python%s.chm' % _sphinx_version()) if os.path.isfile(chmfile): dochome = chmfile - elif macosxSupport.runningAsOSXApp(): # documentation is stored inside the python framework dochome = os.path.join(sys.prefix, 'Resources/English.lproj/Documentation/index.html') - dochome = os.path.normpath(dochome) if os.path.isfile(dochome): EditorWindow.help_url = dochome |