From 4df5975a690d1f0921efb84f48f544211b4f869d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 21 Nov 2012 22:56:25 -0500 Subject: document new introspectable attrs --- docs/narr/introspector.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs/narr') diff --git a/docs/narr/introspector.rst b/docs/narr/introspector.rst index b88f3f0c8..bd81fb56a 100644 --- a/docs/narr/introspector.rst +++ b/docs/narr/introspector.rst @@ -130,6 +130,23 @@ introspectables in categories not described here. A sequence of interfaces (or classes) that are subscribed to (the resolution of the ``ifaces`` argument passed to ``add_subscriber``). + ``derived_subscriber`` + + A wrapper around the subscriber used internally by the system so it can + call it with more than one argument if your original subscriber accepts + only one. + + ``predicates`` + + The predicate objects created as the result of passing predicate arguments + to ``add_susbcriber`` + + ``derived_predicates`` + + Wrappers around the predicate objects created as the result of passing + predicate arguments to ``add_susbcriber`` (to be used when predicates take + only one value but must be passed more than one). + ``response adapters`` Each introspectable in the ``response adapters`` category represents a call -- cgit v1.2.3 From 5acf4b4809e88dfeb3882f5033622a9517763d02 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 22 Nov 2012 00:39:19 -0500 Subject: appeasement --- docs/narr/install.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index e8482a289..32f331550 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -243,6 +243,17 @@ Once you've got setuptools or distribute installed, you should install the :term:`virtualenv` package. To install the :term:`virtualenv` package into your setuptools-enabled Python interpreter, use the ``easy_install`` command. +.. warning:: + + Even though Python 3.3 and better comes with ``pyvenv`` out of the box, + which is similar to ``virtualenv``, we suggest using ``virtualenv`` instead. + ``virtualenv`` works on well Python 3.3. This isn't a recommendation made + for technical reasons, it's one made because it's not possible for the + authors of this guide to explain setup using multiple virtual environment + systems. ``pyenv`` will work fine. However, if you use ``pyvenv`` instead, + you'll need to understand how to install software such as ``distribute`` + into the virtual environment manually, which this guide does not cover. + .. code-block:: text $ easy_install virtualenv -- cgit v1.2.3 From 5d9c28f4e7f1fd3eba75e5bb51aebcbb56440df8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 22 Nov 2012 00:40:47 -0500 Subject: more appeasement --- docs/narr/install.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 32f331550..663f0df6c 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -248,11 +248,14 @@ your setuptools-enabled Python interpreter, use the ``easy_install`` command. Even though Python 3.3 and better comes with ``pyvenv`` out of the box, which is similar to ``virtualenv``, we suggest using ``virtualenv`` instead. ``virtualenv`` works on well Python 3.3. This isn't a recommendation made - for technical reasons, it's one made because it's not possible for the + for technical reasons, it's one made because it's not feasible for the authors of this guide to explain setup using multiple virtual environment - systems. ``pyenv`` will work fine. However, if you use ``pyvenv`` instead, - you'll need to understand how to install software such as ``distribute`` - into the virtual environment manually, which this guide does not cover. + systems. We are aiming to not need to make the installation documentation + Turing-complete. + + ``pyenv`` will work fine. However, if you use ``pyvenv`` instead, you'll + need to understand how to install software such as ``distribute`` into the + virtual environment manually, which this guide does not cover. .. code-block:: text -- cgit v1.2.3 From fb30e2cb79490f9dcafaea3d5ce2c0af140eae71 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 22 Nov 2012 13:28:41 -0500 Subject: typos --- docs/narr/install.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 663f0df6c..882e76f11 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -253,9 +253,10 @@ your setuptools-enabled Python interpreter, use the ``easy_install`` command. systems. We are aiming to not need to make the installation documentation Turing-complete. - ``pyenv`` will work fine. However, if you use ``pyvenv`` instead, you'll - need to understand how to install software such as ``distribute`` into the - virtual environment manually, which this guide does not cover. + ``pyvenv`` will work fine. However, if you use ``pyvenv`` instead of + ``virtualenv``, you'll need to understand how to install software such as + ``distribute`` into the virtual environment manually, which this guide does + not cover. .. code-block:: text -- cgit v1.2.3 From d85569e38ba88029864b7908dbee3f948b103712 Mon Sep 17 00:00:00 2001 From: Patricio Paez Date: Thu, 29 Nov 2012 22:10:38 -0600 Subject: Sync MyProject files with the starter scaffold - Line numbers are mentioned only in the Creating a Pyramid Project chapter; those that are affected were updated. --- docs/narr/MyProject/myproject/__init__.py | 1 + docs/narr/MyProject/myproject/tests.py | 1 + docs/narr/MyProject/myproject/views.py | 3 ++- docs/narr/MyProject/setup.py | 6 +++--- docs/narr/project.rst | 14 +++++++------- 5 files changed, 14 insertions(+), 11 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py index 31b02cf02..6c512f52f 100644 --- a/docs/narr/MyProject/myproject/__init__.py +++ b/docs/narr/MyProject/myproject/__init__.py @@ -1,5 +1,6 @@ from pyramid.config import Configurator + def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py index d8b764041..64dcab1d5 100644 --- a/docs/narr/MyProject/myproject/tests.py +++ b/docs/narr/MyProject/myproject/tests.py @@ -2,6 +2,7 @@ import unittest from pyramid import testing + class ViewTests(unittest.TestCase): def setUp(self): self.config = testing.setUp() diff --git a/docs/narr/MyProject/myproject/views.py b/docs/narr/MyProject/myproject/views.py index f571a5976..c383c5716 100644 --- a/docs/narr/MyProject/myproject/views.py +++ b/docs/narr/MyProject/myproject/views.py @@ -1,5 +1,6 @@ from pyramid.view import view_config + @view_config(route_name='home', renderer='templates/mytemplate.pt') def my_view(request): - return {'project':'MyProject'} + return {'project': 'MyProject'} diff --git a/docs/narr/MyProject/setup.py b/docs/narr/MyProject/setup.py index b119a954b..f24b6984e 100644 --- a/docs/narr/MyProject/setup.py +++ b/docs/narr/MyProject/setup.py @@ -15,10 +15,10 @@ requires = [ setup(name='MyProject', version='0.0', description='MyProject', - long_description=README + '\n\n' + CHANGES, + long_description=README + '\n\n' + CHANGES, classifiers=[ "Programming Language :: Python", - "Framework :: Pylons", + "Framework :: Pyramid", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", ], @@ -32,7 +32,7 @@ setup(name='MyProject', install_requires=requires, tests_require=requires, test_suite="myproject", - entry_points = """\ + entry_points="""\ [paste.app_factory] main = myproject:main """, diff --git a/docs/narr/project.rst b/docs/narr/project.rst index b08948e43..fb62f4bd2 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -829,25 +829,25 @@ also informs Python that the directory which contains it is a *package*. #. Line 1 imports the :term:`Configurator` class from :mod:`pyramid.config` that we use later. -#. Lines 3-10 define a function named ``main`` that returns a :app:`Pyramid` +#. Lines 4-11 define a function named ``main`` that returns a :app:`Pyramid` WSGI application. This function is meant to be called by the :term:`PasteDeploy` framework as a result of running ``pserve``. Within this function, application configuration is performed. - Line 6 creates an instance of a :term:`Configurator`. + Line 7 creates an instance of a :term:`Configurator`. - Line 7 registers a static view, which will serve up the files from the + Line 8 registers a static view, which will serve up the files from the ``myproject:static`` :term:`asset specification` (the ``static`` directory of the ``myproject`` package). - Line 8 adds a :term:`route` to the configuration. This route is later + Line 9 adds a :term:`route` to the configuration. This route is later used by a view in the ``views`` module. - Line 9 calls ``config.scan()``, which picks up view registrations declared + Line 10 calls ``config.scan()``, which picks up view registrations declared elsewhere in the package (in this case, in the ``views.py`` module). - Line 10 returns a :term:`WSGI` application to the caller of the function + Line 11 returns a :term:`WSGI` application to the caller of the function (Pyramid's pserve). .. index:: @@ -865,7 +865,7 @@ and which returns a :term:`response`. :language: python :linenos: -Lines 3-5 define and register a :term:`view callable` named ``my_view``. The +Lines 4-6 define and register a :term:`view callable` named ``my_view``. The function named ``my_view`` is decorated with a ``view_config`` decorator (which is processed by the ``config.scan()`` line in our ``__init__.py``). The view_config decorator asserts that this view be found when a -- cgit v1.2.3 From 76aa5150d5ba25386817d06e0777c8891c7ef3a1 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Sat, 22 Dec 2012 21:19:49 +0100 Subject: Typo pakage => package --- docs/narr/urldispatch.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index ecf3d026a..480b0e0cc 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -86,7 +86,7 @@ setup code. However, the above :term:`scan` execution ``config.scan('mypackage')`` will pick up all :term:`configuration decoration`, including any objects decorated with the :class:`pyramid.view.view_config` decorator in the ``mypackage`` Python -pakage. For example, if you have a ``views.py`` in your package, a scan will +package. For example, if you have a ``views.py`` in your package, a scan will pick up any of its configuration decorators, so we can add one there that that references ``myroute`` as a ``route_name`` parameter: -- cgit v1.2.3 From 10bf7ee0e6eba03e693a15c68048c7568dbba3ec Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 29 Dec 2012 07:43:35 +0200 Subject: typo --- docs/narr/firstapp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst index ccaa6e9e2..0b85d68d3 100644 --- a/docs/narr/firstapp.rst +++ b/docs/narr/firstapp.rst @@ -228,7 +228,7 @@ listens only on the ``127.0.0.1`` interface, which is problematic if you're running the server on a remote system and you wish to access it with a web browser from a local system. We also specify a TCP port number to listen on, which is 8080, passing it as the second argument. The final argument is the -``app`` object (a :term:`router`), which is the the application we wish to +``app`` object (a :term:`router`), which is the application we wish to serve. Finally, we call the server's ``serve_forever`` method, which starts the main loop in which it will wait for requests from the outside world. -- cgit v1.2.3 From f71723d2499ac2db1a82b8f74198b72b9012ab52 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 1 Jan 2013 00:48:38 +0200 Subject: typo --- docs/narr/viewconfig.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index 6373a8d26..799de768f 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -986,7 +986,7 @@ there's a ``should_cache`` GET or POST variable: Note that the ``http_cache`` machinery will overwrite or add to caching headers you set within the view itself unless you use ``prevent_auto``. -You can also turn of the effect of ``http_cache`` entirely for the duration +You can also turn off the effect of ``http_cache`` entirely for the duration of a Pyramid application lifetime. To do so, set the ``PYRAMID_PREVENT_HTTP_CACHE`` environment variable or the ``pyramid.prevent_http_cache`` configuration value setting to a true value. -- cgit v1.2.3 From b27d66f81274625446c301c2675638b36b5e16b3 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 1 Jan 2013 20:12:47 +0200 Subject: fix #746: explain why a dev package is installed --- docs/narr/install.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 882e76f11..c9cdb745a 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -52,6 +52,10 @@ command: $ sudo apt-get install python2.7-dev +This command will install both the Python interpreter and its header files. +Note that these headers are required by some dependencies you will use +in this docomentation, not by Pyramid itself. + Once these steps are performed, the Python interpreter will usually be invokable via ``python2.7`` from a shell prompt. -- cgit v1.2.3 From 78bacaa69f63fe2bc6980d7d40fc0523d5af9199 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 1 Jan 2013 21:52:33 +0200 Subject: typos --- docs/narr/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 882e76f11..09c37c7f2 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -167,10 +167,10 @@ installed: Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. - >>> import setutptools + >>> import setuptools Traceback (most recent call last): File "", line 1, in - ImportError: No module named setutptools + ImportError: No module named setuptools >>> If ``import setuptools`` raises an :exc:`ImportError` as it does above, you -- cgit v1.2.3 From 78bba61a7a53949529c1b7444fd6611e116b725d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 1 Jan 2013 23:34:09 +0200 Subject: improve wording regarding pyvenv --- docs/narr/install.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 882e76f11..8a8513348 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -245,18 +245,19 @@ your setuptools-enabled Python interpreter, use the ``easy_install`` command. .. warning:: - Even though Python 3.3 and better comes with ``pyvenv`` out of the box, - which is similar to ``virtualenv``, we suggest using ``virtualenv`` instead. - ``virtualenv`` works on well Python 3.3. This isn't a recommendation made - for technical reasons, it's one made because it's not feasible for the + Python 3.3 includes ``pyvenv`` out of the box, which provides similar + functionality to ``virtualenv``. + We however suggest using ``virtualenv`` instead, + which works well with Python 3.3. + This isn't a recommendation made for technical reasons; + it's made because it's not feasible for the authors of this guide to explain setup using multiple virtual environment systems. We are aiming to not need to make the installation documentation Turing-complete. - ``pyvenv`` will work fine. However, if you use ``pyvenv`` instead of - ``virtualenv``, you'll need to understand how to install software such as - ``distribute`` into the virtual environment manually, which this guide does - not cover. + If you insist on using ``pyvenv``, you'll need to understand how to install + software such as``distribute`` into the virtual environment manually, + which this guide does not cover. .. code-block:: text -- cgit v1.2.3 From 08c2217e7f831379016e1ddee0b5d51eeca53878 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 1 Jan 2013 23:56:02 +0200 Subject: eliminate repeated "the" words --- docs/narr/assets.rst | 2 +- docs/narr/commandline.rst | 2 +- docs/narr/hybrid.rst | 2 +- docs/narr/renderers.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index e8e915297..7b620548d 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -252,7 +252,7 @@ static assets that live *outside* the :app:`Pyramid` application. This will happen when the :meth:`~pyramid.config.Configurator.add_static_view` API associated with the path fed to :meth:`~pyramid.request.Request.static_url` is a *URL* instead of a view name. For example, the ``name`` argument may be -``http://example.com`` while the the ``path`` given may be +``http://example.com`` while the ``path`` given may be ``mypackage:images``: .. code-block:: python diff --git a/docs/narr/commandline.rst b/docs/narr/commandline.rst index 3bdf8c5cd..8d6b9d984 100644 --- a/docs/narr/commandline.rst +++ b/docs/narr/commandline.rst @@ -758,7 +758,7 @@ we'll pretend you have a distribution with a package in it named This script uses the Python ``optparse`` module to allow us to make sense out of extra arguments passed to the script. It uses the -:func:`pyramid.paster.bootstrap` function to get information about the the +:func:`pyramid.paster.bootstrap` function to get information about the application defined by a config file, and prints the deployment settings defined in that config file. diff --git a/docs/narr/hybrid.rst b/docs/narr/hybrid.rst index ab1bf20bb..1773a6b8c 100644 --- a/docs/narr/hybrid.rst +++ b/docs/narr/hybrid.rst @@ -477,7 +477,7 @@ Registering a Default View for a Route That Has a ``view`` Attribute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. warning:: As of :app:`Pyramid` 1.1 this section is slated to be removed in - a later documentation release because the the ability to add views + a later documentation release because the ability to add views directly to the :term:`route configuration` by passing a ``view`` argument to ``add_route`` has been deprecated. diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index 1158d2225..9017156a6 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -366,7 +366,7 @@ For example (Javascript): '&callback=?'; jqhxr = $.getJSON(api_url); -The string ``callback=?`` above in the the ``url`` param to the JQuery +The string ``callback=?`` above in the ``url`` param to the JQuery ``getAjax`` function indicates to jQuery that the query should be made as a JSONP request; the ``callback`` parameter will be automatically filled in for you and used. -- cgit v1.2.3 From 043ccddb909327106264d10ed5d413760a51770d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 2 Jan 2013 02:22:52 +0200 Subject: eliminate other repeated words --- docs/narr/extconfig.rst | 2 +- docs/narr/hooks.rst | 2 +- docs/narr/i18n.rst | 2 +- docs/narr/introspector.rst | 2 +- docs/narr/renderers.rst | 2 +- docs/narr/subrequest.rst | 2 +- docs/narr/templates.rst | 2 +- docs/narr/urldispatch.rst | 4 ++-- docs/narr/views.rst | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/extconfig.rst b/docs/narr/extconfig.rst index 5e7fe2753..875bc9006 100644 --- a/docs/narr/extconfig.rst +++ b/docs/narr/extconfig.rst @@ -289,7 +289,7 @@ The ``title`` is a human-consumable string that can be used by introspection system frontends to show a friendly summary of this introspectable. The ``type_name`` is a value that can be used to subtype this introspectable -within its category for for sorting and presentation purposes. It can be any +within its category for sorting and presentation purposes. It can be any value. An introspectable is also dictionary-like. It can contain any set of diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst index ea75e5fe4..b5efc0df1 100644 --- a/docs/narr/hooks.rst +++ b/docs/narr/hooks.rst @@ -1082,7 +1082,7 @@ entirely by the relative ordering of calls to :meth:`pyramid.config.Configurator.add_tween`. However, the caller of add_tween can provide an optional hint that can influence the implicit tween chain ordering by supplying ``under`` or ``over`` (or both) arguments to -:meth:`~pyramid.config.Configurator.add_tween`. These hints are only used +:meth:`~pyramid.config.Configurator.add_tween`. These hints are only used when an explicit tween ordering is not used. See :ref:`explicit_tween_ordering` for a description of how to set an explicit tween ordering. diff --git a/docs/narr/i18n.rst b/docs/narr/i18n.rst index e261f9a11..511464322 100644 --- a/docs/narr/i18n.rst +++ b/docs/narr/i18n.rst @@ -301,7 +301,7 @@ You need to add a few boilerplate lines to your application's ``setup.py`` file in order to properly generate :term:`gettext` files from your application. -.. note:: See :ref:`project_narr` to learn about about the +.. note:: See :ref:`project_narr` to learn about the composition of an application's ``setup.py`` file. In particular, add the ``Babel`` and ``lingua`` distributions to the diff --git a/docs/narr/introspector.rst b/docs/narr/introspector.rst index bd81fb56a..7784e8960 100644 --- a/docs/narr/introspector.rst +++ b/docs/narr/introspector.rst @@ -496,7 +496,7 @@ introspectables in categories not described here. ``translation directories`` Each introspectable in the ``asset overrides`` category represents an - individual element in a ``specs`` argument passed to to + individual element in a ``specs`` argument passed to :meth:`pyramid.config.Configurator.add_translation_dirs`; each will have the following data. diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index 9017156a6..ecf625251 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -264,7 +264,7 @@ will be the active request object at render time. # [{"x": 1}, {"x": 2}] If you aren't the author of the objects being serialized, it won't be -possible (or at least not reasonable) to add a custom ``__json__`` method to +possible (or at least not reasonable) to add a custom ``__json__`` method to their classes in order to influence serialization. If the object passed to the renderer is not a serializable type, and has no ``__json__`` method, usually a :exc:`TypeError` will be raised during serialization. You can diff --git a/docs/narr/subrequest.rst b/docs/narr/subrequest.rst index 89551ab35..b5bc5ec48 100644 --- a/docs/narr/subrequest.rst +++ b/docs/narr/subrequest.rst @@ -142,7 +142,7 @@ generated. We can change this behavior; how to do so is described below in our discussion of the ``use_tweens`` argument. The :meth:`pyramid.request.Request.invoke_subrequest` API accepts two -arguments: a positional argument ``request`` that must be provided, and and +arguments: a positional argument ``request`` that must be provided, and ``use_tweens`` keyword argument that is optional; it defaults to ``False``. The ``request`` object passed to the API must be an object that implements diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index ba72ebfbf..1cec26fbc 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -109,7 +109,7 @@ supply the renderer with more correct system values (see to compose proper system values is present in the request. If your template relies on the name ``request`` or ``context``, or if you've configured special :term:`renderer globals`, make sure to pass -``request`` as a keyword argument in every call to to a +``request`` as a keyword argument in every call to a ``pyramid.renderers.render_*`` function. Every view must return a :term:`response` object, except for views diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 480b0e0cc..46f908b7c 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -87,7 +87,7 @@ setup code. However, the above :term:`scan` execution decoration`, including any objects decorated with the :class:`pyramid.view.view_config` decorator in the ``mypackage`` Python package. For example, if you have a ``views.py`` in your package, a scan will -pick up any of its configuration decorators, so we can add one there that +pick up any of its configuration decorators, so we can add one there that references ``myroute`` as a ``route_name`` parameter: .. code-block:: python @@ -860,7 +860,7 @@ exactly the same job: request into a ``GET``, losing any ``POST`` data in the original request. -See :ref:`view_module` and :ref:`changing_the_notfound_view` for for a more +See :ref:`view_module` and :ref:`changing_the_notfound_view` for a more general description of how to configure a view and/or a not found view. .. index:: diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 07d018127..4f30bb7fa 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -180,7 +180,7 @@ All classes documented in the :mod:`pyramid.httpexceptions` module documented as inheriting from the :class:`pyramid.httpexceptions.HTTPException` are :term:`http exception` objects. Instances of an HTTP exception object may either be *returned* or *raised* from within view code. In either case -(return or raise) the instance will be used as as the view's response. +(return or raise) the instance will be used as the view's response. For example, the :class:`pyramid.httpexceptions.HTTPUnauthorized` exception can be raised. This will cause a response to be generated with a ``401 -- cgit v1.2.3 From 638ce950df1c8c8393c44a578270480f86dd060c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 1 Jan 2013 21:11:38 -0500 Subject: fix rationale and typo --- docs/narr/install.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index c9cdb745a..a1c7b0d64 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -52,9 +52,9 @@ command: $ sudo apt-get install python2.7-dev -This command will install both the Python interpreter and its header files. -Note that these headers are required by some dependencies you will use -in this docomentation, not by Pyramid itself. +This command will install both the Python interpreter and its development +header files. Note that the headers are required by some (optional) C +extensions in software depended upon by Pyramid, not by Pyramid itself. Once these steps are performed, the Python interpreter will usually be invokable via ``python2.7`` from a shell prompt. -- cgit v1.2.3 From 00d83a42a4499a1a94d9019b740cc477270960cf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 1 Jan 2013 21:23:12 -0500 Subject: reflow, typo --- docs/narr/install.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 8947a891f..6db0d88f5 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -250,17 +250,15 @@ your setuptools-enabled Python interpreter, use the ``easy_install`` command. .. warning:: Python 3.3 includes ``pyvenv`` out of the box, which provides similar - functionality to ``virtualenv``. - We however suggest using ``virtualenv`` instead, - which works well with Python 3.3. - This isn't a recommendation made for technical reasons; - it's made because it's not feasible for the - authors of this guide to explain setup using multiple virtual environment - systems. We are aiming to not need to make the installation documentation + functionality to ``virtualenv``. We however suggest using ``virtualenv`` + instead, which works well with Python 3.3. This isn't a recommendation made + for technical reasons; it's made because it's not feasible for the authors + of this guide to explain setup using multiple virtual environment systems. + We are aiming to not need to make the installation documentation Turing-complete. If you insist on using ``pyvenv``, you'll need to understand how to install - software such as``distribute`` into the virtual environment manually, + software such as ``distribute`` into the virtual environment manually, which this guide does not cover. .. code-block:: text -- cgit v1.2.3 From f65e191ed7da0ff97638879cf854c0b1cb505aaa Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 2 Jan 2013 23:09:40 +0200 Subject: typos --- docs/narr/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index b35c61720..956d7a177 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -101,7 +101,7 @@ frameworks for small and large applications is just false; a well-designed framework should be able to be good at both. Pyramid strives to be that kind of framework. -To this end, Pyramid provides a set of features, that, combined, are unique +To this end, Pyramid provides a set of features that, combined, are unique amongst Python web frameworks. Lots of other frameworks contain some combination of these features; Pyramid of course actually stole many of them from those other frameworks. But Pyramid is the only one that has all of -- cgit v1.2.3 From 73ea91b1e3859e412252a8d3263389147a05223e Mon Sep 17 00:00:00 2001 From: Reed O'Brien Date: Sun, 6 Jan 2013 13:24:50 -0500 Subject: fix import typo in docs --- docs/narr/viewconfig.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index 799de768f..f00dae451 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -834,7 +834,7 @@ decorator on the RESTView class: .. code-block:: python :linenos: - from pyramid.view import view_config + from pyramid.view import view_defaults from pyramid.response import Response from pyramid.config import Configurator -- cgit v1.2.3 From a03b29ccc094537fa0d80b2545a9d16fc94566cb Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 8 Jan 2013 00:50:24 +0200 Subject: typos --- docs/narr/introduction.rst | 2 +- docs/narr/upgrading.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index b35c61720..187b81702 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -475,7 +475,7 @@ per route. For example, you can create a route with the pattern ``/items`` and when the route is matched, you can shuffle off the request to one view if the request method is GET, another view if the request method is POST, etc. A system known as "view predicates" allows for this. Request method matching -is the very most basic thing you can do with a view predicate. You can also +is the most basic thing you can do with a view predicate. You can also associate views with other request parameters such as the elements in the query string, the Accept header, whether the request is an XHR request or not, and lots of other things. This feature allows you to keep your diff --git a/docs/narr/upgrading.rst b/docs/narr/upgrading.rst index 839f59c35..20487b448 100644 --- a/docs/narr/upgrading.rst +++ b/docs/narr/upgrading.rst @@ -206,7 +206,7 @@ information. Upgrading to the Very Latest Pyramid Release -------------------------------------------- -When you upgrade your application to the very most recent Pyramid release, +When you upgrade your application to the most recent Pyramid release, it's advisable to upgrade step-wise through each most recent minor release, beginning with the one that you know your application currently runs under, and ending on the most recent release. For example, if your application is -- cgit v1.2.3 From 22ed77d69b0f2348983be0c4e8758a44cf160671 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 9 Jan 2013 02:30:47 +0200 Subject: take advantage of the -c option of Python --- docs/narr/install.rst | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index ff89553ae..a78c1b2bd 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -150,32 +150,21 @@ To set up a virtualenv in which to install :app:`Pyramid`, first ensure that ``import setuptools`` within the Python interpreter you'd like to run :app:`Pyramid` under. -Here's the output you'll expect if setuptools or distribute is already -installed: +The following command will not display anything if setuptools or distribute is +already installed: .. code-block:: text - [chrism@thinko docs]$ python2.7 - Python 2.7.3 (default, Aug 1 2012, 05:14:39) - [GCC 4.6.3] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - >>> import setuptools - >>> + $ python2.7 -c 'import setuptools' -Here's the output you can expect if setuptools or distribute is not already -installed: +Running the same command will yield the following output if setuptools or +distribute is not yet installed: .. code-block:: text - [chrism@thinko docs]$ python2.7 - Python 2.7.3 (default, Aug 1 2012, 05:14:39) - [GCC 4.6.3] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - >>> import setuptools Traceback (most recent call last): File "", line 1, in ImportError: No module named setuptools - >>> If ``import setuptools`` raises an :exc:`ImportError` as it does above, you will need to install setuptools or distribute manually. Note that above -- cgit v1.2.3 From 8109ae8ef7e04135a4724963951983ee260293a7 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 13 Jan 2013 22:45:36 +0200 Subject: typo; should be 'titled', but would be redundant --- docs/narr/advconfig.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/advconfig.rst b/docs/narr/advconfig.rst index ad22a82c9..7caea28b8 100644 --- a/docs/narr/advconfig.rst +++ b/docs/narr/advconfig.rst @@ -417,7 +417,7 @@ added in configuration execution order. More Information ---------------- -For more information, see the article entitled `"A Whirlwind Rour of Advanced +For more information, see the article `"A Whirlwind Tour of Advanced Configuration Tactics" `_ in the Pyramid Cookbook. -- cgit v1.2.3 From b00f1e46f100d8a23041a1bb7a7b37b026170fe3 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Mon, 14 Jan 2013 08:50:51 -0500 Subject: Punctuate. --- docs/narr/advconfig.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/advconfig.rst b/docs/narr/advconfig.rst index 7caea28b8..ba43f3ea6 100644 --- a/docs/narr/advconfig.rst +++ b/docs/narr/advconfig.rst @@ -417,7 +417,7 @@ added in configuration execution order. More Information ---------------- -For more information, see the article `"A Whirlwind Tour of Advanced +For more information, see the article,`"A Whirlwind Tour of Advanced Configuration Tactics" -`_ +`_, in the Pyramid Cookbook. -- cgit v1.2.3 From 8e5b2d196a1d7825ecd59a39709ef0dbd2c134e1 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 16 Jan 2013 00:39:52 +0200 Subject: improve flow --- docs/narr/firstapp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst index 0b85d68d3..9aea50185 100644 --- a/docs/narr/firstapp.rst +++ b/docs/narr/firstapp.rst @@ -200,7 +200,7 @@ and various other configuration settings have been performed). The be used by any WSGI server to present an application to a requestor. :term:`WSGI` is a protocol that allows servers to talk to Python applications. We don't discuss :term:`WSGI` in any depth within this book, -however, you can learn more about it by visiting `wsgi.org +but you can learn more about it by visiting `wsgi.org `_. The :app:`Pyramid` application object, in particular, is an instance of a -- cgit v1.2.3 From 362d8b0548410e7ab3e28d0d420342121496a1d2 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 16 Jan 2013 00:44:45 +0200 Subject: improve flow --- docs/narr/firstapp.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst index 0b85d68d3..45cb917f7 100644 --- a/docs/narr/firstapp.rst +++ b/docs/narr/firstapp.rst @@ -194,8 +194,8 @@ WSGI Application Creation After configuring views and ending configuration, the script creates a WSGI *application* via the :meth:`pyramid.config.Configurator.make_wsgi_app` method. A call to ``make_wsgi_app`` implies that all configuration is -finished (meaning all method calls to the configurator which set up views, -and various other configuration settings have been performed). The +finished (meaning all method calls to the configurator, which sets up views +and various other configuration settings, have been performed). The ``make_wsgi_app`` method returns a :term:`WSGI` application object that can be used by any WSGI server to present an application to a requestor. :term:`WSGI` is a protocol that allows servers to talk to Python -- cgit v1.2.3 From 7e10cd0fd38bdeeba988e6ecf1b6179a0086559c Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 17 Jan 2013 22:06:50 +0200 Subject: miscellaneous doc improvements * the word "system" can be misleading, so use a clearer choice of words * reduce repetition * mention Debian, since it is similar to Ubuntu, and is major enough * it is now "Ubuntu", not "Ubuntu Linux" --- docs/narr/install.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index a78c1b2bd..6653243d5 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -40,13 +40,11 @@ UNIX system that has development tools. Package Manager Method ++++++++++++++++++++++ -You can use your system's "package manager" to install Python. Every -system's package manager is slightly different, but the "flavor" of +You can use your system's "package manager" to install Python. +Each package manager is slightly different, but the "flavor" of them is usually the same. -For example, on an Ubuntu Linux system, to use the system package -manager to install a Python 2.7 interpreter, use the following -command: +For example, on a Debian or Ubuntu system, use the following command: .. code-block:: text -- cgit v1.2.3 From b31e5c9c46f4d87177b114f50328a8b0b39908be Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 17 Jan 2013 22:30:25 +0200 Subject: fix #747 --- docs/narr/install.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index a78c1b2bd..19c144156 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -70,7 +70,8 @@ Python interpreter to develop your software. The authors of :app:`Pyramid` tend not to use the system Python for development purposes; always a self-compiled one. Compiling Python is usually easy, and often the "system" Python is compiled with options that -aren't optimal for web development. +aren't optimal for web development. For an explanation, see +https://github.com/Pylons/pyramid/issues/747. To compile software on your UNIX system, typically you need development tools. Often these can be installed via the package -- cgit v1.2.3 From e241c7e479b411a7f465b0a3d86021301702f8af Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 18 Jan 2013 23:58:04 +0200 Subject: make example links clickable, for convenience --- docs/narr/firstapp.rst | 2 +- docs/narr/urldispatch.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst index 0b85d68d3..50aa02692 100644 --- a/docs/narr/firstapp.rst +++ b/docs/narr/firstapp.rst @@ -40,7 +40,7 @@ On Windows: This command will not return and nothing will be printed to the console. When port 8080 is visited by a browser on the URL ``/hello/world``, the server will simply serve up the text "Hello world!". If your application is -running on your local system, using ``http://localhost:8080/hello/world`` +running on your local system, using ``_ in a browser will show this result. Each time you visit a URL served by the application in a browser, a logging diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 46f908b7c..ec97bf3b2 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -38,7 +38,7 @@ application. A route has a *name*, which acts as an identifier to be used for URL generation. The name also allows developers to associate a view configuration with the route. A route also has a *pattern*, meant to match against the ``PATH_INFO`` portion of a URL (the portion following the scheme -and port, e.g. ``/foo/bar`` in the URL ``http://localhost:8080/foo/bar``). It +and port, e.g. ``/foo/bar`` in the URL ``_). It also optionally has a ``factory`` and a set of :term:`route predicate` attributes. -- cgit v1.2.3 From 1e7d75e55428127865cd8bf18576fd71bdf7e5ee Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 21 Jan 2013 00:03:25 +0200 Subject: fix typos --- docs/narr/renderers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index ecf625251..5379a4a99 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -823,8 +823,8 @@ sets an ``override_renderer`` attribute on the request itself, which is the .. code-block:: python :linenos: - from pyramid.event import subscriber - from pyramid.event import NewRequest + from pyramid.events import subscriber + from pyramid.events import NewRequest @subscriber(NewRequest) def set_xmlrpc_params(event): -- cgit v1.2.3 From 2b126ef15ee7d8457592faea02f837cf2a6062d4 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 22 Jan 2013 07:51:49 +0200 Subject: consistency fixes --- docs/narr/renderers.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index 5379a4a99..794e3cffa 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -73,13 +73,13 @@ which renders view return values to a :term:`JSON` response serialization. Other built-in renderers include renderers which use the :term:`Chameleon` templating language to render a dictionary to a response. Additional -renderers can be added by developers to the system as necessary (see -:ref:`adding_and_overriding_renderers`). +renderers can be added by developers to the system as necessary. +See :ref:`adding_and_overriding_renderers`. Views which use a renderer and return a non-Response value can vary non-body response attributes (such as headers and the HTTP status code) by attaching a -property to the ``request.response`` attribute See -:ref:`request_response_attr`. +property to the ``request.response`` attribute. +See :ref:`request_response_attr`. If the :term:`view callable` associated with a :term:`view configuration` returns a Response object directly, any renderer associated with the view -- cgit v1.2.3 From b515ddcf759ebe267b9ee74a1d5af72da8639ae0 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 23 Jan 2013 21:56:28 +0200 Subject: displaying line numbers for 1-line snippets is overkill --- docs/narr/renderers.rst | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index 794e3cffa..5391a6669 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -63,7 +63,6 @@ the ``renderer`` attribute. For example, this call to with a view callable: .. code-block:: python - :linenos: config.add_view('myproject.views.my_view', renderer='json') @@ -166,7 +165,6 @@ The body of the response returned by such a view will be a string representing the ``str()`` serialization of the return value: .. code-block:: python - :linenos: {'content': 'Hello!'} @@ -204,7 +202,6 @@ The body of the response returned by such a view will be a string representing the JSON serialization of the return value: .. code-block:: python - :linenos: '{"content": "Hello!"}' @@ -619,7 +616,6 @@ For example, to add a renderer which renders views which have a ``renderer`` attribute that is a path that ends in ``.jinja2``: .. code-block:: python - :linenos: config.add_renderer('.jinja2', 'mypackage.MyJinja2Renderer') @@ -725,10 +721,8 @@ Here's an example of the registration of a more complicated renderer factory, which expects to be passed a filesystem path: .. code-block:: python - :linenos: - config.add_renderer(name='.jinja2', - factory='my.package.MyJinja2Renderer') + config.add_renderer(name='.jinja2', factory='my.package.MyJinja2Renderer') Adding the above code to your application startup will allow you to use the ``my.package.MyJinja2Renderer`` renderer factory implementation in view @@ -769,7 +763,6 @@ extension for the same kinds of templates. For example, to associate the :meth:`pyramid.config.Configurator.add_renderer` method: .. code-block:: python - :linenos: config.add_renderer('.zpt', 'pyramid.chameleon_zpt.renderer_factory') @@ -781,7 +774,6 @@ rendered via a Chameleon ZPT page template renderer, use a variation on the following in your application's startup code: .. code-block:: python - :linenos: config.add_renderer('.pt', 'mypackage.pt_renderer') @@ -794,7 +786,6 @@ ones which do not possess a ``renderer`` attribute), pass ``None`` as the ``name`` attribute to the renderer tag: .. code-block:: python - :linenos: config.add_renderer(None, 'mypackage.json_renderer_factory') -- cgit v1.2.3 From 5ed0d3df82787f95338a0dffa8c6a56efb28c6ee Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 23 Jan 2013 21:59:46 +0200 Subject: use 'versionadded' Sphinx directive --- docs/narr/renderers.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index 5391a6669..deb0f6ee8 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -291,9 +291,8 @@ with the object. See :class:`pyramid.renderers.JSON` and :ref:`adding_and_overriding_renderers` for more information. -.. note:: - - Serializing custom objects is a feature new in Pyramid 1.4. +.. versionadded:: 1.4 + Serializing custom objects. .. index:: pair: renderer; JSONP @@ -303,9 +302,7 @@ See :class:`pyramid.renderers.JSON` and JSONP Renderer ~~~~~~~~~~~~~~ -.. note:: - - This feature is new in Pyramid 1.1. +.. versionadded:: 1.1 :class:`pyramid.renderers.JSONP` is a `JSONP `_ renderer factory helper which -- cgit v1.2.3 From 2947141248946db191843c5bc1629c60e7ad8f3a Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 23 Jan 2013 22:00:10 +0200 Subject: user 'deprecated' Sphinx directive --- docs/narr/renderers.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index deb0f6ee8..b7d3479dc 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -565,7 +565,8 @@ in :ref:`request_module`. For more information on the API of Deprecated Mechanism to Vary Attributes of Rendered Responses ------------------------------------------------------------- -.. warning:: This section describes behavior deprecated in Pyramid 1.1. +.. deprecated:: 1.1 + The behavior described in this entire section. In previous releases of Pyramid (1.0 and before), the ``request.response`` attribute did not exist. Instead, Pyramid required users to set special -- cgit v1.2.3 From 531a2ad34ab0a806513681cddd5d99e50a31c4c6 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 23 Jan 2013 22:01:56 +0200 Subject: provide a link to the class; lineno for a 1-liner is overkill --- docs/narr/renderers.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index b7d3479dc..863932e83 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -683,12 +683,10 @@ There are essentially two different kinds of renderer factories: :term:`package`. Here's an example of the registration of a simple renderer factory via -:meth:`~pyramid.config.Configurator.add_renderer`: +:meth:`~pyramid.config.Configurator.add_renderer`, where ``config`` +is an instance of :meth:`pyramid.config.Configurator`: .. code-block:: python - :linenos: - - # config is an instance of pyramid.config.Configurator config.add_renderer(name='amf', factory='my.package.MyAMFRenderer') -- cgit v1.2.3 From fdcd1beef58e106b556f6586f4a95e02d6aec1f4 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 28 Jan 2013 08:27:05 +0200 Subject: use a more correct directive --- docs/narr/environment.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/environment.rst b/docs/narr/environment.rst index 8206e0bcb..def5e12a4 100644 --- a/docs/narr/environment.rst +++ b/docs/narr/environment.rst @@ -504,12 +504,13 @@ default, this is ``false``. Mako Preprocessor ~~~~~~~~~~~~~~~~~ +.. versionadded:: 1.1 + A callable (or a :term:`dotted Python name` which names a callable) which is called to preprocess the source before the template is called. The callable will be passed the full template source before it is parsed. The return result of the callable will be used as the template source code. -.. note:: This feature is new in Pyramid 1.1. +-----------------------------+ | Config File Setting Name | -- cgit v1.2.3 From 1c0e0e94b6665ba715236be82cbd2b12b6a0a79f Mon Sep 17 00:00:00 2001 From: Calvin Hendryx-Parker Date: Mon, 28 Jan 2013 17:08:21 -0500 Subject: Update docs/narr/extending.rst Fixed grammatical typo --- docs/narr/extending.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/extending.rst b/docs/narr/extending.rst index c464203f0..dd9281c73 100644 --- a/docs/narr/extending.rst +++ b/docs/narr/extending.rst @@ -84,7 +84,7 @@ function in your application's ``__init__.py``. For example, rather than: config.add_view('myapp.views.view1', name='view1') config.add_view('myapp.views.view2', name='view2') -You should do move the calls to ``add_view`` outside of the (non-reusable) +You should move the calls to ``add_view`` outside of the (non-reusable) ``if __name__ == '__main__'`` block, and into a reusable function: .. code-block:: python -- cgit v1.2.3 From 0a9a29e9391e9b8639de61473bbe4865a6b0551e Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 29 Jan 2013 00:16:29 +0200 Subject: pluralize --- docs/narr/sessions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index f7da7838e..fa4affd8a 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -29,7 +29,7 @@ during your :app:`Pyramid` configuration. A very basic, insecure sample session factory implementation is provided in the :app:`Pyramid` core. It uses a cookie to store session information. This implementation has the following -limitation: +limitations: - The session information in the cookies used by this implementation is *not* encrypted, so it can be viewed by anyone with access to the -- cgit v1.2.3 From 479447a1ebc231096155290f918f563b884a3432 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 29 Jan 2013 01:03:37 +0200 Subject: replace 'note' with the more correct 'versionadded' directive --- docs/narr/urldispatch.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index ec97bf3b2..749a2d49a 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -758,11 +758,8 @@ other non-``name`` and non-``pattern`` arguments to exception to this rule is use of the ``pregenerator`` argument, which is not ignored when ``static`` is ``True``. -.. note:: - - the ``static`` argument to - :meth:`~pyramid.config.Configurator.add_route` is new as of :app:`Pyramid` - 1.1. +.. versionadded:: 1.1 + the ``static`` argument to :meth:`~pyramid.config.Configurator.add_route` .. index:: single: redirecting to slash-appended routes @@ -906,7 +903,7 @@ routes configured in your application; for more information, see Using a Route Prefix to Compose Applications -------------------------------------------- -.. note:: This feature is new as of :app:`Pyramid` 1.2. +.. versionadded:: 1.2 The :meth:`pyramid.config.Configurator.include` method allows configuration statements to be included from separate files. See -- cgit v1.2.3 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/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 +- 7 files changed, 19 insertions(+), 29 deletions(-) (limited to 'docs/narr') 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 -- cgit v1.2.3 From 6821582d7e691b8c068ce80ec067319c65195716 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 30 Jan 2013 01:18:06 +0200 Subject: this obsolete info should have been removed in commit 22ed77d --- docs/narr/install.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 224a62db7..c467779f4 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -166,9 +166,7 @@ distribute is not yet installed: ImportError: No module named setuptools If ``import setuptools`` raises an :exc:`ImportError` as it does above, you -will need to install setuptools or distribute manually. Note that above -we're using a Python 2.7-series interpreter on Mac OS X; your output may -differ if you're using a later Python version or a different platform. +will need to install setuptools or distribute manually. If you are using a "system" Python (one installed by your OS distributor or a 3rd-party packager such as Fink or MacPorts), you can usually install the -- cgit v1.2.3 From 3a6bdf983b51d8d0df124999ae217084c7dddbc6 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 3 Feb 2013 12:38:55 +0200 Subject: use clearer language --- docs/narr/environment.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/environment.rst b/docs/narr/environment.rst index def5e12a4..281bb6919 100644 --- a/docs/narr/environment.rst +++ b/docs/narr/environment.rst @@ -203,7 +203,7 @@ Using the setting is equivalent to using the | | +---------------------------------+ -The value supplied as ``pyramid.includes`` should be a sequence. The +The value assigned to ``pyramid.includes`` should be a sequence. The sequence can take several different forms. 1) It can be a string. @@ -323,7 +323,7 @@ the behest of an add-on author. | | +---------------------------------+ -The value supplied as ``pyramid.tweens`` should be a sequence. The +The value assigned to ``pyramid.tweens`` should be a sequence. The sequence can take several different forms. 1) It can be a string. -- cgit v1.2.3 From 1d3b11ea4c7ce0e05ca80063f997596791f75fda Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 4 Feb 2013 20:53:03 +0200 Subject: fix and shorten broken sentence --- docs/narr/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index c4f2ea512..3540ee5c4 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -749,7 +749,7 @@ that we change Pyramid? You can extend Pyramid's :term:`Configurator` with your own directives. For example, let's say you find yourself calling :meth:`pyramid.config.Configurator.add_view` repetitively. Usually you can take the boring away by using existing shortcuts, but let's say that this is -a case such a way that no existing shortcut works to take the boring away: +a case where there is no such shortcut: .. code-block:: python :linenos: -- cgit v1.2.3 From bd070e77f4183a34507fe6f19604751cb78e3e8c Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 4 Feb 2013 21:15:08 +0200 Subject: unuglify Unix Python installation instructions --- docs/narr/install.rst | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index c467779f4..e18716baa 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -88,17 +88,15 @@ using the following commands: .. code-block:: text - [chrism@vitaminf ~]$ cd ~ - [chrism@vitaminf ~]$ mkdir tmp - [chrism@vitaminf ~]$ mkdir opt - [chrism@vitaminf ~]$ cd tmp - [chrism@vitaminf tmp]$ wget \ - http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz - [chrism@vitaminf tmp]$ tar xvzf Python-2.7.3.tgz - [chrism@vitaminf tmp]$ cd Python-2.7.3 - [chrism@vitaminf Python-2.7.3]$ ./configure \ - --prefix=$HOME/opt/Python-2.7.3 - [chrism@vitaminf Python-2.7.3]$ make; make install + $ cd ~ + $ mkdir tmp + $ mkdir opt + $ cd tmp + $ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz + $ tar xvzf Python-2.7.3.tgz + $ cd Python-2.7.3 + $ ./configure --prefix=$HOME/opt/Python-2.7.3 + $ make && make install Once these steps are performed, the Python interpreter will be invokable via ``$HOME/opt/Python-2.7.3/bin/python`` from a shell -- cgit v1.2.3 From 148c7da017ef775932b2a4baeb0bd3057976adcc Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 4 Feb 2013 21:27:03 +0200 Subject: no need to be so specific This should reduce the frequency of needing to update it. --- docs/narr/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index c467779f4..91e1cae6f 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -14,8 +14,8 @@ run :app:`Pyramid`. .. sidebar:: Python Versions - As of this writing, :app:`Pyramid` has been tested under Python 2.6.8, - Python 2.7.3, Python 3.2.3, and Python 3.3b1. :app:`Pyramid` does not + As of this writing, :app:`Pyramid` has been tested under Python 2.6, + Python 2.7, Python 3.2, and Python 3.3. :app:`Pyramid` does not run under any version of Python before 2.6. :app:`Pyramid` is known to run on all popular UNIX-like systems such as -- cgit v1.2.3 From 37da2cf374792b2ab12ae39be6994540c9dfe623 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Mon, 4 Feb 2013 15:23:46 -0800 Subject: narr/project.rst: Correct IP address 129.168.1.50 -> 192.168.1.50 --- docs/narr/project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/project.rst b/docs/narr/project.rst index fb62f4bd2..5a8ea0ecf 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -297,7 +297,7 @@ For example, your system might be configured to have an external IP address ``192.168.1.50``. If that's the case, if you use a browser running on the same system as Pyramid, it will be able to access the application via ``http://127.0.0.1:6543/`` as well as via -``http://129.168.1.50:6543/``. However, *other people* on other computers on +``http://192.168.1.50:6543/``. However, *other people* on other computers on the same network will also be able to visit your Pyramid application in their browser by visiting ``http://192.168.1.50:6543/``. -- cgit v1.2.3 From cb659d206463607b5387878a857ead770c4df8cc Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 6 Feb 2013 23:25:42 +0200 Subject: displaying lineno for 1-line snippet is overkill --- docs/narr/configuration.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index cd3dab099..820dda269 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -144,7 +144,6 @@ In the example above, the scanner translates the arguments to .. ignore-next-block .. code-block:: python - :linenos: config.add_view(hello) -- cgit v1.2.3 From 6a4c6cb1c6ebe148e948726ddf668a3c2aa6c86c Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 6 Feb 2013 23:38:01 +0200 Subject: no need for a 'topic' directive --- docs/narr/configuration.rst | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index cd3dab099..4370367c0 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -99,29 +99,27 @@ available for a :term:`scan` to find it later. A :term:`scan` of a :term:`module` or a :term:`package` and its subpackages for decorations happens when the :meth:`pyramid.config.Configurator.scan` method is invoked: scanning implies searching for configuration declarations -in a package and its subpackages. For example: - -.. topic:: Starting A Scan - - .. code-block:: python - :linenos: - - from wsgiref.simple_server import make_server - from pyramid.config import Configurator - from pyramid.response import Response - from pyramid.view import view_config - - @view_config() - def hello(request): - return Response('Hello') - - if __name__ == '__main__': - from pyramid.config import Configurator - config = Configurator() - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8080, app) - server.serve_forever() +in a package and its subpackages. For example:: + +.. code-block:: python + :linenos: + + from wsgiref.simple_server import make_server + from pyramid.config import Configurator + from pyramid.response import Response + from pyramid.view import view_config + + @view_config() + def hello(request): + return Response('Hello') + + if __name__ == '__main__': + from pyramid.config import Configurator + config = Configurator() + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 8080, app) + server.serve_forever() The scanning machinery imports each module and subpackage in a package or module recursively, looking for special attributes attached to objects -- cgit v1.2.3 From c7e558156dff1c8fdc96fe0382e48ca4d5bf8205 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 8 Feb 2013 20:48:08 +0200 Subject: fix a Sphinx warning --- docs/narr/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr') diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index cc26c55d9..6f82baf32 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -99,7 +99,7 @@ available for a :term:`scan` to find it later. A :term:`scan` of a :term:`module` or a :term:`package` and its subpackages for decorations happens when the :meth:`pyramid.config.Configurator.scan` method is invoked: scanning implies searching for configuration declarations -in a package and its subpackages. For example:: +in a package and its subpackages. For example: .. code-block:: python :linenos: -- cgit v1.2.3