mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Produce correct version string to access the .chm
docs on Windows. Patch 5783 gpolo. Will port.
This commit is contained in:
		
							parent
							
								
									8100bd8431
								
							
						
					
					
						commit
						f13447f3f7
					
				
					 4 changed files with 22 additions and 10 deletions
				
			
		|  | @ -22,6 +22,16 @@ | |||
| # 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""" | ||||
| 
 | ||||
|  | @ -64,15 +74,13 @@ def __init__(self, flist=None, filename=None, key=None, root=None): | |||
|                                            '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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kurt B. Kaiser
						Kurt B. Kaiser