summaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-08-10 20:20:05 -0400
committerChris McDonough <chrism@plope.com>2011-08-10 20:20:05 -0400
commit995466c6bc0da04f50d2db83af653362a0dadd6f (patch)
treee5e57108a3d751d9e02cbf06ad5eca8902f4a100 /docs/api
parent9a8ba2f09fe3791febbfec2ac383c091aacfbf5b (diff)
parent3e3fcdf1376218a4fa6dcffec4f27a41c63d1675 (diff)
downloadpyramid-995466c6bc0da04f50d2db83af653362a0dadd6f.tar.gz
pyramid-995466c6bc0da04f50d2db83af653362a0dadd6f.tar.bz2
pyramid-995466c6bc0da04f50d2db83af653362a0dadd6f.zip
fix merge conflicts
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/config.rst16
-rw-r--r--docs/api/interfaces.rst5
-rw-r--r--docs/api/paster.rst14
-rw-r--r--docs/api/renderers.rst9
-rw-r--r--docs/api/request.rst21
-rw-r--r--docs/api/response.rst5
-rw-r--r--docs/api/scripting.rst2
-rw-r--r--docs/api/security.rst2
-rw-r--r--docs/api/static.rst11
-rw-r--r--docs/api/tweens.rst25
10 files changed, 99 insertions, 11 deletions
diff --git a/docs/api/config.rst b/docs/api/config.rst
index 71ef4a746..30c541905 100644
--- a/docs/api/config.rst
+++ b/docs/api/config.rst
@@ -44,7 +44,7 @@
.. automethod:: add_route
- .. automethod:: add_static_view(name, path, cache_max_age=3600, permission='__no_permission_required__')
+ .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED)
.. automethod:: add_settings
@@ -78,6 +78,8 @@
.. automethod:: set_view_mapper
+ .. automethod:: add_tween
+
.. automethod:: testing_securitypolicy
.. automethod:: testing_resources
@@ -86,3 +88,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_wsgi_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/interfaces.rst b/docs/api/interfaces.rst
index 51a1963b5..9ab9eefc3 100644
--- a/docs/api/interfaces.rst
+++ b/docs/api/interfaces.rst
@@ -9,14 +9,19 @@ Event-Related Interfaces
++++++++++++++++++++++++
.. autointerface:: IApplicationCreated
+ :members:
.. autointerface:: INewRequest
+ :members:
.. autointerface:: IContextFound
+ :members:
.. autointerface:: INewResponse
+ :members:
.. autointerface:: IBeforeRender
+ :members:
Other Interfaces
++++++++++++++++
diff --git a/docs/api/paster.rst b/docs/api/paster.rst
index 9ecfa3d9c..2a32e07e9 100644
--- a/docs/api/paster.rst
+++ b/docs/api/paster.rst
@@ -3,11 +3,15 @@
:mod:`pyramid.paster`
---------------------------
-.. module:: pyramid.paster
+.. automodule:: pyramid.paster
-.. function:: get_app(config_file, name)
+ .. 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_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/renderers.rst b/docs/api/renderers.rst
index c13694219..15670c46e 100644
--- a/docs/api/renderers.rst
+++ b/docs/api/renderers.rst
@@ -13,3 +13,12 @@
.. autoclass:: JSONP
+.. attribute:: null_renderer
+
+ An object that can be used in advanced integration cases as input to the
+ view configuration ``renderer=`` argument. When the null renderer is used
+ as a view renderer argument, Pyramid avoids converting the view callable
+ result into a Response object. This is useful if you want to reuse the
+ view configuration and lookup machinery outside the context of its use by
+ the Pyramid router (e.g. the package named ``pyramid_rpc`` does this).
+
diff --git a/docs/api/request.rst b/docs/api/request.rst
index 5dfb2ae9a..2ab3977d5 100644
--- a/docs/api/request.rst
+++ b/docs/api/request.rst
@@ -85,6 +85,17 @@
of ``request.exception`` will be ``None`` within response and
finished callbacks.
+ .. attribute:: exc_info
+
+ If an exception was raised by a :term:`root factory` or a :term:`view
+ callable`, or at various other points where :app:`Pyramid` executes
+ user-defined code during the processing of a request, result of
+ ``sys.exc_info()`` will be available as the ``exc_info`` attribute of
+ the request within a :term:`exception view`, a :term:`response callback`
+ or a :term:`finished callback`. If no exception occurred, the value of
+ ``request.exc_info`` will be ``None`` within response and finished
+ callbacks.
+
.. attribute:: response
This attribute is actually a "reified" property which returns an
@@ -180,12 +191,12 @@
object (exposed to view code as ``request.response``) to influence
rendered response behavior.
- .. attribute:: json
+ .. attribute:: json_body
- If the request's ``content_type`` is ``application/json``, this
- attribute will contain the JSON-decoded variant of the request body.
- If the request's ``content_type`` is not ``application/json``, this
- attribute will be ``None``.
+ This property will return the JSON-decoded variant of the request
+ body. If the request body is not well-formed JSON, or there is no
+ body associated with this request, this property will raise an
+ exception. See also :ref:`request_json_body`.
.. note::
diff --git a/docs/api/response.rst b/docs/api/response.rst
index e67b15568..8020b629a 100644
--- a/docs/api/response.rst
+++ b/docs/api/response.rst
@@ -9,3 +9,8 @@
:members:
:inherited-members:
+Functions
+~~~~~~~~~
+
+.. autofunction:: response_adapter
+
diff --git a/docs/api/scripting.rst b/docs/api/scripting.rst
index 9d5bc2e58..51bd3c7a0 100644
--- a/docs/api/scripting.rst
+++ b/docs/api/scripting.rst
@@ -7,3 +7,5 @@
.. autofunction:: get_root
+ .. autofunction:: prepare
+
diff --git a/docs/api/security.rst b/docs/api/security.rst
index de249355d..8cd9e5dae 100644
--- a/docs/api/security.rst
+++ b/docs/api/security.rst
@@ -57,6 +57,8 @@ Constants
last ACE in an ACL in systems that use an "inheriting" security
policy, representing the concept "don't inherit any other ACEs".
+.. attribute:: NO_PERMISSION_REQUIRED
+
Return Values
-------------
diff --git a/docs/api/static.rst b/docs/api/static.rst
new file mode 100644
index 000000000..c28473584
--- /dev/null
+++ b/docs/api/static.rst
@@ -0,0 +1,11 @@
+.. _static_module:
+
+:mod:`pyramid.static`
+---------------------
+
+.. automodule:: pyramid.static
+
+ .. autoclass:: static_view
+ :members:
+ :inherited-members:
+
diff --git a/docs/api/tweens.rst b/docs/api/tweens.rst
new file mode 100644
index 000000000..ddacd2cde
--- /dev/null
+++ b/docs/api/tweens.rst
@@ -0,0 +1,25 @@
+.. _tweens_module:
+
+:mod:`pyramid.tweens`
+---------------------
+
+.. automodule:: pyramid.tweens
+
+ .. autofunction:: excview_tween_factory
+
+ .. attribute:: MAIN
+
+ Constant representing the main Pyramid handling function, for use in
+ ``under`` and ``over`` arguments to
+ :meth:`pyramid.config.Configurator.add_tween`.
+
+ .. attribute:: INGRESS
+
+ Constant representing the request ingress, for use in ``under`` and
+ ``over`` arguments to :meth:`pyramid.config.Configurator.add_tween`.
+
+ .. attribute:: EXCVIEW
+
+ Constant representing the exception view tween, for use in ``under``
+ and ``over`` arguments to
+ :meth:`pyramid.config.Configurator.add_tween`.