summaryrefslogtreecommitdiff
path: root/docs/narr/hooks.rst
diff options
context:
space:
mode:
authorAntti Haapala <antti@haapala.name>2013-11-17 00:11:37 +0200
committerAntti Haapala <antti@haapala.name>2013-11-17 00:51:16 +0200
commit392a6c7df93b67d6889680133fda0f744970d61f (patch)
tree6a95764f874efbbb0114516d58bcdd0e3e5aa6e4 /docs/narr/hooks.rst
parent94b754aac45e235b5b11a60489395b77c8195fdc (diff)
downloadpyramid-392a6c7df93b67d6889680133fda0f744970d61f.tar.gz
pyramid-392a6c7df93b67d6889680133fda0f744970d61f.tar.bz2
pyramid-392a6c7df93b67d6889680133fda0f744970d61f.zip
Removed extra indentation from some examples (:linenos: should be indented with the same indentation as the rest of the code block)
Diffstat (limited to 'docs/narr/hooks.rst')
-rw-r--r--docs/narr/hooks.rst20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 84dd2143c..14009a094 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -363,7 +363,7 @@ and modify the set of :term:`renderer globals` before they are passed to a
that can be used for this purpose. For example:
.. code-block:: python
- :linenos:
+ :linenos:
from pyramid.events import subscriber
from pyramid.events import BeforeRender
@@ -998,7 +998,7 @@ downstream Pyramid application.
You can write the tween factory as a simple closure-returning function:
.. code-block:: python
- :linenos:
+ :linenos:
def simple_tween_factory(handler, registry):
# one-time configuration code goes here
@@ -1020,7 +1020,7 @@ Alternatively, the tween factory can be a class with the ``__call__`` magic
method:
.. code-block:: python
- :linenos:
+ :linenos:
class simple_tween_factory(object):
def __init__(handler, registry):
@@ -1049,7 +1049,7 @@ Here's a complete example of a tween that logs the time spent processing each
request:
.. code-block:: python
- :linenos:
+ :linenos:
# in a module named myapp.tweens
@@ -1101,7 +1101,7 @@ Here's an example of registering a tween factory as an "implicit" tween in a
Pyramid application:
.. code-block:: python
- :linenos:
+ :linenos:
from pyramid.config import Configurator
config = Configurator()
@@ -1135,7 +1135,7 @@ chain (the tween generated by the very last tween factory added) as its
request handler function. For example:
.. code-block:: python
- :linenos:
+ :linenos:
from pyramid.config import Configurator
@@ -1379,7 +1379,7 @@ route predicate factory is most often a class with a constructor
method. For example:
.. code-block:: python
- :linenos:
+ :linenos:
class ContentTypePredicate(object):
def __init__(self, val, config):
@@ -1442,7 +1442,7 @@ with a subscriber that subscribes to the :class:`pyramid.events.NewRequest`
event type.
.. code-block:: python
- :linenos:
+ :linenos:
class RequestPathStartsWith(object):
def __init__(self, val, config):
@@ -1471,7 +1471,7 @@ previously registered ``request_path_startswith`` predicate in a call to
:meth:`~pyramid.config.Configurator.add_subscriber`:
.. code-block:: python
- :linenos:
+ :linenos:
# define a subscriber in your code
@@ -1487,7 +1487,7 @@ Here's the same subscriber/predicate/event-type combination used via
:class:`~pyramid.events.subscriber`.
.. code-block:: python
- :linenos:
+ :linenos:
from pyramid.events import subscriber