summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-05-10 14:02:51 -0400
committerChris McDonough <chrism@plope.com>2011-05-10 14:02:51 -0400
commitcde177a20260c712152f06ed6ad5bdf053e1a3a3 (patch)
treec330ea1fe8fe238044cf286b92ea6896ae2195e5
parent99a32e83826b3f1fae5da0ff26295fa71abe676b (diff)
parent60e7ba931599db835968e5248d31bba6db08a447 (diff)
downloadpyramid-cde177a20260c712152f06ed6ad5bdf053e1a3a3.tar.gz
pyramid-cde177a20260c712152f06ed6ad5bdf053e1a3a3.tar.bz2
pyramid-cde177a20260c712152f06ed6ad5bdf053e1a3a3.zip
Merge branch 'master' of github.com:Pylons/pyramid
-rw-r--r--docs/tutorials/wiki2/authorization.rst7
-rw-r--r--docs/tutorials/wiki2/src/authorization/tutorial/__init__.py2
-rw-r--r--pyramid/config.py16
-rw-r--r--pyramid/traversal.py4
4 files changed, 17 insertions, 12 deletions
diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst
index 19d438fad..b1d3b0001 100644
--- a/docs/tutorials/wiki2/authorization.rst
+++ b/docs/tutorials/wiki2/authorization.rst
@@ -94,8 +94,7 @@ Note that that the
:class:`pyramid.authentication.AuthTktAuthenticationPolicy` constructor
accepts two arguments: ``secret`` and ``callback``. ``secret`` is a string
representing an encryption key used by the "authentication ticket" machinery
-represented by this policy: it is required. The ``callback`` is a string,
-representing a :term:`dotted Python name`, which points at the
+represented by this policy: it is required. The ``callback`` is a
``groupfinder`` function in the current directory's ``security.py`` file. We
haven't added that module yet, but we're about to.
@@ -104,7 +103,7 @@ We'll also change ``__init__.py``, adding a call to
:term:`view callable`. This is also known as a :term:`forbidden view`:
.. literalinclude:: src/authorization/tutorial/__init__.py
- :lines: 24-26,41-43
+ :lines: 41-43
:linenos:
:language: python
@@ -114,7 +113,7 @@ A forbidden view configures our newly created login view to show up when
A ``logout`` :term:`view callable` will allow users to log out later:
.. literalinclude:: src/authorization/tutorial/__init__.py
- :lines: 27-28
+ :lines: 26,34
:linenos:
:language: python
diff --git a/docs/tutorials/wiki2/src/authorization/tutorial/__init__.py b/docs/tutorials/wiki2/src/authorization/tutorial/__init__.py
index e8baa568c..05183d3d4 100644
--- a/docs/tutorials/wiki2/src/authorization/tutorial/__init__.py
+++ b/docs/tutorials/wiki2/src/authorization/tutorial/__init__.py
@@ -27,8 +27,8 @@ def main(global_config, **settings):
config.add_route('view_page', '/{pagename}')
config.add_route('add_page', '/add_page/{pagename}')
config.add_route('edit_page', '/{pagename}/edit_page')
- config.add_route('view_wiki', '/')
+ config.add_view('tutorial.views.view_wiki', route_name='view_wiki')
config.add_view('tutorial.login.login', route_name='login',
renderer='tutorial:templates/login.pt')
config.add_view('tutorial.login.logout', route_name='logout')
diff --git a/pyramid/config.py b/pyramid/config.py
index 9c547d736..9286136cf 100644
--- a/pyramid/config.py
+++ b/pyramid/config.py
@@ -18,6 +18,7 @@ from zope.interface import Interface
from zope.interface import implementedBy
from zope.interface.interfaces import IInterface
from zope.interface import implements
+from zope.interface import classProvides
from pyramid.interfaces import IAuthenticationPolicy
from pyramid.interfaces import IAuthorizationPolicy
@@ -45,6 +46,7 @@ from pyramid.interfaces import ITranslationDirectories
from pyramid.interfaces import ITraverser
from pyramid.interfaces import IView
from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import IViewMapper
from pyramid.interfaces import IViewMapperFactory
from pyramid import renderers
@@ -2019,7 +2021,7 @@ class Configurator(object):
:class:`pyramid.request.Request` class (particularly
``__call__``, and ``blank``).
- .. note:: Using the :meth:``request_factory`` argument to the
+ .. note:: Using the ``request_factory`` argument to the
:class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
@@ -2042,9 +2044,8 @@ class Configurator(object):
dictionary, and therefore will be made available to the code
which uses the renderer.
- .. note:: Using the :meth:`renderer_globals_factory`
- argument to the
- :class:`pyramid.config.Configurator` constructor
+ .. note:: Using the ``renderer_globals_factory`` argument
+ to the :class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
factory = self.maybe_dotted(factory)
@@ -2146,6 +2147,10 @@ class Configurator(object):
Configure the application with a :term:`session factory`. If
this method is called, the ``session_factory`` argument must
be a session factory callable.
+
+ .. note:: Using the ``session_factory`` argument to the
+ :class:`pyramid.config.Configurator` constructor
+ can be used to achieve the same purpose.
"""
def register():
self.registry.registerUtility(session_factory, ISessionFactory)
@@ -2934,7 +2939,8 @@ class ViewDeriver(object):
return decorator(view)
class DefaultViewMapper(object):
- implements(IViewMapperFactory)
+ classProvides(IViewMapperFactory)
+ implements(IViewMapper)
def __init__(self, **kw):
self.attr = kw.get('attr')
diff --git a/pyramid/traversal.py b/pyramid/traversal.py
index 48f8017f6..73f994bda 100644
--- a/pyramid/traversal.py
+++ b/pyramid/traversal.py
@@ -333,14 +333,14 @@ def resource_path_tuple(resource, *elements):
``elements`` will be appended as elements in the tuple
representing the resource path. For instance, if the resource's
path is ``('', 'foo', 'bar')`` and elements equals ``('a', 'b')``,
- the returned tuple will be ``('', 'foo', 'bar', 'a', b')``. The
+ the returned tuple will be ``('', 'foo', 'bar', 'a', 'b')``. The
first element of this tuple will always be the empty string (a
leading empty string element in a path tuple represents that the
path is absolute).
This function is a logical inverse of
:func:`pyramid.traversal.find_resource`: it can be used to
- generate path references that can later be resolved that function.
+ generate path references that can later be resolved by that function.
The ``resource`` passed in *must* be :term:`location`-aware.