[Python-checkins] distutils2: Started writing documentation

tarek.ziade python-checkins at python.org
Sun Jun 20 23:04:52 CEST 2010


tarek.ziade pushed 22d3939f9c82 to distutils2:

http://hg.python.org/distutils2/rev/22d3939f9c82
changeset:   203:22d3939f9c82
user:        Josip Djolonga
date:        Fri Jun 11 15:37:07 2010 +0200
summary:     Started writing documentation
files:       docs/source/conf.py, docs/source/index.rst, docs/source/pkgutil.rst, src/distutils2/_backport/pkgutil.py

diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -17,12 +17,13 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #sys.path.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath(os.path.join(__file__, '..', '..', '..', 'src')))
 
 # -- General configuration -----------------------------------------------------
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = []
+extensions = ['sphinx.ext.autodoc']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/docs/source/index.rst b/docs/source/index.rst
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -12,6 +12,7 @@
    :maxdepth: 2
 
    metadata
+   pkgutil
 
 Indices and tables
 ==================
diff --git a/docs/source/pkgutil.rst b/docs/source/pkgutil.rst
new file mode 100644
--- /dev/null
+++ b/docs/source/pkgutil.rst
@@ -0,0 +1,9 @@
+=======
+pkgutil
+=======
+
+API Reference
+=============
+
+.. automodule:: distutils2._backport.pkgutil
+   :members:
diff --git a/src/distutils2/_backport/pkgutil.py b/src/distutils2/_backport/pkgutil.py
--- a/src/distutils2/_backport/pkgutil.py
+++ b/src/distutils2/_backport/pkgutil.py
@@ -502,11 +502,11 @@
     if one wants to distribute different parts of a single logical
     package as multiple directories.
 
-    It also looks for *.pkg files beginning where * matches the name
-    argument.  This feature is similar to *.pth files (see site.py),
+    It also looks for \*.pkg files beginning where \* matches the name
+    argument.  This feature is similar to \*.pth files (see site.py),
     except that it doesn't special-case lines starting with 'import'.
-    A *.pkg file is trusted at face value: apart from checking for
-    duplicates, all entries found in a *.pkg file are added to the
+    A \*.pkg file is trusted at face value: apart from checking for
+    duplicates, all entries found in a \*.pkg file are added to the
     path, regardless of whether they are exist the filesystem.  (This
     is a feature.)
 
@@ -651,8 +651,10 @@
         ``'/'`` have been replaced by the system separator given by ``os.sep``.
         :parameter local: flag to say if the path should be returned a local
                           absolute path
+
         :type local: boolean
         :returns: iterator of (path, md5, size)
+
         """
         return self._get_records(local)
 
@@ -989,7 +991,8 @@
                 p_name, p_ver = p_components
                 if len(p_ver) < 2 or p_ver[0] != '(' or p_ver[-1] != ')':
                     raise DistutilsError(('Distribution %s has invalid ' +
-                                          'provides field: %s') % (dist.name,p))
+                                          'provides field: %s') \
+                                           % (dist.name, p))
                 p_ver = p_ver[1:-1] # trim off the parenthesis
                 if p_name == name and predicate.match(p_ver):
                     yield dist

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list