[Python-checkins] r60161 - in python/trunk: Doc/extending/building.rst Doc/library/pydoc.rst Lib/pydoc.py

georg.brandl python-checkins at python.org
Mon Jan 21 18:13:03 CET 2008


Author: georg.brandl
Date: Mon Jan 21 18:13:03 2008
New Revision: 60161

Modified:
   python/trunk/Doc/extending/building.rst
   python/trunk/Doc/library/pydoc.rst
   python/trunk/Lib/pydoc.py
Log:
Adapt pydoc to new doc URLs.


Modified: python/trunk/Doc/extending/building.rst
==============================================================================
--- python/trunk/Doc/extending/building.rst	(original)
+++ python/trunk/Doc/extending/building.rst	Mon Jan 21 18:13:03 2008
@@ -80,7 +80,7 @@
           description = 'This is a demo package',
           author = 'Martin v. Loewis',
           author_email = 'martin at v.loewis.de',
-          url = 'http://www.python.org/doc/current/ext/building.html',
+          url = 'http://docs.python.org/extending/building',
           long_description = '''
    This is really just a demo package.
    ''',

Modified: python/trunk/Doc/library/pydoc.rst
==============================================================================
--- python/trunk/Doc/library/pydoc.rst	(original)
+++ python/trunk/Doc/library/pydoc.rst	Mon Jan 21 18:13:03 2008
@@ -59,7 +59,7 @@
 Python interpreter and typed ``import spam``.
 
 Module docs for core modules are assumed to reside in
-http://www.python.org/doc/current/lib/.  This can be overridden by setting the
+http://docs.python.org/library/.  This can be overridden by setting the
 :envvar:`PYTHONDOCS` environment variable to a different URL or to a local
 directory containing the Library Reference Manual pages.
 

Modified: python/trunk/Lib/pydoc.py
==============================================================================
--- python/trunk/Lib/pydoc.py	(original)
+++ python/trunk/Lib/pydoc.py	Mon Jan 21 18:13:03 2008
@@ -27,7 +27,7 @@
 
 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 @@
             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 @@
                                  '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 @@
                 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 @@
 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


More information about the Python-checkins mailing list