From 40dbf42a2df1783c3d803adf950380c21512bb91 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 30 Jan 2013 00:41:23 +0200 Subject: use the more appropriate directives --- docs/api/registry.rst | 17 +++++++---------- docs/designdefense.rst | 2 +- docs/narr/commandline.rst | 3 ++- docs/narr/extconfig.rst | 4 +--- docs/narr/hooks.rst | 19 ++++++++----------- docs/narr/templates.rst | 8 ++------ docs/narr/viewconfig.rst | 8 +++----- docs/narr/views.rst | 4 ++-- docs/narr/webob.rst | 2 +- pyramid/config/adapters.py | 5 ++--- pyramid/config/views.py | 7 ++++--- pyramid/renderers.py | 14 ++++++-------- 12 files changed, 39 insertions(+), 54 deletions(-) diff --git a/docs/api/registry.rst b/docs/api/registry.rst index a7879d3d5..db348495c 100644 --- a/docs/api/registry.rst +++ b/docs/api/registry.rst @@ -16,6 +16,8 @@ .. attribute:: introspector + .. versionadded:: 1.3 + When a registry is set up (or created) by a :term:`Configurator`, the registry will be decorated with an instance named ``introspector`` implementing the :class:`pyramid.interfaces.IIntrospector` interface. @@ -27,28 +29,23 @@ This attribute is often accessed as ``request.registry.introspector`` in a typical Pyramid application. - This attribute is new as of :app:`Pyramid` 1.3. - .. class:: Introspectable + .. versionadded:: 1.3 + The default implementation of the interface :class:`pyramid.interfaces.IIntrospectable` used by framework exenders. An instance of this class is created when :attr:`pyramid.config.Configurator.introspectable` is called. - This class is new as of :app:`Pyramid` 1.3. - .. autoclass:: Deferred - This class is new as of :app:`Pyramid` 1.4. + .. versionadded:: 1.4 .. autofunction:: undefer - This function is new as of :app:`Pyramid` 1.4. + .. versionadded:: 1.4 .. autoclass:: predvalseq - This class is new as of :app:`Pyramid` 1.4. - - - + .. versionadded:: 1.4 diff --git a/docs/designdefense.rst b/docs/designdefense.rst index f51ef10a9..69a921498 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -919,7 +919,7 @@ creating a more Zope3-like environment without much effort. Pyramid Uses its Own HTTP Exception Class Hierarchy Rather Than ``webob.exc`` ----------------------------------------------------------------------------- -.. note:: This defense is new as of Pyramid 1.1. +.. versionadded:: 1.1 The HTTP exception classes defined in :mod:`pyramid.httpexceptions` are very much like the ones defined in ``webob.exc`` diff --git a/docs/narr/commandline.rst b/docs/narr/commandline.rst index 8d6b9d984..8e360216d 100644 --- a/docs/narr/commandline.rst +++ b/docs/narr/commandline.rst @@ -504,7 +504,8 @@ environment much like the environment produced when a particular using the :func:`pyramid.paster.bootstrap` command in the body of your script. -.. note:: This feature is new as of :app:`Pyramid` 1.1. +.. versionadded:: 1.1 + This feature. In the simplest case, :func:`pyramid.paster.bootstrap` can be used with a single argument, which accepts the :term:`PasteDeploy` ``.ini`` file diff --git a/docs/narr/extconfig.rst b/docs/narr/extconfig.rst index 875bc9006..f33326279 100644 --- a/docs/narr/extconfig.rst +++ b/docs/narr/extconfig.rst @@ -227,9 +227,7 @@ augment Pyramid's configuration introspection system. Adding Configuration Introspection ---------------------------------- -.. note:: - - The introspection subsystem is new in Pyramid 1.3. +.. versionadded:: 1.3 Pyramid provides a configuration introspection system that can be used by debugging tools to provide visibility into the configuration of a running diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst index b5efc0df1..fc5c0ff23 100644 --- a/docs/narr/hooks.rst +++ b/docs/narr/hooks.rst @@ -336,9 +336,9 @@ when adding renderer global values exists in :ref:`adding_renderer_globals`. Adding Renderer Globals (Deprecated) ------------------------------------ -.. warning:: this feature is deprecated as of Pyramid 1.1. A non-deprecated - mechanism which allows event subscribers to add renderer global values - is documented in :ref:`beforerender_event`. +.. deprecated:: 1.1 + An alternative mechanism which allows event subscribers to add renderer + global values is documented in :ref:`beforerender_event`. Whenever :app:`Pyramid` handles a request to perform a rendering (after a view with a ``renderer=`` configuration attribute is invoked, or when any of @@ -635,13 +635,13 @@ See :meth:`pyramid.config.add_resource_url_adapter` for more information. Changing How Pyramid Treats View Responses ------------------------------------------ +.. versionadded:: 1.1 + It is possible to control how Pyramid treats the result of calling a view callable on a per-type basis by using a hook involving :meth:`pyramid.config.Configurator.add_response_adapter` or the :class:`~pyramid.response.response_adapter` decorator. -.. note:: This feature is new as of Pyramid 1.1. - Pyramid, in various places, adapts the result of calling a view callable to the :class:`~pyramid.interfaces.IResponse` interface to ensure that the object returned by the view callable is a "true" response object. The vast @@ -936,8 +936,8 @@ For full details, please read the `Venusian documentation Registering "Tweens" -------------------- -.. note:: Tweens are a feature which were added in Pyramid 1.2. They are - not available in any previous version. +.. versionadded:: 1.2 + Tweens A :term:`tween` (a contraction of the word "between") is a bit of code that sits between the Pyramid router's main request handling function and the @@ -1241,10 +1241,7 @@ implict and explicit tween chains used by an application. See Adding A Third Party View, Route, or Subscriber Predicate --------------------------------------------------------- -.. note:: - - Third-party view, route, and subscriber predicates are a feature new as of - Pyramid 1.4. +.. versionadded:: 1.4 .. _view_and_route_predicates: diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index 1cec26fbc..6a1fbf916 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -543,9 +543,7 @@ template as a :term:`renderer` like so: The above will render only the ``bar`` macro defined within the ``foo.pt`` template instead of the entire template. -.. note:: - - This feature is new in Pyramid 1.4. +.. versionadded:: 1.4 .. index:: single: Chameleon text templates @@ -743,9 +741,7 @@ configure the template as a :term:`renderer` like so: The above will render the ``bar`` def from within the ``foo.mak`` template instead of the entire template. -.. note:: - - This feature is new in Pyramid 1.4. +.. versionadded:: 1.4 .. index:: single: automatic reloading of templates diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index f00dae451..7001cd980 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -306,7 +306,7 @@ configured view. consideration of keys and values in the ``request.params`` dictionary. ``match_param`` - .. note:: This feature is new as of :app:`Pyramid` 1.2. + .. versionadded:: 1.2 This param may be either a single string of the format "key=value" or a dict of key/value pairs. @@ -724,9 +724,7 @@ configuration to take effect. ``@view_defaults`` Class Decorator ---------------------------------- -.. note:: - - This feature is new in Pyramid 1.3. +.. versionadded:: 1.3 If you use a class as a view, you can use the :class:`pyramid.view.view_defaults` class decorator on the class to provide @@ -952,7 +950,7 @@ for more information about how, and where to set these values. Influencing HTTP Caching ------------------------ -.. note:: This feature is new in Pyramid 1.1. +.. versionadded:: 1.1 When a non-``None`` ``http_cache`` argument is passed to a view configuration, Pyramid will set ``Expires`` and ``Cache-Control`` response diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 4f30bb7fa..860c380f3 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -227,8 +227,8 @@ equivalent to ``raise HTTPUnauthorized()``. Documentation which maps each HTTP response code to its purpose and its associated HTTP exception object is provided within :mod:`pyramid.httpexceptions`. -.. note:: The :func:`~pyramid.httpexceptions.exception_response` function is - new as of Pyramid 1.1. +.. versionadded:: 1.1 + The :func:`~pyramid.httpexceptions.exception_response` function. How Pyramid Uses HTTP Exceptions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst index a8c11acec..44940f9e6 100644 --- a/docs/narr/webob.rst +++ b/docs/narr/webob.rst @@ -251,7 +251,7 @@ API documentation for a multidict exists as Dealing With A JSON-Encoded Request Body ++++++++++++++++++++++++++++++++++++++++ -.. note:: this feature is new as of Pyramid 1.1. +.. versionadded:: 1.1 :attr:`pyramid.request.Request.json_body` is a property that returns a :term:`JSON` -decoded representation of the request body. If the request diff --git a/pyramid/config/adapters.py b/pyramid/config/adapters.py index 3ce0680af..319beab67 100644 --- a/pyramid/config/adapters.py +++ b/pyramid/config/adapters.py @@ -136,6 +136,8 @@ class AdaptersConfiguratorMixin(object): def add_subscriber_predicate(self, name, factory, weighs_more_than=None, weighs_less_than=None): """ + .. versionadded:: 1.4 + Adds a subscriber predicate factory. The associated subscriber predicate can later be named as a keyword argument to :meth:`pyramid.config.Configurator.add_subscriber` in the @@ -149,9 +151,6 @@ class AdaptersConfiguratorMixin(object): See :ref:`subscriber_predicates` for more information. - .. note:: - - This method is new as of Pyramid 1.4. """ self._add_predicate( 'subscriber', diff --git a/pyramid/config/views.py b/pyramid/config/views.py index de96363de..1b89437ea 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -822,7 +822,8 @@ class ViewsConfiguratorMixin(object): think about preserving function attributes such as ``__name__`` and ``__module__`` within decorator logic). - Passing an iterable is only supported as of :app:`Pyramid` 1.4a4. + .. versionchanged:: 1.4a4 + Passing an iterable. mapper @@ -878,8 +879,8 @@ class ViewsConfiguratorMixin(object): view will respond to ``HEAD`` as of Pyramid 1.4. .. versionchanged:: 1.2 - The ability to pass a tuple of items as ``request_method`` is - new as of Pyramid 1.2. Previous versions allowed only a string. + The ability to pass a tuple of items as ``request_method``. + Previous versions allowed only a string. request_param diff --git a/pyramid/renderers.py b/pyramid/renderers.py index 6310b7fee..64951a6ba 100644 --- a/pyramid/renderers.py +++ b/pyramid/renderers.py @@ -203,11 +203,9 @@ class JSON(object): ``default``, and any extra ``kw`` keyword argments passed during renderer construction. - .. note:: - - This feature is new in Pyramid 1.4. Prior to 1.4 there was - no public API for supplying options to the underlying - serializer without defining a custom renderer. + .. versionadded:: 1.4 + Prior to this version, there was no public API for supplying options + to the underlying serializer without defining a custom renderer. """ def __init__(self, serializer=json.dumps, adapters=(), **kw): @@ -302,8 +300,8 @@ class JSONP(JSON): config = Configurator() config.add_renderer('jsonp', JSONP(param_name='callback', indent=4)) - .. note:: The ability of this class to accept a ``**kw`` in its - constructor is new as of Pyramid 1.4. + .. versionchanged:: 1.4 + The ability of this class to accept a ``**kw`` in its constructor. The arguments passed to this class' constructor mean the same thing as the arguments passed to :class:`pyramid.renderers.JSON` (including @@ -331,7 +329,7 @@ class JSONP(JSON): - If there is no callback parameter in the request's query string, the renderer will return a 'plain' JSON response. - .. note:: This feature is new in Pyramid 1.1. + .. versionadded:: 1.1 See also: :ref:`jsonp_renderer`. """ -- cgit v1.2.3