Skip to content

Commit 9a57bfa

Browse files
Add docstrings and comments
1 parent 51f729c commit 9a57bfa

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Lib/idlelib/help.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
copy_strip - Copy the text part of idle.html to help.html while rstripping each line.
2424
2525
show_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
"""
2729
import os
2830
import sys
@@ -292,16 +294,20 @@ def show_idlehelp(parent):
292294

293295

294296
def _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 = ''

0 commit comments

Comments
 (0)