diff options
| author | Steve Piercy <web@stevepiercy.com> | 2018-11-19 02:46:18 -0800 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2018-11-19 02:46:18 -0800 |
| commit | cfaedc5e247af279059ab93fea4c9d7a27ddcf8a (patch) | |
| tree | a51bb45ff3deef9188d2057e76c7a7f6419011bb | |
| parent | f77957109be35d7b93014d5623fae7e670797213 (diff) | |
| download | pyramid-cfaedc5e247af279059ab93fea4c9d7a27ddcf8a.tar.gz pyramid-cfaedc5e247af279059ab93fea4c9d7a27ddcf8a.tar.bz2 pyramid-cfaedc5e247af279059ab93fea4c9d7a27ddcf8a.zip | |
Standardize casing of URL when it is an acronym
| -rw-r--r-- | docs/glossary.rst | 8 | ||||
| -rw-r--r-- | src/pyramid/traversal.py | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/docs/glossary.rst b/docs/glossary.rst index e15d28fa5..2d51bf795 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -165,7 +165,7 @@ Glossary An object representing a node in the :term:`resource tree` of an application. If :term:`traversal` is used, a resource is an element in the resource tree traversed by the system. When traversal is used, a - resource becomes the :term:`context` of a :term:`view`. If :term:`url + resource becomes the :term:`context` of a :term:`view`. If :term:`URL dispatch` is used, a single resource is generated for each request and is used as the context resource of a view. @@ -405,13 +405,13 @@ Glossary the Routes syntax (which was inspired by Ruby On Rails pattern syntax). route - A single pattern matched by the :term:`url dispatch` subsystem, + A single pattern matched by the :term:`URL dispatch` subsystem, which generally resolves to a :term:`root factory` (and then ultimately a :term:`view`). .. seealso:: - See also :term:`url dispatch`. + See also :term:`URL dispatch`. route configuration Route configuration is the act of associating request parameters with a @@ -912,7 +912,7 @@ Glossary :meth:`pyramid.config.Configurator.add_route` and :meth:`pyramid.config.Configurator.add_view` to make it more convenient to register a collection of views as a single class when using - :term:`url dispatch`. View handlers ship as part of the + :term:`URL dispatch`. View handlers ship as part of the :term:`pyramid_handlers` add-on package. Deployment settings diff --git a/src/pyramid/traversal.py b/src/pyramid/traversal.py index 3dc37613e..9ed5754b7 100644 --- a/src/pyramid/traversal.py +++ b/src/pyramid/traversal.py @@ -171,17 +171,17 @@ def traverse(resource, path): A definition of each value in the returned dictionary: - ``context``: The :term:`context` (a :term:`resource` object) found - via traversal or url dispatch. If the ``path`` passed in is the + via traversal or URL dispatch. If the ``path`` passed in is the empty string, the value of the ``resource`` argument passed to this function is returned. - ``root``: The resource object at which :term:`traversal` begins. - If the ``resource`` passed in was found via url dispatch or if the + If the ``resource`` passed in was found via URL dispatch or if the ``path`` passed in was relative (non-absolute), the value of the ``resource`` argument passed to this function is returned. - ``view_name``: The :term:`view name` found during - :term:`traversal` or :term:`url dispatch`; if the ``resource`` was + :term:`traversal` or :term:`URL dispatch`; if the ``resource`` was found via traversal, this is usually a representation of the path segment which directly follows the path to the ``context`` in the ``path``. The ``view_name`` will be a string. The @@ -190,7 +190,7 @@ def traverse(resource, path): example: if the path passed is ``/foo/bar``, and a resource object is found at ``/foo`` (but not at ``/foo/bar``), the 'view name' will be ``'bar'``. If the ``resource`` was found via - url dispatch, the ``view_name`` will be the empty string unless + URL dispatch, the ``view_name`` will be the empty string unless the ``traverse`` predicate was specified or the ``*traverse`` route pattern was used, at which point normal traversal rules dictate the result. @@ -203,7 +203,7 @@ def traverse(resource, path): passed is ``/foo/bar/baz/buz``, and a resource object is found at ``/foo`` (but not ``/foo/bar``), the 'view name' will be ``'bar'`` and the :term:`subpath` will be ``['baz', 'buz']``. - For a ``resource`` found via url dispatch, the subpath will be a + For a ``resource`` found via URL dispatch, the subpath will be a sequence of values discerned from ``*subpath`` in the route pattern matched or the empty sequence. @@ -213,7 +213,7 @@ def traverse(resource, path): were traversed to find the ``context`` object (e.g. if the ``path`` provided is the empty string), the ``traversed`` value will be the empty sequence. If the ``resource`` is a resource found - via :term:`url dispatch`, traversed will be None. + via :term:`URL dispatch`, traversed will be None. - ``virtual_root``: A resource object representing the 'virtual' root of the resource tree being traversed during :term:`traversal`. @@ -232,7 +232,7 @@ def traverse(resource, path): items is a string. If no path segments were traversed to find the ``virtual_root`` resource (e.g. if virtual hosting is not in effect), the ``traversed`` value will be the empty list. - If url dispatch was used to find the ``resource``, this will be + If URL dispatch was used to find the ``resource``, this will be ``None``. If the path cannot be resolved, a :exc:`KeyError` will be raised. |
