summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2013-03-12 14:07:44 -0700
committerMichael Merickel <michael@merickel.org>2013-03-12 14:07:44 -0700
commitd3aba32a0a78d367c7ab81a54d86c71330441d7a (patch)
tree55e60ef82f0eca4620fcf57d83e84bd9d61a7389
parentf88ab0e8787d2bc9bba72b47ffbb83b09f0d1a5e (diff)
parentcec2b05e74b3296ab8b54b9644223e08f269808b (diff)
downloadpyramid-d3aba32a0a78d367c7ab81a54d86c71330441d7a.tar.gz
pyramid-d3aba32a0a78d367c7ab81a54d86c71330441d7a.tar.bz2
pyramid-d3aba32a0a78d367c7ab81a54d86c71330441d7a.zip
Merge pull request #896 from tshepang/consistency
consistency fixes
-rw-r--r--CHANGES.txt2
-rw-r--r--docs/glossary.rst4
-rw-r--r--docs/narr/assets.rst2
-rw-r--r--docs/narr/hooks.rst23
-rw-r--r--docs/narr/traversal.rst2
-rw-r--r--docs/narr/urldispatch.rst8
-rw-r--r--docs/narr/viewconfig.rst2
-rw-r--r--docs/whatsnew-1.3.rst2
-rw-r--r--docs/whatsnew-1.4.rst2
-rw-r--r--pyramid/config/views.py6
-rw-r--r--pyramid/httpexceptions.py4
-rw-r--r--pyramid/view.py2
12 files changed, 30 insertions, 29 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index e3b77dedc..85dd3be2a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -511,7 +511,7 @@ Features
- The static view machinery now raises (rather than returns) ``HTTPNotFound``
and ``HTTPMovedPermanently`` exceptions, so these can be caught by the
- NotFound view (and other exception views).
+ Not Found View (and other exception views).
- The Mako renderer now supports a def name in an asset spec. When the def
name is present in the asset spec, the system will render the template def
diff --git a/docs/glossary.rst b/docs/glossary.rst
index cc77e0df3..711994426 100644
--- a/docs/glossary.rst
+++ b/docs/glossary.rst
@@ -617,13 +617,13 @@ Glossary
:term:`configuration decoration` and a :term:`scan` to configure your
Pyramid application.
- Not Found view
+ Not Found View
An :term:`exception view` invoked by :app:`Pyramid` when the developer
explicitly raises a :class:`pyramid.httpexceptions.HTTPNotFound`
exception from within :term:`view` code or :term:`root factory` code,
or when the current request doesn't match any :term:`view
configuration`. :app:`Pyramid` provides a default implementation of a
- not found view; it can be overridden. See
+ Not Found View; it can be overridden. See
:ref:`changing_the_notfound_view`.
Forbidden view
diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst
index 7b620548d..deaf0ce08 100644
--- a/docs/narr/assets.rst
+++ b/docs/narr/assets.rst
@@ -323,7 +323,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:`Not Found 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/narr/hooks.rst b/docs/narr/hooks.rst
index 20cadc996..330eb0cd3 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -19,7 +19,7 @@ found view`, which is a :term:`view callable`. The default Not Found View
can be overridden through application configuration.
If your application uses :term:`imperative configuration`, you can replace
-the Not Found view by using the
+the Not Found View by using the
:meth:`pyramid.config.Configurator.add_notfound_view` method:
.. code-block:: python
@@ -29,7 +29,7 @@ the Not Found view by using the
config.add_notfound_view(notfound)
Replace ``helloworld.views.notfound`` with a reference to the :term:`view
-callable` you want to use to represent the Not Found view. The :term:`not
+callable` you want to use to represent the Not Found View. The :term:`not
found view` callable is a view callable like any other.
If your application instead uses :class:`pyramid.view.view_config` decorators
@@ -51,12 +51,12 @@ and a :term:`scan`, you can replace the Not Found view by using the
This does exactly what the imperative example above showed.
-Your application can define *multiple* not found views if necessary. Both
+Your application can define *multiple* Not Found Views if necessary. Both
:meth:`pyramid.config.Configurator.add_notfound_view` and
:class:`pyramid.view.notfound_view_config` take most of the same arguments as
:class:`pyramid.config.Configurator.add_view` and
-:class:`pyramid.view.view_config`, respectively. This means that not found
-views can carry predicates limiting their applicability. For example:
+:class:`pyramid.view.view_config`, respectively. This means that Not Found
+Views can carry predicates limiting their applicability. For example:
.. code-block:: python
:linenos:
@@ -79,7 +79,7 @@ The ``notfound_get`` view will be called when a view could not be found and
the request method was ``GET``. The ``notfound_post`` view will be called
when a view could not be found and the request method was ``POST``.
-Like any other view, the notfound view must accept at least a ``request``
+Like any other view, the Not Found View must accept at least a ``request``
parameter, or both ``context`` and ``request``. The ``request`` is the
current :term:`request` representing the denied action. The ``context`` (if
used in the call signature) will be the instance of the
@@ -91,7 +91,8 @@ Both :meth:`pyramid.config.Configurator.add_notfound_view` and
redirect requests to slash-appended routes. See
:ref:`redirecting_to_slash_appended_routes` for examples.
-Here's some sample code that implements a minimal NotFound view callable:
+Here's some sample code that implements a minimal :term:`Not Found View`
+callable:
.. code-block:: python
:linenos:
@@ -103,11 +104,11 @@ Here's some sample code that implements a minimal NotFound view callable:
.. note::
- When a NotFound view callable is invoked, it is passed a
+ When a Not Found View callable is invoked, it is passed a
:term:`request`. The ``exception`` attribute of the request will be an
instance of the :exc:`~pyramid.httpexceptions.HTTPNotFound` exception that
- caused the not found view to be called. The value of
- ``request.exception.message`` will be a value explaining why the not found
+ caused the Not Found View to be called. The value of
+ ``request.exception.message`` will be a value explaining why the Not Found
error was raised. This message will be different when the
``pyramid.debug_notfound`` environment setting is true than it is when it
is false.
@@ -122,7 +123,7 @@ Here's some sample code that implements a minimal NotFound view callable:
.. warning::
- When a NotFound view callable accepts an argument list as
+ When a Not Found View callable accepts an argument list as
described in :ref:`request_and_context_view_definitions`, the ``context``
passed as the first argument to the view callable will be the
:exc:`~pyramid.httpexceptions.HTTPNotFound` exception instance. If
diff --git a/docs/narr/traversal.rst b/docs/narr/traversal.rst
index 8e7f93a1b..1234620c2 100644
--- a/docs/narr/traversal.rst
+++ b/docs/narr/traversal.rst
@@ -389,7 +389,7 @@ Using the :term:`view name` (``baz``) and the type, view lookup asks the
Let's say that view lookup finds no matching view type. In this
circumstance, the :app:`Pyramid` :term:`router` returns the result of the
-:term:`not found view` and the request ends.
+:term:`Not Found View` and the request ends.
However, for this tree:
diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst
index 864257a33..a327e937b 100644
--- a/docs/narr/urldispatch.rst
+++ b/docs/narr/urldispatch.rst
@@ -814,7 +814,7 @@ bro." body.
If a request enters the application with the ``PATH_INFO`` value of
``/has_slash/``, the second route will match. If a request enters the
application with the ``PATH_INFO`` value of ``/has_slash``, a route *will* be
-found by the slash-appending not found view. An HTTP redirect to
+found by the slash-appending :term:`Not Found View`. An HTTP redirect to
``/has_slash/`` will be returned to the user's browser. As a result, the
``notfound`` view will never actually be called.
@@ -849,12 +849,12 @@ exactly the same job:
.. warning::
You **should not** rely on this mechanism to redirect ``POST`` requests.
- The redirect of the slash-appending not found view will turn a ``POST``
- request into a ``GET``, losing any ``POST`` data in the original
+ The redirect of the slash-appending :term:`Not Found View` will turn a
+ ``POST`` request into a ``GET``, losing any ``POST`` data in the original
request.
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.
+general description of how to configure a view and/or a :term:`Not Found View`.
.. index::
pair: debugging; route matching
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst
index ad90a5aa7..ed01a1061 100644
--- a/docs/narr/viewconfig.rst
+++ b/docs/narr/viewconfig.rst
@@ -81,7 +81,7 @@ invoked.
If no view can be found with predicates which allow it to be matched up with
the request, :app:`Pyramid` will return an error to the user's browser,
representing a "not found" (404) page. See :ref:`changing_the_notfound_view`
-for more information about changing the default notfound view.
+for more information about changing the default :term:`Not Found View`.
Other view configuration arguments are non-predicate arguments. These tend
to modify the response of the view callable or prevent the view callable from
diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst
index 7277ba7b7..d121413e2 100644
--- a/docs/whatsnew-1.3.rst
+++ b/docs/whatsnew-1.3.rst
@@ -212,7 +212,7 @@ Not Found helpers:
- New API: :meth:`pyramid.config.Configurator.add_notfound_view`. This is a
wrapper for :meth:`pyramid.Config.configurator.add_view` which provides
support for an "append_slash" feature as well as doing the right thing when
- it comes to permissions (a not found view should always be public). It
+ it comes to permissions (a Not Found View should always be public). It
should be preferred over calling ``add_view`` directly with
``context=HTTPNotFound`` as was previously recommended.
diff --git a/docs/whatsnew-1.4.rst b/docs/whatsnew-1.4.rst
index 34fda5f37..f725615f3 100644
--- a/docs/whatsnew-1.4.rst
+++ b/docs/whatsnew-1.4.rst
@@ -108,7 +108,7 @@ Minor Feature Additions
- The static view machinery now raises rather than returns
:class:`pyramid.httpexceptions.HTTPNotFound` and
:class:`pyramid.httpexceptions.HTTPMovedPermanently` exceptions, so these can
- be caught by the notfound view (and other exception views).
+ be caught by the Not Found View (and other exception views).
- When there is a predicate mismatch exception (seen when no view matches for
a given request due to predicates not working), the exception now contains
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 1b89437ea..201ce9899 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -1615,7 +1615,7 @@ class ViewsConfiguratorMixin(object):
append_slash=False,
**predicates
):
- """ Add a default notfound view to the current configuration state.
+ """ Add a default Not Found View to the current configuration state.
The view will be called when Pyramid or application code raises an
:exc:`pyramid.httpexceptions.HTTPForbidden` exception (e.g. when a
view cannot be found for the request). The simplest example is:
@@ -1634,9 +1634,9 @@ class ViewsConfiguratorMixin(object):
:meth:`pyramid.config.Configurator.add_view`, this method will raise
an exception if passed ``name``, ``permission``, ``context``,
``for_``, or ``http_cache`` keyword arguments. These argument values
- make no sense in the context of a notfound view.
+ make no sense in the context of a Not Found View.
- If ``append_slash`` is ``True``, when this notfound view is invoked,
+ If ``append_slash`` is ``True``, when this Not Found View is invoked,
and the current path info does not end in a slash, the notfound logic
will attempt to find a :term:`route` that matches the request's path
info suffixed with a slash. If such a route exists, Pyramid will
diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py
index 4e351bf68..c21a717f8 100644
--- a/pyramid/httpexceptions.py
+++ b/pyramid/httpexceptions.py
@@ -647,8 +647,8 @@ class HTTPNotFound(HTTPClientError):
code: 404, title: Not Found
Raise this exception within :term:`view` code to immediately
- return the :term:`Not Found view` to the invoking user. Usually
- this is a basic ``404`` page, but the Not Found view can be
+ return the :term:`Not Found View` to the invoking user. Usually
+ this is a basic ``404`` page, but the Not Found View can be
customized as necessary. See :ref:`changing_the_notfound_view`.
This exception's constructor accepts a ``detail`` argument
diff --git a/pyramid/view.py b/pyramid/view.py
index cc1854e20..00a68e60f 100644
--- a/pyramid/view.py
+++ b/pyramid/view.py
@@ -340,7 +340,7 @@ class notfound_view_config(object):
argument restricts the set of circumstances under which this notfound
view will be invoked.
- If ``append_slash`` is ``True``, when the notfound view is invoked, and
+ If ``append_slash`` is ``True``, when the Not Found View is invoked, and
the current path info does not end in a slash, the notfound logic will
attempt to find a :term:`route` that matches the request's path info
suffixed with a slash. If such a route exists, Pyramid will issue a