File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323copy_strip - Copy the text part of idle.html to help.html while rstripping each line.
2424
2525show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog.
26+
27+ _get_dochome() - Returns path to docs on users system if none found returns link to docs.python.org
2628"""
2729import os
2830import sys
@@ -292,16 +294,20 @@ def show_idlehelp(parent):
292294
293295
294296def _get_dochome ():
297+ """Returns path to local docs
298+
299+ If none found returns link to docs.python.org.
300+ """
295301 dochome = os .path .join (sys .base_prefix , 'Doc' , 'index.html' )
296302 if sys .platform .count ('linux' ):
297303 # look for html docs in a couple of standard places
298304 pyver = 'python-docs-' + '%s.%s.%s' % sys .version_info [:3 ]
299- if os .path .isdir ('/var/www/html/python/' ): # "python2" rpm
305+ if os .path .isdir ('/var/www/html/python/' ): # rpm package manager
300306 dochome = '/var/www/html/python/index.html'
301307 else :
302- basepath = '/usr/share/doc/' # standard location
303- dochome = os .path .join (basepath , pyver ,
304- 'Doc' , 'index.html' )
308+ basepath = '/usr/share/doc/' # dnf/apt package managers
309+ dochome = os .path .join (basepath , pyver , 'Doc' , 'index.html' )
310+
305311 elif sys .platform [:3 ] == 'win' :
306312 import winreg # Windows only, block only executed once.
307313 docfile = ''
You can’t perform that action at this time.
0 commit comments