diff options
| author | Chris McDonough <chrism@plope.com> | 2011-07-15 10:14:02 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-07-15 10:14:02 -0400 |
| commit | 049e0e76ead84806d8033b3de75dd037434f7637 (patch) | |
| tree | d47c6230bbab46bf83022730412296574c2893fb /docs | |
| parent | 4edda0d6d875ee0e7bc0375e4b314d78b1261f0e (diff) | |
| parent | c515d77de5b2f62727251ebc32d1292e67811771 (diff) | |
| download | pyramid-049e0e76ead84806d8033b3de75dd037434f7637.tar.gz pyramid-049e0e76ead84806d8033b3de75dd037434f7637.tar.bz2 pyramid-049e0e76ead84806d8033b3de75dd037434f7637.zip | |
Merge branch 'mmerickel-feature.scripting'
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api/config.rst | 12 | ||||
| -rw-r--r-- | docs/api/paster.rst | 15 | ||||
| -rw-r--r-- | docs/api/scripting.rst | 4 | ||||
| -rw-r--r-- | docs/narr/assets.rst | 2 | ||||
| -rw-r--r-- | docs/whatsnew-1.1.rst | 39 |
5 files changed, 64 insertions, 8 deletions
diff --git a/docs/api/config.rst b/docs/api/config.rst index 71ef4a746..2c394ac41 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -86,3 +86,15 @@ .. automethod:: testing_add_renderer + .. attribute:: global_registries + + The set of registries that have been created for :app:`Pyramid` + applications, one per each call to + :meth:`pyramid.config.Configurator.make_app` in the current process. The + object itself supports iteration and has a ``last`` property containing + the last registry loaded. + + The registries contained in this object are stored as weakrefs, + thus they will only exist for the lifetime of the actual + applications for which they are being used. + diff --git a/docs/api/paster.rst b/docs/api/paster.rst index 6668f3c77..2a32e07e9 100644 --- a/docs/api/paster.rst +++ b/docs/api/paster.rst @@ -3,14 +3,15 @@ :mod:`pyramid.paster` --------------------------- -.. module:: pyramid.paster +.. automodule:: pyramid.paster -.. function:: get_app(config_file, name=None) + .. function:: get_app(config_uri, name=None) - Return the WSGI application named ``name`` in the PasteDeploy - config file ``config_file``. + Return the WSGI application named ``name`` in the PasteDeploy + config file specified by ``config_uri``. - If the ``name`` is None, this will attempt to parse the name from - the ``config_file`` string expecting the format ``ini_file#name``. - If no name is found, the name will default to "main". + If the ``name`` is None, this will attempt to parse the name from + the ``config_uri`` string expecting the format ``inifile#name``. + If no name is found, the name will default to "main". + .. autofunction:: bootstrap diff --git a/docs/api/scripting.rst b/docs/api/scripting.rst index 9d5bc2e58..79136a98b 100644 --- a/docs/api/scripting.rst +++ b/docs/api/scripting.rst @@ -7,3 +7,7 @@ .. autofunction:: get_root + .. autofunction:: prepare + + .. autofunction:: make_request + diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index d57687477..f35f6dd7d 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -312,7 +312,7 @@ its behavior is almost exactly the same once it's configured. ``add_view`` (at least those without a ``route_name``). A :class:`~pyramid.static.static_view` static view cannot be made root-relative when you use traversal unless it's registered as a - :term:`NotFound view`. + :term:`Not Found view`. To serve files within a directory located on your filesystem at ``/path/to/static/dir`` as the result of a "catchall" route hanging from the diff --git a/docs/whatsnew-1.1.rst b/docs/whatsnew-1.1.rst index dd4d488a0..32955ab75 100644 --- a/docs/whatsnew-1.1.rst +++ b/docs/whatsnew-1.1.rst @@ -266,6 +266,45 @@ Minor Feature Additions :class:`pyramid.static.static_view` exposes a ``use_subpath`` flag for use when you want the static view to behave like the older deprecated version. +- A new API function :func:`pyramid.paster.bootstrap` has been added to make + writing scripts that bootstrap a Pyramid environment easier, e.g.: + + .. code-block:: python + + from pyramid.paster import bootstrap + info = bootstrap('/path/to/my/development.ini') + request = info['request'] + print request.route_url('myroute') + +- A new api function :func:`pyramid.scripting.prepare` has been added. It is + a lower-level analogue of :func:`pyramid.paster.boostrap` that accepts a + request and a registry instead of a config file argument, and is used for + the same purpose: + + .. code-block:: python + + from pyramid.scripting import prepare + info = prepare(registry=myregistry) + request = info['request'] + print request.route_url('myroute') + +- A new API function :func:`pyramid.scripting.make_request` has been added. + The resulting request will have a ``registry`` attribute. It is meant to + be used in conjunction with :func:`pyramid.scripting.prepare` and/or + :func:`pyramid.paster.bootstrap` (both of which accept a request as an + argument): + + .. code-block:: python + + from pyramid.scripting import make_request + request = make_request('/') + +- New API attribute :attr:`pyramid.config.global_registries` is an iterable + object that contains references to every Pyramid registry loaded into the + current process via :meth:`pyramid.config.Configurator.make_app`. It also + has a ``last`` attribute containing the last registry loaded. This is used + by the scripting machinery, and is available for introspection. + Backwards Incompatibilities --------------------------- |
