Commits

Ryan Macy committed 8911eab

Another round of spacing adjustments and consistent styling. I also fixed a few typos.

  • Participants
  • Parent commits 96f764b

Comments (0)

Files changed (8)

docs/database.rst

 
    Return an instance of :class:`Distribution` or :class:`EggInfoDistribution`
    for the first installed distribution matching *name*.  Egg distributions are
-   considered only if *use_egg_info* is true; if both a dist-info and an egg
+   considered only if *use_egg_info* is true;, if both a dist-info and an egg
    file are found, the dist-info prevails.  The directories to be searched are
-   given in *paths*, which defaults to :data:`sys.path`.  Returns ``None`` if no
+   given in *paths*, which defaults to :data:`sys.path`. Returns ``None`` if no
    matching distribution is found.
 
    .. FIXME param should be named use_egg
 
    Escape *name* and *version* into a filename-safe form and return the
    directory name built from them, for example
-   :file:`{safename}-{safeversion}.dist-info.`  In *name* runs of
+   :file:`{safename}-{safeversion}.dist-info`. In *name* runs of
    non-alphanumeric characters are replaced with one ``'_'``, in *version*
    spaces become dots, and runs of other non-alphanumeric characters (except
    dots) are replaced by one ``'-'``.
         print('* It was installed as a dependency')
 
 If we save the script above as ``print_info.py``, we can use it to extract
-information from a :file:`.dist-info` directory.  By typing in the console:
+information from a :file:`.dist-info` directory. By typing in the console:
 
 .. code-block:: sh
 
 full :class:`Distribution` object but just want to do something with its
 :attr:`~Distribution.metadata`::
 
-    >>> from distlib.database import get_distribution
-    >>> info = get_distribution('chocolate').metadata
-    >>> info['Keywords']
-    ['cooking', 'happiness']
-    >>>
+   >>> from distlib.database import get_distribution
+   >>> info = get_distribution('chocolate').metadata
+   >>> info['Keywords']
+   ['cooking', 'happiness']
+   >>>
 
 Finding out obsoleted distributions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/depgraph.rst

 ======================================================
 
 .. module:: distlib.depgraph
-    :synopsis: Graph builder for dependencies between releases.
+   :synopsis: Graph builder for dependencies between releases.
 
 This module provides the means to analyse the dependencies between various
 distributions and to create a graph representing these dependency relationships.
 
 .. class:: DependencyGraph
 
-   Represent a dependency graph between releases.  The nodes are distribution
-   instances, the edge model dependencies.  An edge from ``a`` to ``b`` means
+   Represent a dependency graph between releases. The nodes are distribution
+   instances, the edge model dependencies. An edge from ``a`` to ``b`` means
    that ``a`` depends on ``b``.
 
    .. method:: add_distribution(distribution)
 
    .. method:: repr_node(dist, level=1)
 
-      Print a subgraph starting from *dist*.  *level* gives the depth of the
+      Print a subgraph starting from *dist*. *level* gives the depth of the
       subgraph.
 
    Direct access to the graph nodes and edges is provided through these
 
    .. attribute:: reverse_list
 
-      Dictionary mapping distributions to a list of predecessors.  This allows
+      Dictionary mapping distributions to a list of predecessors. This allows
       efficient traversal.
 
    .. attribute:: missing
    on *dist*.
 
    .. XXX what does member mean here: "dist is a member of *dists* for which we
-   are interested"
+      are interested"
 
 .. function:: make_graph(dists)
 
 
 .. code-block:: sh
 
-   $ dot -Tpng output.dot > output.png
+   $ dot -T png output.dot > output.png
 
 An example result is:
 
 List all dependent distributions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-We will list all distributions that are dependent on some given distibution.
+We will list all distributions that are dependent on some given distribution.
 This time, egg distributions will be considered as well::
 
     import sys

docs/internals.rst

 To consider how to provide a minimal uniform API to access resources in Python
 packages, we'll assume that the requirements are as follows:
 
-* All resources are regarded as binary. The using application is expected to
+* All resources are regarded as binary. The consuming application is expected to
   know how to convert resources to text, where appropriate.
 * All resources are read-only.
 * It should be possible to access resources either as streams, or as their
   entire data as a byte-string.
 * Resources will have a unique, identifying name which is text. Resources will
-  be hierarchical, and named using filesystem-like paths using '/' as a
+  be hierarchical and named using filesystem-like paths using '/' as a
   separator. The library will be responsible for converting resource names
   to the names of the underlying representations (e.g. encoding of file names
   corresponding to resource names).
-* Some resources are containers of other resoures, some are not. For
+* Some resources are containers of other resources, some are not. For
   example, a resource ``nested/nested_resource.bin`` in a package would not
   contain other resources, but implies the existence of a resource
   ``nested``, which contains ``nested_resource.bin``.
   with a specific directory, and no other package can be associated with that
   directory.
 * Support should be provided for access to data deployed in the file system or
-  in packages contained in .zip files, and third parties should be able to
+  in packages contained in .zip files and third parties should be able to
   extend the facilities to work with other storage formats which support import
   of Python packages.
 * It should be possible to access the contents of any resource through a
   linking using ``dlopen()`` on POSIX, or any APIs which need access to
   resource data via OS-level file handles rather than Python streams).
 
-
 A minimal solution
 ^^^^^^^^^^^^^^^^^^
 
 accesses.
 
 We know that we need to support resource access in the file system as well as
-.zip files, and to support other sources of storage which might be used to
+.zip files and to support other sources of storage which might be used to
 import Python packages. Since import and loading of Python packages happens
 through :pep:`302` importers and loaders, we can deduce that the mechanism used
 to find resources in a package will be closely tied to the loader for that
     r2 = find_resource(pkg, 'bar')
 
 However, we'll often have situations where we will want to get multiple
-resources from a package, and in certain applications we might want to
+resources from a package and in certain applications we might want to
 implement caching or other processing of resources before returning them.
 The above API doesn't facilitate this, so let's consider delegating the finding
 of resources in a package to a *finder* for that package. Once we get a finder,
 object for a package and returns a finder.
 
 Let's consider in more detail what finders look like and how they interact with
-the ``Resource`` class. We'll keep the Resource class minimal; API users never
+the ``Resource`` class. We'll keep the Resource class minimal, API users never
 instantiate ``Resource`` directly, but call a finder's ``find`` method to
 return a ``Resource`` instance. A finder could return an instance of a
 ``Resource`` subclass if really needed, though it shouldn't be necessary in
             (relative) resource names
             """
 
-
 Dealing with the requirement for access via file system files
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 * A constructor which takes an optional base directory for the cache. If
   none is provided, we'll construct a base directory of the form::
 
-  <rootdir>/.distlib/resource-cache
+     <rootdir>/.distlib/resource-cache
 
   where ``<rootdir>`` is the user's home directory. On Windows, if the
   environment specifies a variable named ``LOCALAPPDATA``, its value
-  will be used as ``<rootdir>``; otherwise, the user's home directory
+  will be used as ``<rootdir>``, otherwise, the user's home directory
   will be used.
 
 * A :meth:`get` method which takes a ``Resource`` and returns a file system
   and returns a (``prefix``, ``subpath``) tuple.
 
   The default implementation will use :func:`os.splitdrive` to see if there's
-  a Windows drive, and convert its ``':'`` to ``'---'``. The rest of the
+  a Windows drive and convert its ``':'`` to ``'---'``. The rest of the
   prefix will be converted by replacing ``'/'`` by ``'--'``, and appending
   ``'.cache'`` to the result.
 
 is accessed. This will be a cached property, and will call the cache's
 :meth:`get` method to obtain the file system path.
 
-
 The ``scripts`` API
 -------------------
 
 * On Windows systems, which don't support shebang lines natively, some
   alternate means of finding the correct interpreter need to be provided.
   Following the acceptance and implementation of PEP 397, a shebang-
-  interpreting launcher will be available in Python 3.3 and later, and a
+  interpreting launcher will be available in Python 3.3 and later and a
   standalone version of it for use with earlier Python versions is also
   available. However, where this can't be used, an alternative approach
   using executable launchers installed with the scripts may be necessary.
   (That is the approach taken by ``setuptools``.)
-
   Windows also has two types of launchers - console applications and
   Windows applications. The appropriate launcher needs to be used for
   scripts.
 
 * A :meth:`~ScriptMaker.make_multiple` method, which takes an iterable of
   specifications and just runs calls :meth:`~ScriptMaker.make` on each
-  item iterated over, aggregatig the results to return a list of absolute paths
+  item iterated over, aggregating the results to return a list of absolute paths
   of all files that were installed (or would have been installed, but for the
   dry-run mode being in effect).
 
   analysis tool, over all the installed files.
 
 * The details of the callable specification can be encapsulated in a utility
-  function, :func:`~distlib.util.get_exports_entry`. This would take a specification
-  and return ``None``, if the specification didn't match the callable format,
-  or an instance of :class:`ExportEntry` if it did match.
+  function, :func:`~distlib.util.get_exports_entry`. This would take a
+  specification and return ``None``, if the specification didn't match the
+  callable format, or an instance of :class:`ExportEntry` if it did match.
 
 In addition, the following attributes on a ``ScriptMaker`` could be further used
 to refine its behaviour:
 value (with no intervening spaces). Multiple flags can be separated by ','
 and whitespace. The following would be valid flag sections::
 
-  [a,b,c]
-  [a, b, c]
-  [a=b, c=d, e, f=g, 9=8]
+   [a,b,c]
+   [a, b, c]
+   [a=b, c=d, e, f=g, 9=8]
 
 whereas the following would be invalid::
 
- []
- [\]
- [a,]
- [a,,b]
- [a=,b,c]
-
+  []
+  [\]
+  [a,]
+  [a,,b]
+  [a=,b,c]
 
 The ``version`` API
 -------------------
 The problem we're trying to solve
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Distribution releases are named by versions, and versions have two principal
+Distribution releases are named by versions and versions have two principal
 uses:
 
-* Identifying a particular release, and determining whether or not it is
+* Identifying a particular release and determining whether or not it is
   earlier or later than some other release.
 
 * When specifying other distributions that a distribution release depends on,
 but due to their ubiquity in projects registered on PyPI. Below are some
 results from testing actual projects on PyPI::
 
-    Packages processed: 24891
-    Packages with no versions: 217
-    Packages with versions: 24674
-    Number of packages clean for all schemes: 19010 (77%)
-    Number of packages clean for PEP 386: 21072 (85%)
-    Number of packages clean for PEP 386 + suggestion: 23685 (96%)
-    Number of packages clean for legacy: 24674 (100%, by you would expect)
-    Number of packages clean for semantic: 19278 (78%)
+   Packages processed: 24891
+   Packages with no versions: 217
+   Packages with versions: 24674
+   Number of packages clean for all schemes: 19010 (77%)
+   Number of packages clean for PEP 386: 21072 (85%)
+   Number of packages clean for PEP 386 + suggestion: 23685 (96%)
+   Number of packages clean for legacy: 24674 (100%, by you would expect)
+   Number of packages clean for semantic: 19278 (78%)
 
 where "+ suggestion" refers to using the suggested version algorithm to derive
 a version from a version which would otherwise be incompatible with :pep:`386`.
 
-
 A minimal solution
 ^^^^^^^^^^^^^^^^^^
 
 Of course, the version class is also available through the matcher's
 ``version_class`` attribute.
 
-:class:`VersionScheme` make it easier to work with alternative version schemes.
+:class:`VersionScheme` makes it easier to work with alternative version schemes.
 For example, say we decide to experiment with an "adaptive" version scheme,
 which is based on the PEP 386 scheme, but when handed a non-conforming version,
 automatically tries to convert it to a normalized version using
 If an unrecognised name is passed in, a ``ValueError`` is raised.
 
 The reimplemented ``distlib.version`` module is shorter than the corresponding
-module in ``distutils2``, but the entire test suite passes, and there is support
+module in ``distutils2``, but the entire test suite passes and there is support
 for working with three versioning schemes as opposed to just one. However, the
 concept of "final" versions, which is not in the PEP but which was in the
 ``distutils2`` implementation, has been removed because it appears of little
 value (there's no way to determine the "final" status of versions for many of
 the project releases registered on PyPI).
 
-
 Next steps
 ----------
 

docs/metadata.rst

 The :class:`Metadata` class can be instantiated with the path of the
 metadata file and provides a dict-like interface to the values::
 
-    >>> from distlib.metadata import Metadata
-    >>> metadata = Metadata('PKG-INFO')
-    >>> metadata.keys()[:5]
-    ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform')
-    >>> metadata['Name']
-    'CLVault'
-    >>> metadata['Version']
-    '0.5'
-    >>> metadata['Requires-Dist']
-    ["pywin32; sys.platform == 'win32'", "Sphinx"]
-    >>>
+   >>> from distlib.metadata import Metadata
+   >>> metadata = Metadata('PKG-INFO')
+   >>> metadata.keys()[:5]
+   ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform')
+   >>> metadata['Name']
+   'CLVault'
+   >>> metadata['Version']
+   '0.5'
+   >>> metadata['Requires-Dist']
+   ["pywin32; sys.platform == 'win32'", "Sphinx"]
+   >>>
 
 The fields that support environment markers can be automatically ignored if
 the object is instantiated using the ``platform_dependent`` option.
 remove the fields that are not compliant with the running environment. Here's an
 example under Mac OS X. The win32 dependency we saw earlier is ignored::
 
-    >>> from distlib.metadata import Metadata
-    >>> metadata = Metadata('PKG-INFO', platform_dependent=True)
-    >>> metadata['Requires-Dist']
-    ['Sphinx']
-    >>>
+   >>> from distlib.metadata import Metadata
+   >>> metadata = Metadata('PKG-INFO', platform_dependent=True)
+   >>> metadata['Requires-Dist']
+   ['Sphinx']
+   >>>
 
 If you want to provide your own execution context, let's say to test the
 metadata under a particular environment that is not the current environment,
 
 Here's an example, simulating a win32 environment::
 
-    >>> from distlib.metadata import Metadata
-    >>> context = {'sys.platform': 'win32'}
-    >>> metadata = Metadata('PKG-INFO', platform_dependent=True,
-    ...                     execution_context=context)
-    ...
-    >>> metadata['Requires-Dist'] = ["pywin32; sys.platform == 'win32'",
-    ...                              "Sphinx"]
-    ...
-    >>> metadata['Requires-Dist']
-    ['pywin32', 'Sphinx']
-    >>>
+   >>> from distlib.metadata import Metadata
+   >>> context = {'sys.platform': 'win32'}
+   >>> metadata = Metadata('PKG-INFO', platform_dependent=True,
+   ...                     execution_context=context)
+   ...
+   >>> metadata['Requires-Dist'] = ["pywin32; sys.platform == 'win32'",
+   ...                              "Sphinx"]
+   ...
+   >>> metadata['Requires-Dist']
+   ['pywin32', 'Sphinx']
+   >>>
 
 Writing metadata
 ----------------
 
 Writing metadata can be done using the ``write`` method::
 
-    >>> metadata.write('/to/my/PKG-INFO')
-    >>>
+   >>> metadata.write('/to/my/PKG-INFO')
+   >>>
 
 The class will pick the best version for the metadata, depending on the values
 provided. If all the values provided exist in all versions, the class will
 Some fields in :PEP:`345` have to comply with the version number specification
 defined in :PEP:`386`.  When they don't comply, a warning is emitted::
 
-    >>> from distlib.metadata import Metadata
-    >>> metadata = Metadata()
-    >>> metadata['Requires-Dist'] = ['Funky (Groovie)']
-    "Funky (Groovie)" is not a valid predicate
-    >>> metadata['Requires-Dist'] = ['Funky (1.2)']
-    >>>
+   >>> from distlib.metadata import Metadata
+   >>> metadata = Metadata()
+   >>> metadata['Requires-Dist'] = ['Funky (Groovie)']
+   "Funky (Groovie)" is not a valid predicate
+   >>> metadata['Requires-Dist'] = ['Funky (1.2)']
+   >>>
 
 See also :mod:`distlib.version`.
 
    Interpret a marker and return a boolean result depending on the environment.
    Example::
 
-    >>> interpret("python_version > '1.0'")
-    True
-    >>>
+      >>> interpret("python_version > '1.0'")
+      True
+      >>>
 

docs/migration.rst

 ~~~~~~~~~~~~~~~~~~~~~
 
 ``resource_exists(package, resource_name)``
-    ``finder(package).find(resource_name) is not None``
+   ``finder(package).find(resource_name) is not None``
 
 ``resource_stream(package, resource_name)``
-    ``finder(package).find(resource_name).as_stream()``
+   ``finder(package).find(resource_name).as_stream()``
 
 ``resource_string(package, resource_name)``
-    ``finder(package).find(resource_name).bytes``
+   ``finder(package).find(resource_name).bytes``
 
 ``resource_isdir(package, resource_name)``
-    ``finder(package).find(resource_name).is_container``
+   ``finder(package).find(resource_name).is_container``
 
 ``resource_listdir(package, resource_name)``
-    ``finder(package).find(resource_name).resources``
+   ``finder(package).find(resource_name).resources``
 
 Resource extraction
 ~~~~~~~~~~~~~~~~~~~
 
 ``resource_filename(package, resource_name)``
-    ``finder(package).find(resource_name).file_path``
+   ``finder(package).find(resource_name).file_path``
 
 ``set_extraction_path(extraction_path)``
-    This has no direct analogue, but you can achieve equivalent results by
-    doing something like the following::
+   This has no direct analogue, but you can achieve equivalent results by
+   doing something like the following::
 
-        from distlib import resources
+    from distlib import resources
 
-        resources.cache = resources.Cache(extraction_path)
+    resources.cache = resources.Cache(extraction_path)
 
-    before accessing the ``file_path`` property of any :class:`Resource`.
-    Note that if you have accessed the ``file_path`` property for a resource
-    *before* doing this, the cache may already have extracted files.
+   before accessing the ``file_path`` property of any :class:`Resource`.
+   Note that if you have accessed the ``file_path`` property for a resource
+   *before* doing this, the cache may already have extracted files.
 
 ``cleanup_resources(force=False)``
-    This is not actually implemented in ``pkg_resources`` -- it's a no-op.
-    You could achieve the analogous result using::
+   This is not actually implemented in ``pkg_resources`` -- it's a no-op.
+   You could achieve the analogous result using::
 
-        from distlib import resources
+    from distlib import resources
 
-        not_removed = resources.cache.clear()
+    not_removed = resources.cache.clear()
 
 Provider interface
 ~~~~~~~~~~~~~~~~~~
 finders, to deal with custom requirements which aren't catered for.
 
 ``get_cache_path(archive_name, names=())``
-    There's no analogue for this, as you shouldn't need to care about whether
-    particular resources are implemented in archives or not. If you need this
-    API, please give feedback with more information about your use cases.
+   There's no analogue for this, as you shouldn't need to care about whether
+   particular resources are implemented in archives or not. If you need this
+   API, please give feedback with more information about your use cases.
 
 ``extraction_error()``
-    There's no analogue for this. The :meth:`Cache.get` method, which writes
-    a resource's bytes to a file in the cache, will raise any exception caused
-    by underlying I/O. If you need to handle this in the cache layer, you can
-    subclass :class:`Cache` and override :meth:`get`. If that doesn't work for
-    you, please give feedback with more information about your use cases.
+   There's no analogue for this. The :meth:`Cache.get` method, which writes
+   a resource's bytes to a file in the cache, will raise any exception caused
+   by underlying I/O. If you need to handle this in the cache layer, you can
+   subclass :class:`Cache` and override :meth:`get`. If that doesn't work for
+   you, please give feedback with more information about your use cases.
 
 ``postprocess(tempname, filename)``
-    There's no analogue for this. The :meth:`Cache.get` method, which writes
-    a resource's bytes to a file in the cache, can be overridden to perform any
-    custom post-processing. If that doesn't work for you, please give feedback
-    with more information about your use cases.
+   There's no analogue for this. The :meth:`Cache.get` method, which writes
+   a resource's bytes to a file in the cache, can be overridden to perform any
+   custom post-processing. If that doesn't work for you, please give feedback
+   with more information about your use cases.
 
 The ``pkg_resources`` entry point API
 -------------------------------------
 
 In ``distlib``, the implementation of exports is slightly different from
 entry points of ``pkg_resources``. A :class:`Distribution` instance has an
- ``exports`` attribute, which is a dictionary keyed by category and whose values
+``exports`` attribute, which is a dictionary keyed by category and whose values
 are dictionaries that map names to :class:`ExportEntry` instances.
 
 Below are the ``pkg_resources`` functions and how to achieve the equivalent

docs/reference.rst

 
    This class represents a set of distributions which are installed on a Python
    path (like ``PYTHONPATH`` / ``sys.path``). Both new-style (``distlib``) and
-   legacy (egg) distibutions are catered for.
+   legacy (egg) distributions are catered for.
 
    Methods:
 
 
       Looks for a distribution by name. It returns the first one found with
       that name (there should only be one distribution with a given name on a
-      given search path). Returns ``None`` if no distrubution was found, or
+      given search path). Returns ``None`` if no distribution was found, or
       else an instance of :class:`Distribution` (or, if ``include_egg`` was
       specified as ``True`` for the instance, an instance of
       :class:`EggInfoDistribution` if a legacy distribution was found with that
       :returns: An iterator which iterates over exported entries (instances of
                 :class:`ExportEntry`).
 
-
 .. class:: Distribution
 
    A class representing a distribution, typically one which hasn't been
       The locator for an instance which has been retrieved through a locator.
       This is ``None`` for an installed distribution.
 
-
 .. class:: InstalledDistribution(Distribution)
 
    A class representing an installed distribution. This class is not
       unchanged from the values in the ``RECORD`` file, written when the
       distribution was installed. It returns a list of mismatches. If the files
       in the distribution haven't been corrupted , an empty list will be
-      returned; otherwise, a list of mismatches will be returned.
+      returned, otherwise, a list of mismatches will be returned.
 
       :returns: A list which, if non-empty, will contain tuples with the
                 following elements:
                        default location.
       :type filename: str
 
-
 .. class:: EggInfoDistribution
 
    Analogous to :class:`Distribution`, but covering legacy distributions. This
                     (i.e. with platform-specific directory separators as
                     indicated by ``os.sep``).
 
-
-
 The :class:`DependencyGraph` class
 ----------------------------------
 
 .. class:: DependencyGraph
 
-   This class represents a dependency graph between releases.  The nodes are
-   distribution instances; the edge model dependencies.  An edge from ``a``
+   This class represents a dependency graph between releases. The nodes are
+   distribution instances; the edge model dependencies. An edge from ``a``
    to ``b`` means that ``a`` depends on ``b``.
 
    .. method:: add_distribution(distribution)
 
    .. attribute:: reverse_list
 
-      Dictionary mapping distributions to a list of predecessors.  This allows
+      Dictionary mapping distributions to a list of predecessors. This allows
       efficient traversal.
 
    .. attribute:: missing
       Dictionary mapping distributions to a list of requirements that were not
       provided by any distribution.
 
-
 The ``distlib.resources`` package
 ---------------------------------
 
 .. attribute:: cache
 
    An instance of :class:`Cache`, which uses the default base location for the
-   cache (as descibed in the documentation for :meth:`Cache.__init__`).
+   cache (as described in the documentation for :meth:`Cache.__init__`).
 
 Functions
 ^^^^^^^^^
       .zip) into a directory name in the cache. This implementation
       delegates the work to :func:`~distlib.util.path_to_cache_dir`.
 
-
 The ``distlib.scripts`` package
 -------------------------------
 
 
 .. currentmodule:: distlib.locators
 
-
 Classes
 ^^^^^^^^
 
 
        See :meth:`Locator.get_project`.
 
-
 .. class:: PyPIJSONLocator(Locator)
 
    This locator uses the PyPI JSON interface to locate distribution
 
        See :meth:`Locator.get_project`.
 
-
 .. class:: SimpleScrapingLocator
 
    This locator uses the PyPI 'simple' interface -- a Web scraping interface --
       :type num_workers: int
       :param  kwargs: Passed to base class constructor.
 
-
 .. class:: DistPathLocator
 
    This locator uses a :class:`DistributionPath` instance to locate installed
       :type distpath: :class:`DistributionPath`
       :param  kwargs: Passed to base class constructor.
 
-
 .. class:: AggregatingLocator(Locator)
 
    This locator uses a list of other aggregators and delegates finding projects
                     passed in.
       :type merge: bool
 
-
 .. class:: DependencyFinder
 
    This class allows you to recursively find all the distributions which a
              Note that some of the names may be Unicode.
    :rtype: list
 
-
 .. function:: locate(requirement)
 
    This convenience function returns the latest version of a potentially
    downloadable distribution which matches a requirement (name and version
    constraints). If a potentially downloadable distribution (i.e. one with
-   a download URL) is not found, ``None`` is returned; otherwise, an
+   a download URL) is not found, ``None`` is returned, otherwise, an
    instance of :class:`~distlib.database.Distribution` is returned. The
    returned instance will have, at a minimum, ``name``, ``version`` and
    ``download_url``.
    This attribute holds a locator which is used by :func:`locate` to locate
    distributions.
 
-
 The ``distlib.util`` package
 -------------------------------
 
 .. currentmodule:: distlib.util
 
-
 Classes
 ^^^^^^^^
 
                        ``'path.supports_unicode_filenames'``.
    :type dotted_path: str
 
-
-
 Next steps
 ----------
 

docs/tutorial.rst

 
 Distlib is a pure-Python library. You should be able to install it using::
 
-    pip install distlib
+   pip install distlib
 
 for installing ``distlib`` into a virtualenv or other directory where you have
 write permissions. On Posix platforms, you may need to invoke using ``sudo``
 :class:`DistributionPath` for distributions. To create a ``DistributionPath``
 instance, you can do ::
 
-    >>> from distlib.database import DistributionPath
-    >>> dist_path = DistributionPath()
-    >>>
+   >>> from distlib.database import DistributionPath
+   >>> dist_path = DistributionPath()
+   >>>
 
 Querying a path for distributions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 distributions on ``sys.path``. To get these distributions, you invoke the
 :meth:`get_distributions` method, which returns an iterable. Let's try it::
 
-    >>> list(dist_path.get_distributions())
-    []
-    >>>
+   >>> list(dist_path.get_distributions())
+   []
+   >>>
 
 This may seem surprising if you've just started looking at ``distlib``,
 as you won't *have* any non-legacy distributions.
 ``distribute``, you need to create the ``DistributionPath`` by specifying an
 additional keyword argument, like so::
 
-    >>> dist_path = DistributionPath(include_egg=True)
-    >>>
+   >>> dist_path = DistributionPath(include_egg=True)
+   >>>
 
 and then you'll get a less surprising result::
 
-    >>> len(list(dist_path.get_distributions()))
-    77
-    >>>
+   >>> len(list(dist_path.get_distributions()))
+   77
+   >>>
 
 The exact number returned will be different for you, of course. You can ask
 for a particular distribution by name, using the :meth:`get_distribution`
 method::
 
-    >>> dist_path.get_distribution('setuptools')
-    <EggInfoDistribution u'setuptools' 0.6c11 at '/usr/lib/python2.7/dist-packages/setuptools.egg-info'>
-    >>>
+   >>> dist_path.get_distribution('setuptools')
+   <EggInfoDistribution u'setuptools' 0.6c11 at '/usr/lib/python2.7/dist-packages/setuptools.egg-info'>
+   >>>
 
 If you want to look at a specific path other than ``sys.path``, you specify it
 as a positional argument to the :class:`DistributionPath` constructor::
 
-    >>> from pprint import pprint
-    >>> special_dists = DistributionPath(['tests/fake_dists'], include_egg=True)
-    >>> pprint([d.name for d in special_dists.get_distributions()])
-    ['babar',
-     'choxie',
-     'towel-stuff',
-     'grammar',
-     'truffles',
-     'coconuts-aster',
-     'nut',
-     'bacon',
-     'banana',
-     'cheese',
-     'strawberry']
-    >>>
+   >>> from pprint import pprint
+   >>> special_dists = DistributionPath(['tests/fake_dists'], include_egg=True)
+   >>> pprint([d.name for d in special_dists.get_distributions()])
+   ['babar',
+    'choxie',
+    'towel-stuff',
+    'grammar',
+    'truffles',
+    'coconuts-aster',
+    'nut',
+    'bacon',
+    'banana',
+    'cheese',
+    'strawberry']
+   >>>
 
 or, if you leave out egg-based distributions::
 
-    >>> special_dists = DistributionPath(['tests/fake_dists'])
-    >>> pprint([d.name for d in special_dists.get_distributions()])
-    ['babar',
+   >>> special_dists = DistributionPath(['tests/fake_dists'])
+   >>> pprint([d.name for d in special_dists.get_distributions()])
+   ['babar',
     'choxie',
     'towel-stuff',
     'grammar']
-    >>>
+   >>>
 
 Distribution properties
 ~~~~~~~~~~~~~~~~~~~~~~~
 packages, whether in the file system or .zip files. Consider a package
 which contains data alongside Python code::
 
-    foofoo
-    ├── bar
-    │   ├── bar_resource.bin
-    │   ├── baz.py
-    │   └── __init__.py
-    ├── foo_resource.bin
-    ├── __init__.py
-    └── nested
-        └── nested_resource.bin
+   foofoo
+   ├── bar
+   │   ├── bar_resource.bin
+   │   ├── baz.py
+   │   └── __init__.py
+   ├── foo_resource.bin
+   ├── __init__.py
+   └── nested
+       └── nested_resource.bin
 
 Access to resources in the file system
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 You can access these resources like so::
 
-    >>> from distlib.resources import finder
-    >>> f = finder('foofoo')
-    >>> r = f.find('foo_resource.bin')
-    >>> r.is_container
-    False
-    >>> r.size
-    10
-    >>> r.bytes
-    b'more_data\n'
-    >>> s = r.as_stream()
-    >>> s.read()
-    b'more_data\n'
-    >>> s.close()
-    >>> r = f.find('nested')
-    >>> r.is_container
-    True
-    >>> r.resources
-    {'nested_resource.bin'}
-    >>> r = f.find('nested/nested_resource.bin')
-    >>> r.size
-    12
-    >>> r.bytes
-    b'nested data\n'
-    >>> f = finder('foofoo.bar')
-    >>> r = f.find('bar_resource.bin')
-    >>> r.is_container
-    False
-    >>> r.bytes
-    b'data\n'
-    >>>
+   >>> from distlib.resources import finder
+   >>> f = finder('foofoo')
+   >>> r = f.find('foo_resource.bin')
+   >>> r.is_container
+   False
+   >>> r.size
+   10
+   >>> r.bytes
+   b'more_data\n'
+   >>> s = r.as_stream()
+   >>> s.read()
+   b'more_data\n'
+   >>> s.close()
+   >>> r = f.find('nested')
+   >>> r.is_container
+   True
+   >>> r.resources
+   {'nested_resource.bin'}
+   >>> r = f.find('nested/nested_resource.bin')
+   >>> r.size
+   12
+   >>> r.bytes
+   b'nested data\n'
+   >>> f = finder('foofoo.bar')
+   >>> r = f.find('bar_resource.bin')
+   >>> r.is_container
+   False
+   >>> r.bytes
+   b'data\n'
+   >>>
 
 Access to resources in the ``.zip`` files
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 It works the same way if the package is in a .zip file. Given the zip file
 ``foo.zip``::
 
-    $ unzip -l foo.zip
-    Archive:  foo.zip
-      Length      Date    Time    Name
-    ---------  ---------- -----   ----
-           10  2012-09-20 21:34   foo/foo_resource.bin
-            8  2012-09-20 21:42   foo/__init__.py
-           14  2012-09-20 21:42   foo/bar/baz.py
-            8  2012-09-20 21:42   foo/bar/__init__.py
-            5  2012-09-20 21:33   foo/bar/bar_resource.bin
-    ---------                     -------
-           45                     5 files
+   $ unzip -l foo.zip
+   Archive:  foo.zip
+     Length      Date    Time    Name
+   ---------  ---------- -----   ----
+          10  2012-09-20 21:34   foo/foo_resource.bin
+           8  2012-09-20 21:42   foo/__init__.py
+          14  2012-09-20 21:42   foo/bar/baz.py
+           8  2012-09-20 21:42   foo/bar/__init__.py
+           5  2012-09-20 21:33   foo/bar/bar_resource.bin
+   ---------                     -------
+          45                     5 files
 
 You can access its resources as follows::
 
-    >>> import sys
-    >>> sys.path.append('foo.zip')
-    >>> from distlib.resources import finder
-    >>> f = finder('foo')
-    >>> r = f.find('foo_resource.bin')
-    >>> r.is_container
-    False
-    >>> r.size
-    10
-    >>> r.bytes
-    'more_data\n'
-    >>>
+   >>> import sys
+   >>> sys.path.append('foo.zip')
+   >>> from distlib.resources import finder
+   >>> f = finder('foo')
+   >>> r = f.find('foo_resource.bin')
+   >>> r.is_container
+   False
+   >>> r.size
+   10
+   >>> r.bytes
+   'more_data\n'
+   >>>
 
 and so on.
 
    To install scripts, create a :class:`ScriptMaker` instance,
    giving it the source and target directories for scripts::
 
-    >>> from distlib.scripts import ScriptMaker
-    >>> maker = ScriptMaker(source_dir, target_dir)
-    >>>
+      >>> from distlib.scripts import ScriptMaker
+      >>> maker = ScriptMaker(source_dir, target_dir)
+      >>>
 
    You can then install a script ``foo.py`` like this::
 
-    >>> maker.make('foo.py')
-    >>>
+      >>> maker.make('foo.py')
+      >>>
 
    The string passed to make can take one of the following forms:
 
    Let's see how wrapping a callable works. Consider the following file::
 
     $ cat scripts/foo.py
-    def main():
+      def main():
         print('Hello from foo')
 
     def other_main():
 
    we can try wrapping ``main`` and ``other_main`` as callables::
 
-    >>> from distlib.scripts import ScriptMaker
-    >>> maker = ScriptMaker('scripts', '/tmp/scratch')
-    >>> maker.make_multiple(('foo = foo:main', 'bar = foo:other_main'))
-    ['/tmp/scratch/foo', '/tmp/scratch/bar']
-    >>>
+      >>> from distlib.scripts import ScriptMaker
+      >>> maker = ScriptMaker('scripts', '/tmp/scratch')
+      >>> maker.make_multiple(('foo = foo:main', 'bar = foo:other_main'))
+      ['/tmp/scratch/foo', '/tmp/scratch/bar']
+      >>>
 
    we can inspect the resulting scripts. First, ``foo``::
 
    The :class:`NormalizedVersion` class implements a :pep:`386` compatible
    version::
 
-    >>> from distlib.version import NormalizedVersion
-    >>> v1 = NormalizedVersion('1.0')
-    >>> v2 = NormalizedVersion('1.0a1')
-    >>> v3 = NormalizedVersion('1.0b1')
-    >>> v4 = NormalizedVersion('1.0c1')
-    >>> v5 = NormalizedVersion('1.0.post1')
-    >>>
+      >>> from distlib.version import NormalizedVersion
+      >>> v1 = NormalizedVersion('1.0')
+      >>> v2 = NormalizedVersion('1.0a1')
+      >>> v3 = NormalizedVersion('1.0b1')
+      >>> v4 = NormalizedVersion('1.0c1')
+      >>> v5 = NormalizedVersion('1.0.post1')
+      >>>
 
    These sort in the expected order::
 
-    >>> v2 < v3 < v4 < v1 < v5
-    True
-    >>>
+      >>> v2 < v3 < v4 < v1 < v5
+      True
+      >>>
 
    You can't pass any old thing as a version number::
 
-    >>> NormalizedVersion('foo')
-    Traceback (most recent call last):
-    File "<stdin>", line 1, in <module>
-    File "distlib/version.py", line 49, in __init__
-      self._parts = parts = self.parse(s)
-    File "distlib/version.py", line 254, in parse
-      def parse(self, s): return normalized_key(s)
-    File "distlib/version.py", line 199, in normalized_key
-      raise UnsupportedVersionError(s)
-    distlib.version.UnsupportedVersionError: foo
-    >>>
+      >>> NormalizedVersion('foo')
+      Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+      File "distlib/version.py", line 49, in __init__
+       self._parts = parts = self.parse(s)
+      File "distlib/version.py", line 254, in parse
+       def parse(self, s): return normalized_key(s)
+      File "distlib/version.py", line 199, in normalized_key
+       raise UnsupportedVersionError(s)
+      distlib.version.UnsupportedVersionError: foo
+      >>>
 
    Matching versions against constraints
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The :class:`NormalizedMatcher` is used to match version constraints against
    versions::
 
-    >>> from distlib.version import NormalizedMatcher
-    >>> m = NormalizedMatcher('foo (1.0b1)')
-    >>> m
-    NormalizedMatcher('foo (1.0b1)')
-    >>> [m.match(v) for v in v1, v2, v3, v4, v5]
-    [False, False, True, False, False]
-    >>>
+      >>> from distlib.version import NormalizedMatcher
+      >>> m = NormalizedMatcher('foo (1.0b1)')
+      >>> m
+      NormalizedMatcher('foo (1.0b1)')
+      >>> [m.match(v) for v in v1, v2, v3, v4, v5]
+      [False, False, True, False, False]
+      >>>
 
    Specifying ``'foo (1.0b1)'`` is equivalent to specifying ``'foo (==1.0b1)'``,
    i.e. only the exact version is matched. You can also specify inequality
    constraints::
 
-    >>> m = NormalizedMatcher('foo (<1.0c1)')
-    >>> [m.match(v) for v in v1, v2, v3, v4, v5]
-    [False, True, True, False, False]
-    >>>
+      >>> m = NormalizedMatcher('foo (<1.0c1)')
+      >>> [m.match(v) for v in v1, v2, v3, v4, v5]
+      [False, True, True, False, False]
+      >>>
 
    and multiple constraints::
 
-    >>> m = NormalizedMatcher('foo (>= 1.0b1, <1.0.post1)')
-    >>> [m.match(v) for v in v1, v2, v3, v4, v5]
-    [True, False, True, True, False]
-    >>>
+      >>> m = NormalizedMatcher('foo (>= 1.0b1, <1.0.post1)')
+      >>> [m.match(v) for v in v1, v2, v3, v4, v5]
+      [True, False, True, True, False]
+      >>>
 
    You can do exactly the same thing as above with ``setuptools``/
    ``distribute`` version numbering (use ``LegacyVersion`` and ``LegacyMatcher``)
    or with semantic versioning (use ``SemanticVersion`` and ``SemanticMatcher``).
    However, you can't mix and match versions of different types::
 
-    >>> from distlib.version import SemanticVersion, LegacyVersion
-    >>> nv = NormalizedVersion('1.0.0')
-    >>> lv = LegacyVersion('1.0.0')
-    >>> sv = SemanticVersion('1.0.0')
-    >>> lv == sv
-    Traceback (most recent call last):
-    File "<stdin>", line 1, in <module>
-    File "distlib/version.py", line 61, in __eq__
-      self._check_compatible(other)
-    File "distlib/version.py", line 58, in _check_compatible
+      >>> from distlib.version import SemanticVersion, LegacyVersion
+      >>> nv = NormalizedVersion('1.0.0')
+      >>> lv = LegacyVersion('1.0.0')
+      >>> sv = SemanticVersion('1.0.0')
+      >>> lv == sv
+      Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+      File "distlib/version.py", line 61, in __eq__
+       self._check_compatible(other)
+      File "distlib/version.py", line 58, in _check_compatible
       raise TypeError('cannot compare %r and %r' % (self, other))
-    TypeError: cannot compare LegacyVersion('1.0.0') and SemanticVersion('1.0.0')
-    >>> nv == sv
-    Traceback (most recent call last):
-    File "<stdin>", line 1, in <module>
-    File "distlib/version.py", line 61, in __eq__
-      self._check_compatible(other)
-    File "distlib/version.py", line 58, in _check_compatible
+      TypeError: cannot compare LegacyVersion('1.0.0') and SemanticVersion('1.0.0')
+      >>> nv == sv
+      Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+      File "distlib/version.py", line 61, in __eq__
+       self._check_compatible(other)
+      File "distlib/version.py", line 58, in _check_compatible
       raise TypeError('cannot compare %r and %r' % (self, other))
-    TypeError: cannot compare NormalizedVersion('1.0.0') and SemanticVersion('1.0.0')
-    >>>
+      TypeError: cannot compare NormalizedVersion('1.0.0') and SemanticVersion('1.0.0')
+      >>>
 
 Using the locators API
 ^^^^^^^^^^^^^^^^^^^^^^
    any distributions it requires, so that they can be located if desired.
    Here is a basic example::
 
-    >>> from distlib.locators import locate
-    >>> flask = locate('flask')
-    >>> flask
-    <Distribution Flask (0.9) [http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz]>
-    >>> dependencies = [locate(r) for r in flask.get_requirements('install')]
-    >>> from pprint import pprint
-    >>> pprint(dependencies)
-    [<Distribution Werkzeug (0.8.3) [http://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.8.3.tar.gz]>,
-    <Distribution Jinja2 (2.6) [http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz]>]
-    >>>
+      >>> from distlib.locators import locate
+      >>> flask = locate('flask')
+      >>> flask
+      <Distribution Flask (0.9) [http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz]>
+      >>> dependencies = [locate(r) for r in flask.get_requirements('install')]
+      >>> from pprint import pprint
+      >>> pprint(dependencies)
+      [<Distribution Werkzeug (0.8.3) [http://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.8.3.tar.gz]>,
+      <Distribution Jinja2 (2.6) [http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz]>]
+      >>>
 
    The values returned by :meth:`get_requirements` are just strings. Here's another
    example, showing a little more detail::
 
-    >>> authy = locate('authy')
-    >>> authy.get_requirements('install')
-    [u'httplib2 (>= 0.7, < 0.8)', u'simplejson']
-    >>> authy
-    <Distribution authy (0.0.4) [http://pypi.python.org/packages/source/a/authy/authy-0.0.4.tar.gz]>
-    >>> deps = [locate(r) for r in authy.get_requirements('install')]
-    >>> pprint(deps)
-    [<Distribution httplib2 (0.7.6) [http://pypi.python.org/packages/source/h/httplib2/httplib2-0.7.6.tar.gz]>,
-    <Distribution simplejson (2.6.2) [http://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz]>]
-    >>>
+      >>> authy = locate('authy')
+      >>> authy.get_requirements('install')
+      [u'httplib2 (>= 0.7, < 0.8)', u'simplejson']
+      >>> authy
+      <Distribution authy (0.0.4) [http://pypi.python.org/packages/source/a/authy/authy-0.0.4.tar.gz]>
+      >>> deps = [locate(r) for r in authy.get_requirements('install')]
+      >>> pprint(deps)
+      [<Distribution httplib2 (0.7.6) [http://pypi.python.org/packages/source/h/httplib2/httplib2-0.7.6.tar.gz]>,
+      <Distribution simplejson (2.6.2) [http://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz]>]
+      >>>
 
    Note that the constraints on the dependencies were honoured by :func:`locate`.
 
 
    An example of usage of locator instances is given below::
 
-    >>> from distlib.locators import SimpleScrapingLocator
-    >>> from pprint import pprint
-    >>> locator = SimpleScrapingLocator('http://pypi.python.org/simple/')
-    >>> result = locator.get_project('python-gnupg')
-    >>> pprint(result)
-    {u'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
-     u'0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
-     u'0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
-     u'0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
-     u'0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
-     >>>
+      >>> from distlib.locators import SimpleScrapingLocator
+      >>> from pprint import pprint
+      >>> locator = SimpleScrapingLocator('http://pypi.python.org/simple/')
+      >>> result = locator.get_project('python-gnupg')
+      >>> pprint(result)
+      {u'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
+       u'0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
+       u'0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
+       u'0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
+       u'0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
+      >>>
 
    Now the same project, using the XML-RPC API::
 
-    >>> from distlib.locators import PyPIRPCLocator
-    >>> locator = PyPIRPCLocator('http://python.org/pypi')
-    >>> result = locator.get_project('python-gnupg')
-    >>> pprint(result)
-    {'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
-    '0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
-    '0.2.6': <Distribution python-gnupg (0.2.6) [UNKNOWN]>,
-    '0.2.7': <Distribution python-gnupg (0.2.7) [UNKNOWN]>,
-    '0.2.8': <Distribution python-gnupg (0.2.8) [UNKNOWN]>,
-    '0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
-    '0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
-    '0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
-    >>>
+      >>> from distlib.locators import PyPIRPCLocator
+      >>> locator = PyPIRPCLocator('http://python.org/pypi')
+      >>> result = locator.get_project('python-gnupg')
+      >>> pprint(result)
+      {'0.2.3': <Distribution python-gnupg (0.2.3) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.3.tar.gz]>,
+       '0.2.4': <Distribution python-gnupg (0.2.4) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.4.tar.gz]>,
+       '0.2.6': <Distribution python-gnupg (0.2.6) [UNKNOWN]>,
+       '0.2.7': <Distribution python-gnupg (0.2.7) [UNKNOWN]>,
+       '0.2.8': <Distribution python-gnupg (0.2.8) [UNKNOWN]>,
+       '0.2.9': <Distribution python-gnupg (0.2.9) [http://python-gnupg.googlecode.com/files/python-gnupg-0.2.9.tar.gz]>,
+       '0.3.0': <Distribution python-gnupg (0.3.0) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.0.tar.gz]>,
+       '0.3.1': <Distribution python-gnupg (0.3.1) [http://python-gnupg.googlecode.com/files/python-gnupg-0.3.1.tar.gz]>}
+      >>>
 
    .. note::
       The reason why some of the download URLs come up as UNKNOWN is that some of
    :func:`get_all_distribution_names`, which retrieves the names of all
    distributions registered on PyPI::
 
-    >>> from distlib.locators import get_all_distribution_names
-    >>> names = get_all_package_names()
-    >>> len(names)
-    24801
-    >>>
+      >>> from distlib.locators import get_all_distribution_names
+      >>> names = get_all_package_names()
+      >>> len(names)
+      24801
+      >>>
 
    This is implemented using the XML-RPC API.
 
 
    Instances of this class can be compared and sorted::
 
-    >>> NormalizedVersion('1.2b1') < NormalizedVersion('1.2')
-    True
-    >>>
+      >>> NormalizedVersion('1.2b1') < NormalizedVersion('1.2')
+      True
+      >>>
 
    :class:`NormalizedVersion` is used internally by :class:`VersionPredicate`
    to do its work.
    Exception raised when an invalid string is given to
    :class:`NormalizedVersion`::
 
-    >>> NormalizedVersion("irrational_version_number")
-    IrrationalVersionError: irrational_version_number
-    >>>
+      >>> NormalizedVersion("irrational_version_number")
+      IrrationalVersionError: irrational_version_number
+      >>>
 
 .. function:: suggest_normalized_version(s)
 
    provides a function to try to convert any string to a valid, normalized
    version::
 
-    >>> suggest_normalized_version('2.1-rc1')
-    2.1c1
-    >>>
+      >>> suggest_normalized_version('2.1-rc1')
+      2.1c1
+      >>>
 
    If :func:`suggest_normalized_version` can't make sense of the given string,
    it will return ``None``::
 
-    >>> print(suggest_normalized_version('not a version'))
-    None
-    >>
+      >>> print(suggest_normalized_version('not a version'))
+      None
+      >>
 
 Version predicates
 ------------------
 
       Test if a version number matches the predicate::
 
-    >>> version = VersionPredicate("ProjectName (<1.2, >1.0)")
-    >>> version.match("1.2.1")
-    False
-    >>> version.match("1.1.1")
-    True
-    >>>
+         >>> version = VersionPredicate("ProjectName (<1.2, >1.0)")
+         >>> version.match("1.2.1")
+         False
+         >>> version.match("1.1.1")
+         True
+         >>>
 
 Validation helpers
 ------------------