Antti Haapala
2013-11-16 392a6c7df93b67d6889680133fda0f744970d61f
Removed extra indentation from some examples (:linenos: should be indented with the same indentation as the rest of the code block)
16 files modified
80 ■■■■ changed files
docs/designdefense.rst 2 ●●● patch | view | raw | blame | history
docs/narr/events.rst 6 ●●●● patch | view | raw | blame | history
docs/narr/extending.rst 2 ●●● patch | view | raw | blame | history
docs/narr/hooks.rst 20 ●●●● patch | view | raw | blame | history
docs/narr/hybrid.rst 2 ●●● patch | view | raw | blame | history
docs/narr/i18n.rst 8 ●●●● patch | view | raw | blame | history
docs/narr/introduction.rst 6 ●●●● patch | view | raw | blame | history
docs/narr/introspector.rst 4 ●●●● patch | view | raw | blame | history
docs/narr/logging.rst 2 ●●● patch | view | raw | blame | history
docs/narr/resources.rst 2 ●●● patch | view | raw | blame | history
docs/narr/scaffolding.rst 2 ●●● patch | view | raw | blame | history
docs/narr/upgrading.rst 4 ●●●● patch | view | raw | blame | history
docs/narr/urldispatch.rst 10 ●●●● patch | view | raw | blame | history
docs/narr/vhosting.rst 4 ●●●● patch | view | raw | blame | history
docs/narr/views.rst 2 ●●● patch | view | raw | blame | history
docs/tutorials/wiki/authorization.rst 4 ●●●● patch | view | raw | blame | history
docs/designdefense.rst
@@ -1078,7 +1078,7 @@
The contents of ``config.py``:
.. code-block:: python
  :linenos:
    :linenos:
    L = []
docs/narr/events.rst
@@ -172,7 +172,7 @@
example custom event classes:
.. code-block:: python
   :linenos:
    :linenos:
    class DocCreated(object):
        def __init__(self, doc, request):
@@ -196,7 +196,7 @@
event with a decorator:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.events import subscriber
    from .events import DocCreated
@@ -215,7 +215,7 @@
accessed as ``request.registry.notify``. For example:
.. code-block:: python
   :linenos:
    :linenos:
    from .events import DocCreated
docs/narr/extending.rst
@@ -234,7 +234,7 @@
``configure_views`` configuration method:
.. code-block:: python
   :linenos:
    :linenos:
    def configure_views(config):
        config.add_view('theoriginalapp.views.theview', name='theview')
docs/narr/hooks.rst
@@ -363,7 +363,7 @@
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 @@
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 @@
method:
.. code-block:: python
   :linenos:
    :linenos:
    class simple_tween_factory(object):
        def __init__(handler, registry):
@@ -1049,7 +1049,7 @@
request:
.. code-block:: python
   :linenos:
    :linenos:
    # in a module named myapp.tweens
@@ -1101,7 +1101,7 @@
Pyramid application:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.config import Configurator
    config = Configurator()
@@ -1135,7 +1135,7 @@
request handler function.  For example:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.config import Configurator
@@ -1379,7 +1379,7 @@
method. For example:
.. code-block:: python
   :linenos:
    :linenos:
    class ContentTypePredicate(object):
        def __init__(self, val, config):
@@ -1442,7 +1442,7 @@
event type.
.. code-block:: python
   :linenos:
    :linenos:
    class RequestPathStartsWith(object):
        def __init__(self, val, config):
@@ -1471,7 +1471,7 @@
:meth:`~pyramid.config.Configurator.add_subscriber`:
.. code-block:: python
   :linenos:
    :linenos:
    # define a subscriber in your code
@@ -1487,7 +1487,7 @@
:class:`~pyramid.events.subscriber`.
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.events import subscriber
docs/narr/hybrid.rst
@@ -63,7 +63,7 @@
declarations that look like this:
.. code-block:: python
   :linenos:
    :linenos:
    # config is an instance of pyramid.config.Configurator
docs/narr/i18n.rst
@@ -309,7 +309,7 @@
application's ``setup.py`` file:
.. code-block:: python
   :linenos:
    :linenos:
    setup(name="mypackage",
          # ...
@@ -370,7 +370,7 @@
that look something like the following:
.. code-block:: ini
   :linenos:
    :linenos:
    [compile_catalog]
    directory = myproject/locale
@@ -398,7 +398,7 @@
instead, change the ``setup.cfg`` file stanzas to look like so:
.. code-block:: ini
   :linenos:
    :linenos:
    [compile_catalog]
    directory = myproject/locale
@@ -1041,7 +1041,7 @@
Here's an implementation of a simple locale negotiator:
.. code-block:: python
   :linenos:
    :linenos:
    def my_locale_negotiator(request):
        locale_name = request.params.get('my_locale')
docs/narr/introduction.rst
@@ -336,7 +336,7 @@
``render_to_response`` call:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.renderers import render_to_response
@@ -347,7 +347,7 @@
You can return a Python dictionary:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.view import view_config
@@ -827,7 +827,7 @@
callable:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.view import view_config
    from pyramid.response import Response
docs/narr/introspector.rst
@@ -24,7 +24,7 @@
callable:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.view import view_config
    from pyramid.response import Response
@@ -100,7 +100,7 @@
For example:
.. code-block:: python
   :linenos:
    :linenos:
    route_intr = introspector.get('routes', 'edit_user')
    pattern = route_intr['pattern']
docs/narr/logging.rst
@@ -179,7 +179,7 @@
methods on it.
.. code-block:: python 
   :linenos:
    :linenos:
    import logging 
    log = logging.getLogger(__name__) 
docs/narr/resources.rst
@@ -83,7 +83,7 @@
Here's a sample resource tree, represented by a variable named ``root``:
.. code-block:: python
   :linenos:
    :linenos:
    class Resource(dict):
        pass
docs/narr/scaffolding.rst
@@ -112,7 +112,7 @@
defining your scaffold template:
.. code-block:: python
   :linenos:
     :linenos:
     try: # pyramid 1.0.X
         # "pyramid.paster.paste_script..." doesn't exist past 1.0.X
docs/narr/upgrading.rst
@@ -137,7 +137,7 @@
pyramid.view import static``) that is causing the problem:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.view import view_config
@@ -148,7 +148,7 @@
do things the newer way:
.. code-block:: python
   :linenos:
    :linenos:
    from pyramid.view import view_config
docs/narr/urldispatch.rst
@@ -492,7 +492,7 @@
result in a particular view callable being invoked:
.. code-block:: python
   :linenos:
    :linenos:
    config.add_route('idea', 'site/{id}')
    config.add_view('mypackage.views.site_view', route_name='idea')
@@ -901,7 +901,7 @@
which you started the application from.  For example:
.. code-block:: text
   :linenos:
    :linenos:
    $ PYRAMID_DEBUG_ROUTEMATCH=true $VENV/bin/pserve development.ini
    Starting server in PID 13586.
@@ -1060,7 +1060,7 @@
instance, a predicate might do some type conversion of values:
.. code-block:: python
   :linenos:
    :linenos:
    def integers(*segment_names):
        def predicate(info, request):
@@ -1086,7 +1086,7 @@
expressions specifying requirements for that marker. For instance:
.. code-block:: python
   :linenos:
    :linenos:
    def integers(*segment_names):
        def predicate(info, request):
@@ -1128,7 +1128,7 @@
the route in a set of route predicates:
.. code-block:: python
   :linenos:
    :linenos:
    def twenty_ten(info, request):
        if info['route'].name in ('ymd', 'ym', 'y'):
docs/narr/vhosting.rst
@@ -109,7 +109,7 @@
is below:
.. code-block:: apache
   :linenos:
    :linenos:
    NameVirtualHost *:80
@@ -130,7 +130,7 @@
the same can be achieved using ``SetEnv``:
.. code-block:: apache
   :linenos:
    :linenos:
    <Location />
      SetEnv HTTP_X_VHM_ROOT /cms
docs/narr/views.rst
@@ -536,7 +536,7 @@
   e.g.:
   .. code-block:: python
      :linenos:
       :linenos:
       from pyramid.response import Response
docs/tutorials/wiki/authorization.rst
@@ -149,8 +149,8 @@
``edit_page()``, for example:
.. code-block:: python
   :linenos:
   :emphasize-lines: 3
    :linenos:
    :emphasize-lines: 3
    @view_config(name='add_page', context='.models.Wiki',
                 renderer='templates/edit.pt',