From 51b2f9457a852956342518683f5c13d9da394b52 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 8 Sep 2010 05:01:26 +0000 Subject: - The ``repoze.bfg.interfaces`` API documentation page is now rendered via ``repoze.sphinx.autointerface``. - The URL Dispatch narrative chapter now refers to the ``interfaces`` chapter to explain the API of an ``IRoute`` object. - ``tests_require`` now includes ``repoze.sphinx.autointerface`` as a dependency. --- CHANGES.txt | 12 ++++++++++++ docs/api/interfaces.rst | 14 +++++++++----- docs/conf.py | 3 ++- docs/narr/urldispatch.rst | 6 +++++- repoze/bfg/interfaces.py | 2 +- setup.py | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 0b5507b56..af6f84b2d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -38,12 +38,24 @@ Documentation pattern as a ``path`` have now been updated to refer to them as a ``pattern``. +- The ``repoze.bfg.interfaces`` API documentation page is now rendered + via ``repoze.sphinx.autointerface``. + +- The URL Dispatch narrative chapter now refers to the ``interfaces`` + chapter to explain the API of an ``IRoute`` object. + Paster Templates ---------------- - The routesalchemy template has been updated to use ``pattern`` in its route declarations rather than ``path``. +Dependencies +------------ + +- ``tests_require`` now includes ``repoze.sphinx.autointerface`` as a + dependency. + Internal -------- diff --git a/docs/api/interfaces.rst b/docs/api/interfaces.rst index e024fcff7..934322594 100644 --- a/docs/api/interfaces.rst +++ b/docs/api/interfaces.rst @@ -8,17 +8,21 @@ Event-Related Interfaces ++++++++++++++++++++++++ - .. autoclass:: IAfterTraversal + .. autointerface:: IAfterTraversal - .. autoclass:: INewRequest + .. autointerface:: INewRequest - .. autoclass:: INewResponse + .. autointerface:: INewResponse - .. autoclass:: IWSGIApplicationCreatedEvent + .. autointerface:: IWSGIApplicationCreatedEvent Other Interfaces ++++++++++++++++ - .. autoclass:: IExceptionResponse + .. autointerface:: IExceptionResponse + + .. autointerface:: IRoutesMapper + + .. autointerface:: IRoute diff --git a/docs/conf.py b/docs/conf.py index 2f01288b7..2b417ff74 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,8 @@ for item in os.listdir(parent): # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', + 'repoze.sphinx.autointerface'] # Add any paths that contain templates here, relative to this directory. templates_path = ['.templates'] diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 6a5a24c81..2f1a235a7 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -657,7 +657,8 @@ current :term:`request` object. The ``info`` dictionary has a number of contained values: ``match`` is a dictionary: it represents the arguments matched in the URL by the route. ``route`` is an object representing the route which was -matched. +matched (see ``IRoute`` in :ref:`interfaces_module` for the API of +such a route object). ``info['match']`` is useful when predicates need access to the route match. For example: @@ -749,6 +750,9 @@ The above predicate, when added to a number of route configurations ensures that the year match argument is '2010' if and only if the route name is 'ymd', 'ym', or 'y'. +See also ``IRoute`` in :ref:`interfaces_module` for more API +documentation about a route object. + Route Matching -------------- diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 7082846e4..ae6bf3b20 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -286,7 +286,7 @@ class IRoutesMapper(Interface): """ Return a dictionary containing matching information for the request; the ``route`` key of this dictionary will either be a Route object or ``None`` if no route matched; the - ``match``key will be the matchdict or ``None`` if no route + ``match`` key will be the matchdict or ``None`` if no route matched.""" class IContextURL(Interface): diff --git a/setup.py b/setup.py index 68526a691..c36fca4ce 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ if platform.system() == 'Java': tests_require = install_requires + ['twill'] else: tests_require= install_requires + ['Sphinx', 'docutils', 'coverage', - 'twill'] + 'twill', 'repoze.sphinx.autointerface'] if sys.version_info[:2] < (2, 6): install_requires.append('simplejson') -- cgit v1.2.3