summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-21 17:13:03 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-21 17:13:03 (GMT)
commit0751d1ad2a1c4a66591d1a0208ff1e184c18fbbc (patch)
tree270f04a959c958ba7e2650fdf7eb8dfac1d5ff88 /Lib/pydoc.py
parentae747dccab69cb3828a3d51fafe41021f50882c9 (diff)
downloadcpython-0751d1ad2a1c4a66591d1a0208ff1e184c18fbbc.zip
cpython-0751d1ad2a1c4a66591d1a0208ff1e184c18fbbc.tar.gz
cpython-0751d1ad2a1c4a66591d1a0208ff1e184c18fbbc.tar.bz2
Adapt pydoc to new doc URLs.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 2d32316..c2b2088 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -27,7 +27,7 @@ to a file named "<name>.html".
Module docs for core modules are assumed to be in
- http://www.python.org/doc/current/lib/
+ http://docs.python.org/library/
This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
@@ -346,7 +346,7 @@ class Doc:
file = '(built-in)'
docloc = os.environ.get("PYTHONDOCS",
- "http://www.python.org/doc/current/lib")
+ "http://docs.python.org/library")
basedir = os.path.join(sys.exec_prefix, "lib",
"python"+sys.version[0:3])
if (isinstance(object, type(os)) and
@@ -355,11 +355,10 @@ class Doc:
'thread', 'zipimport') or
(file.startswith(basedir) and
not file.startswith(os.path.join(basedir, 'site-packages'))))):
- htmlfile = "module-%s.html" % object.__name__
if docloc.startswith("http://"):
- docloc = "%s/%s" % (docloc.rstrip("/"), htmlfile)
+ docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__)
else:
- docloc = os.path.join(docloc, htmlfile)
+ docloc = os.path.join(docloc, object.__name__ + ".html")
else:
docloc = None
return docloc
@@ -541,7 +540,7 @@ class HTMLDoc(Doc):
url = 'http://www.rfc-editor.org/rfc/rfc%d.txt' % int(rfc)
results.append('<a href="%s">%s</a>' % (url, escape(all)))
elif pep:
- url = 'http://www.python.org/peps/pep-%04d.html' % int(pep)
+ url = 'http://www.python.org/peps/pep-%04d' % int(pep)
results.append('<a href="%s">%s</a>' % (url, escape(all)))
elif text[end:end+1] == '(':
results.append(self.namelink(name, methods, funcs, classes))
@@ -1710,7 +1709,7 @@ has the same effect as typing a particular string at the help> prompt.
Welcome to Python %s! This is the online help utility.
If this is your first time using Python, you should definitely check out
-the tutorial on the Internet at http://www.python.org/doc/tut/.
+the tutorial on the Internet at http://docs.python.org/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and