summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-12-09 00:09:32 -0500
committerChris McDonough <chrism@plope.com>2010-12-09 00:09:32 -0500
commitaff4437e933d133c866555b71a6ebf3954264aeb (patch)
tree1c6c0ef5364764f261f845a869fcccae5044467b
parent427a02393da7c9ad5198be3c7be870662d229f83 (diff)
downloadpyramid-aff4437e933d133c866555b71a6ebf3954264aeb.tar.gz
pyramid-aff4437e933d133c866555b71a6ebf3954264aeb.tar.bz2
pyramid-aff4437e933d133c866555b71a6ebf3954264aeb.zip
use pyramid.config.Configurator instead of pyramid.configuration.Configurator
-rw-r--r--pyramid/config.py28
-rw-r--r--pyramid/events.py6
-rw-r--r--pyramid/interfaces.py4
-rwxr-xr-xpyramid/paster_templates/alchemy/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/pylons_basic/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/pylons_basic/+package+/tests.py_tmpl4
-rw-r--r--pyramid/paster_templates/pylons_minimal/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/pylons_minimal/+package+/tests.py_tmpl4
-rw-r--r--pyramid/paster_templates/pylons_sqla/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/pylons_sqla/+package+/tests.py_tmpl4
-rw-r--r--pyramid/paster_templates/routesalchemy/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/routesalchemy/+package+/tests.py_tmpl4
-rw-r--r--pyramid/paster_templates/starter/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/starter/+package+/tests.py_tmpl4
-rw-r--r--pyramid/paster_templates/starter_zcml/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/starter_zcml/+package+/tests.py_tmpl4
-rw-r--r--pyramid/paster_templates/zodb/+package+/__init__.py_tmpl3
-rw-r--r--pyramid/paster_templates/zodb/+package+/tests.py_tmpl4
-rw-r--r--pyramid/request.py2
-rw-r--r--pyramid/session.py4
-rw-r--r--pyramid/settings.py4
-rw-r--r--pyramid/static.py2
-rw-r--r--pyramid/testing.py22
-rw-r--r--pyramid/url.py2
-rw-r--r--pyramid/util.py2
-rw-r--r--pyramid/view.py6
-rw-r--r--pyramid/wsgi.py4
-rw-r--r--pyramid/zcml.py4
28 files changed, 75 insertions, 67 deletions
diff --git a/pyramid/config.py b/pyramid/config.py
index d7820cdd1..87981a0f8 100644
--- a/pyramid/config.py
+++ b/pyramid/config.py
@@ -189,7 +189,7 @@ class Configurator(object):
representing a set of :term:`renderer` factories which should be
configured into this application (each tuple representing a set of
positional values that should be passed to
- :meth:`pyramid.configuration.Configurator.add_renderer`). If
+ :meth:`pyramid.config.Configurator.add_renderer`). If
it is not passed, a default set of renderer factories is used.
If ``debug_logger`` is not passed, a default debug logger that
@@ -292,7 +292,7 @@ class Configurator(object):
callable(*args, **kw)
else:
if self._ctx is None:
- self._ctx = self._make_context()
+ self._ctx = self._make_context(self.autocommit)
self._ctx.action(discriminator, callable, args, kw, order)
def _set_settings(self, mapping):
@@ -539,7 +539,7 @@ class Configurator(object):
def unhook_zca(self, getSiteManager=None):
""" Call :func:`zope.component.getSiteManager.reset` to undo
the action of
- :meth:`pyramid.configuration.Configurator.hook_zca`. If
+ :meth:`pyramid.config.Configurator.hook_zca`. If
:mod:`zope.component` cannot be imported, this method will
raise an :exc:`ImportError`."""
if getSiteManager is None: # pragma: no cover
@@ -671,7 +671,7 @@ class Configurator(object):
constructor with one or more 'setting' key/value pairs. A setting is
a single key/value pair in the dictionary-ish object returned from
the API :attr:`pyramid.registry.Registry.settings` and
- :meth:`pyramid.configuration.Configurator.get_settings`.
+ :meth:`pyramid.config.Configurator.get_settings`.
You may pass a dictionary::
@@ -683,7 +683,7 @@ class Configurator(object):
This function is useful when you need to test code that accesses the
:attr:`pyramid.registry.Registry.settings` API (or the
- :meth:`pyramid.configuration.Configurator.get_settings` API) and
+ :meth:`pyramid.config.Configurator.get_settings` API) and
which uses values from that API.
"""
if settings is None:
@@ -699,7 +699,7 @@ class Configurator(object):
Return a 'settings' object for the current application. A
'settings' object is a dictionary-like object that contains
key/value pairs based on the dictionary passed as the ``settings``
- argument to the :class:`pyramid.configuration.Configurator`
+ argument to the :class:`pyramid.config.Configurator`
constructor or the :func:`pyramid.router.make_app` API.
.. note:: For backwards compatibility, dictionary keys can also be
@@ -942,9 +942,9 @@ class Configurator(object):
security and permissions. If ``permission`` is omitted, a
*default* permission may be used for this view registration
if one was named as the
- :class:`pyramid.configuration.Configurator` constructor's
+ :class:`pyramid.config.Configurator` constructor's
``default_permission`` argument, or if
- :meth:`pyramid.configuration.Configurator.set_default_permission`
+ :meth:`pyramid.config.Configurator.set_default_permission`
was used prior to this view registration. Pass the string
``__no_permission_required__`` as the permission argument to
explicitly indicate that the view should always be
@@ -1834,7 +1834,7 @@ class Configurator(object):
The ``renderer`` argument should be the name of (or path to) a
:term:`renderer` used to generate a response for this view
(see the
- :meth:`pyramid.configuration.Configurator.add_view`
+ :meth:`pyramid.config.Configurator.add_view`
method's ``renderer`` argument for information about how a
configurator relates to a renderer).
@@ -1871,7 +1871,7 @@ class Configurator(object):
The ``renderer`` argument should be the name of (or path to) a
:term:`renderer` used to generate a response for this view
(see the
- :meth:`pyramid.configuration.Configurator.add_view`
+ :meth:`pyramid.config.Configurator.add_view`
method's ``renderer`` argument for information about how a
configurator relates to a renderer).
@@ -1898,7 +1898,7 @@ class Configurator(object):
``__call__``, and ``blank``).
.. note:: Using the :meth:``request_factory`` argument to the
- :class:`pyramid.configuration.Configurator` constructor
+ :class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
factory = self.maybe_dotted(factory)
@@ -1922,7 +1922,7 @@ class Configurator(object):
.. note:: Using the :meth:`renderer_globals_factory`
argument to the
- :class:`pyramid.configuration.Configurator` constructor
+ :class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
factory = self.maybe_dotted(factory)
@@ -1946,7 +1946,7 @@ class Configurator(object):
information.
.. note:: Using the ``locale_negotiator`` argument to the
- :class:`pyramid.configuration.Configurator` constructor
+ :class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
negotiator = self.maybe_dotted(negotiator)
@@ -1978,7 +1978,7 @@ class Configurator(object):
See also :ref:`setting_a_default_permission`.
.. note:: Using the ``default_permission`` argument to the
- :class:`pyramid.configuration.Configurator` constructor
+ :class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
# default permission used during view registration
diff --git a/pyramid/events.py b/pyramid/events.py
index b896d985f..f7cb7d706 100644
--- a/pyramid/events.py
+++ b/pyramid/events.py
@@ -51,7 +51,7 @@ class subscriber(object):
.. code-block:: python
- from pyramid.configuration import Configurator
+ from pyramid.config import Configurator
config = Configurator()
config.scan('somepackage_containing_subscribers')
@@ -142,7 +142,7 @@ AfterTraversal = ContextFound # b/c as of 1.0
class ApplicationCreated(object):
""" An instance of this class is emitted as an :term:`event` when
- the :meth:`pyramid.configuration.Configurator.make_wsgi_app` is
+ the :meth:`pyramid.config.Configurator.make_wsgi_app` is
called. The instance has an attribute, ``app``, which is an
instance of the :term:`router` that will handle WSGI requests.
This class implements the
@@ -179,7 +179,7 @@ class BeforeRender(dict):
An object of this type is sent as an event just before a :term:`renderer`
is invoked (but *after* the application-level renderer globals factory
added via
- :class:`pyramid.configuration.Configurator.set_renderer_globals_factory`,
+ :class:`pyramid.config.Configurator.set_renderer_globals_factory`,
if any, has injected its own keys into the renderer globals dictionary).
If a subscriber attempts to add a key that already exist in the renderer
diff --git a/pyramid/interfaces.py b/pyramid/interfaces.py
index f021ba60b..94affd2bb 100644
--- a/pyramid/interfaces.py
+++ b/pyramid/interfaces.py
@@ -33,7 +33,7 @@ class INewResponse(Interface):
class IApplicationCreated(Interface):
""" Event issued when the
- :meth:`pyramid.configuration.Configurator.make_wsgi_app` method
+ :meth:`pyramid.config.Configurator.make_wsgi_app` method
is called. See the documentation attached to
:class:`pyramid.events.ApplicationCreated` for more
information.
@@ -312,7 +312,7 @@ class IRoutePregenerator(Interface):
You can employ a pregenerator by passing a ``pregenerator``
argument to the
- :meth:`pyramid.configuration.Configurator.add_route`
+ :meth:`pyramid.config.Configurator.add_route`
function.
"""
diff --git a/pyramid/paster_templates/alchemy/+package+/__init__.py_tmpl b/pyramid/paster_templates/alchemy/+package+/__init__.py_tmpl
index f6591ab32..aaee84ab4 100755
--- a/pyramid/paster_templates/alchemy/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/alchemy/+package+/__init__.py_tmpl
@@ -1,4 +1,4 @@
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from {{package}}.models import appmaker
@@ -16,6 +16,7 @@ def main(global_config, **settings):
config.add_view('{{package}}.views.view_model',
context='{{package}}.models.MyModel',
renderer="templates/model.pt")
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/pylons_basic/+package+/__init__.py_tmpl b/pyramid/paster_templates/pylons_basic/+package+/__init__.py_tmpl
index 9f3793538..54feb0be4 100644
--- a/pyramid/paster_templates/pylons_basic/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/pylons_basic/+package+/__init__.py_tmpl
@@ -1,9 +1,9 @@
from pyramid_beaker import session_factory_from_settings
+from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
- from pyramid.configuration import Configurator
config = Configurator(settings=settings)
session_factory = session_factory_from_settings(settings)
config.set_session_factory(session_factory)
@@ -14,4 +14,5 @@ def main(global_config, **settings):
action='index')
config.add_subscriber('{{package}}.lib.subscribers.add_renderer_globals',
'pyramid.events.BeforeRender')
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/pylons_basic/+package+/tests.py_tmpl b/pyramid/paster_templates/pylons_basic/+package+/tests.py_tmpl
index 7b2bec33c..9716146e0 100644
--- a/pyramid/paster_templates/pylons_basic/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/pylons_basic/+package+/tests.py_tmpl
@@ -1,10 +1,10 @@
import unittest
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
class HelloHandlerTests(unittest.TestCase):
def setUp(self):
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
def tearDown(self):
diff --git a/pyramid/paster_templates/pylons_minimal/+package+/__init__.py_tmpl b/pyramid/paster_templates/pylons_minimal/+package+/__init__.py_tmpl
index 5e284ec88..9c061e8a8 100644
--- a/pyramid/paster_templates/pylons_minimal/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/pylons_minimal/+package+/__init__.py_tmpl
@@ -1,9 +1,9 @@
from pyramid_beaker import session_factory_from_settings
+from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
- from pyramid.configuration import Configurator
config = Configurator(settings=settings)
session_factory = session_factory_from_settings(settings)
config.set_session_factory(session_factory)
@@ -13,5 +13,6 @@ def main(global_config, **settings):
action='index')
config.add_subscriber('{{package}}.subscribers.add_renderer_globals',
'pyramid.events.BeforeRender')
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/pylons_minimal/+package+/tests.py_tmpl b/pyramid/paster_templates/pylons_minimal/+package+/tests.py_tmpl
index d98bee355..5f6c0da65 100644
--- a/pyramid/paster_templates/pylons_minimal/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/pylons_minimal/+package+/tests.py_tmpl
@@ -1,10 +1,10 @@
import unittest
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
class MyControllerTests(unittest.TestCase):
def setUp(self):
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
def tearDown(self):
diff --git a/pyramid/paster_templates/pylons_sqla/+package+/__init__.py_tmpl b/pyramid/paster_templates/pylons_sqla/+package+/__init__.py_tmpl
index b67a2c35b..8dee96e35 100644
--- a/pyramid/paster_templates/pylons_sqla/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/pylons_sqla/+package+/__init__.py_tmpl
@@ -1,4 +1,4 @@
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from pyramid_beaker import session_factory_from_settings
@@ -20,4 +20,5 @@ def main(global_config, **settings):
action='index')
config.add_subscriber('{{package}}.subscribers.add_renderer_globals',
'pyramid.events.BeforeRender')
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/pylons_sqla/+package+/tests.py_tmpl b/pyramid/paster_templates/pylons_sqla/+package+/tests.py_tmpl
index b55760b37..f2f95da60 100644
--- a/pyramid/paster_templates/pylons_sqla/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/pylons_sqla/+package+/tests.py_tmpl
@@ -2,11 +2,11 @@ import unittest
class MyHandlerTests(unittest.TestCase):
def setUp(self):
- from pyramid.configuration import Configurator
+ from pyramid.config import Configurator
from sqlalchemy import create_engine
from {{package}}.models import initialize_sql
self.session = initialize_sql(create_engine('sqlite://'))
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
def tearDown(self):
diff --git a/pyramid/paster_templates/routesalchemy/+package+/__init__.py_tmpl b/pyramid/paster_templates/routesalchemy/+package+/__init__.py_tmpl
index 5c326caa8..dbf018ad7 100644
--- a/pyramid/paster_templates/routesalchemy/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/routesalchemy/+package+/__init__.py_tmpl
@@ -1,4 +1,4 @@
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from {{package}}.models import initialize_sql
@@ -12,6 +12,7 @@ def main(global_config, **settings):
config.add_static_view('static', '{{package}}:static')
config.add_route('home', '/', view='{{package}}.views.my_view',
view_renderer='templates/mytemplate.pt')
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/routesalchemy/+package+/tests.py_tmpl b/pyramid/paster_templates/routesalchemy/+package+/tests.py_tmpl
index cfab37670..74ab8e08a 100644
--- a/pyramid/paster_templates/routesalchemy/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/routesalchemy/+package+/tests.py_tmpl
@@ -1,5 +1,5 @@
import unittest
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from pyramid import testing
def _initTestingDB():
@@ -10,7 +10,7 @@ def _initTestingDB():
class TestMyView(unittest.TestCase):
def setUp(self):
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
_initTestingDB()
diff --git a/pyramid/paster_templates/starter/+package+/__init__.py_tmpl b/pyramid/paster_templates/starter/+package+/__init__.py_tmpl
index 85cb7ec6a..4540cb0d1 100644
--- a/pyramid/paster_templates/starter/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/starter/+package+/__init__.py_tmpl
@@ -1,4 +1,4 @@
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from {{package}}.models import get_root
def main(global_config, **settings):
@@ -9,5 +9,6 @@ def main(global_config, **settings):
context='{{package}}.models.MyModel',
renderer='{{package}}:templates/mytemplate.pt')
config.add_static_view('static', '{{package}}:static')
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/starter/+package+/tests.py_tmpl b/pyramid/paster_templates/starter/+package+/tests.py_tmpl
index 2b84bee58..e1b795b7c 100644
--- a/pyramid/paster_templates/starter/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/starter/+package+/tests.py_tmpl
@@ -1,11 +1,11 @@
import unittest
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
def tearDown(self):
diff --git a/pyramid/paster_templates/starter_zcml/+package+/__init__.py_tmpl b/pyramid/paster_templates/starter_zcml/+package+/__init__.py_tmpl
index 3a0c6b7de..11dc3132a 100644
--- a/pyramid/paster_templates/starter_zcml/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/starter_zcml/+package+/__init__.py_tmpl
@@ -1,4 +1,4 @@
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from {{package}}.models import get_root
def main(global_config, **settings):
@@ -7,5 +7,6 @@ def main(global_config, **settings):
zcml_file = settings.get('configure_zcml', 'configure.zcml')
config = Configurator(root_factory=get_root, settings=settings)
config.load_zcml(zcml_file)
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/starter_zcml/+package+/tests.py_tmpl b/pyramid/paster_templates/starter_zcml/+package+/tests.py_tmpl
index 2b84bee58..e1b795b7c 100644
--- a/pyramid/paster_templates/starter_zcml/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/starter_zcml/+package+/tests.py_tmpl
@@ -1,11 +1,11 @@
import unittest
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
def tearDown(self):
diff --git a/pyramid/paster_templates/zodb/+package+/__init__.py_tmpl b/pyramid/paster_templates/zodb/+package+/__init__.py_tmpl
index 6b05ac7ad..37a172a23 100644
--- a/pyramid/paster_templates/zodb/+package+/__init__.py_tmpl
+++ b/pyramid/paster_templates/zodb/+package+/__init__.py_tmpl
@@ -1,4 +1,4 @@
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from {{package}}.models import appmaker
@@ -15,4 +15,5 @@ def main(global_config, **settings):
return finder(request.environ)
config = Configurator(root_factory=get_root, settings=settings)
config.load_zcml(zcml_file)
+ config.commit()
return config.make_wsgi_app()
diff --git a/pyramid/paster_templates/zodb/+package+/tests.py_tmpl b/pyramid/paster_templates/zodb/+package+/tests.py_tmpl
index 18041c64c..1d5c76c72 100644
--- a/pyramid/paster_templates/zodb/+package+/tests.py_tmpl
+++ b/pyramid/paster_templates/zodb/+package+/tests.py_tmpl
@@ -1,11 +1,11 @@
import unittest
-from pyramid.configuration import Configurator
+from pyramid.config import Configurator
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
- self.config = Configurator()
+ self.config = Configurator(autocommit=True)
self.config.begin()
def tearDown(self):
diff --git a/pyramid/request.py b/pyramid/request.py
index 2f9ca5819..35c75f596 100644
--- a/pyramid/request.py
+++ b/pyramid/request.py
@@ -225,7 +225,7 @@ class Request(WebobRequest):
def static_url(self, path, **kw):
""" Generates a fully qualified URL for a static :term:`resource`.
The resource must live within a location defined via the
- :meth:`pyramid.configuration.Configurator.add_static_view`
+ :meth:`pyramid.config.Configurator.add_static_view`
:term:`configuration declaration` or the ``<static>`` ZCML
directive (see :ref:`static_resources_section`).
diff --git a/pyramid/session.py b/pyramid/session.py
index b4bc34a6a..3ea3dbcf8 100644
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -50,9 +50,9 @@ def UnencryptedCookieSessionFactoryConfig(
(but signed) cookie-based sessions. The return value of this
function is a :term:`session factory`, which may be provided as
the ``session_factory`` argument of a
- :class:`pyramid.configuration.Configurator` constructor, or used
+ :class:`pyramid.config.Configurator` constructor, or used
as the ``session_factory`` argument of the
- :meth:`pyramid.configuration.Configurator.set_session_factory`
+ :meth:`pyramid.config.Configurator.set_session_factory`
method.
The session factory returned by this function will create sessions
diff --git a/pyramid/settings.py b/pyramid/settings.py
index 928dd1915..7cee68926 100644
--- a/pyramid/settings.py
+++ b/pyramid/settings.py
@@ -67,14 +67,14 @@ def get_settings():
Return a 'settings' object for the current application. A
'settings' object is a dictionary-like object that contains
key/value pairs based on the dictionary passed as the ``settings``
- argument to the :class:`pyramid.configuration.Configurator`
+ argument to the :class:`pyramid.config.Configurator`
constructor or the :func:`pyramid.router.make_app` API.
.. note:: For backwards compatibility, dictionary keys can also be
looked up as attributes of the settings object.
.. note:: the
- :class:`pyramid.configuration.Configurator.get_settings` method
+ :class:`pyramid.config.Configurator.get_settings` method
performs the same duty.
.. warning:: This method is deprecated as of Pyramid 1.0. Use
diff --git a/pyramid/static.py b/pyramid/static.py
index 710ab4407..645e78da1 100644
--- a/pyramid/static.py
+++ b/pyramid/static.py
@@ -181,7 +181,7 @@ class static_view(object):
.. note:: If the ``root_dir`` is relative to a :term:`package`, or
is a :term:`resource specification` the :app:`Pyramid`
``resource`` ZCML directive or
- :class:`pyramid.configuration.Configurator` method can be
+ :class:`pyramid.config.Configurator` method can be
used to override resources within the named ``root_dir``
package-relative directory. However, if the ``root_dir`` is
absolute, the ``resource`` directive will not be able to
diff --git a/pyramid/testing.py b/pyramid/testing.py
index b584c3b73..8d48bfdf4 100644
--- a/pyramid/testing.py
+++ b/pyramid/testing.py
@@ -52,7 +52,7 @@ def registerDummySecurityPolicy(userid=None, groupids=(), permissive=True):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.testing_securitypolicy`
+ :meth:`pyramid.config.Configurator.testing_securitypolicy`
method in your unit and integration tests.
"""
registry = get_current_registry()
@@ -76,7 +76,7 @@ def registerModels(models):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.testing_models`
+ :meth:`pyramid.config.Configurator.testing_models`
method in your unit and integration tests.
"""
registry = get_current_registry()
@@ -104,7 +104,7 @@ def registerEventListener(event_iface=None):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.testing_add_subscriber`
+ :meth:`pyramid.config.Configurator.testing_add_subscriber`
method in your unit and integration tests.
"""
registry = get_current_registry()
@@ -125,7 +125,7 @@ def registerTemplateRenderer(path, renderer=None):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.testing_add_template`
+ :meth:`pyramid.config.Configurator.testing_add_template`
method in your unit and integration tests.
"""
@@ -159,7 +159,7 @@ def registerView(name, result='', view=None, for_=(Interface, Interface),
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.add_view`
+ :meth:`pyramid.config.Configurator.add_view`
method in your unit and integration tests.
"""
for_ = (IViewClassifier, ) + for_
@@ -252,7 +252,7 @@ def registerSubscriber(subscriber, iface=Interface):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.add_subscriber`
+ :meth:`pyramid.config.Configurator.add_subscriber`
method in your unit and integration tests.
"""
registry = get_current_registry()
@@ -275,7 +275,7 @@ def registerRoute(pattern, name, factory=None):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.add_route`
+ :meth:`pyramid.config.Configurator.add_route`
method in your unit and integration tests.
"""
reg = get_current_registry()
@@ -303,7 +303,7 @@ def registerSettings(dictarg=None, **kw):
.. warning:: This API is deprecated as of :app:`Pyramid` 1.0.
Instead use the
- :meth:`pyramid.configuration.Configurator.add_settings`
+ :meth:`pyramid.config.Configurator.add_settings`
method in your unit and integration tests.
"""
registry = get_current_registry()
@@ -573,7 +573,7 @@ def setUp(registry=None, request=None, hook_zca=True, autocommit=True):
- any of the ``register*`` functions in :mod:`pyramid.testing`
(such as :func:`pyramid.testing.registerModels`)
- - any method of the :class:`pyramid.configuration.Configurator`
+ - any method of the :class:`pyramid.config.Configurator`
object returned by this function.
- the :func:`pyramid.threadlocal.get_current_registry` or
@@ -611,7 +611,7 @@ def setUp(registry=None, request=None, hook_zca=True, autocommit=True):
``hook_zca`` is ``False``, the hook will not be set.
This function returns an instance of the
- :class:`pyramid.configuration.Configurator` class, which can be
+ :class:`pyramid.config.Configurator` class, which can be
used for further configuration to set up an environment suitable
for a unit or integration test. The ``registry`` attribute
attached to the Configurator instance represents the 'current'
@@ -704,7 +704,7 @@ def cleanUp(*arg, **kw):
class DummyRendererFactory(object):
""" Registered by
- ``pyramid.configuration.Configurator.testing_add_renderer`` as
+ ``pyramid.config.Configurator.testing_add_renderer`` as
a dummy renderer factory. The indecision about what to use as a
key (a spec vs. a relative name) is caused by test suites in the
wild believing they can register either. The ``factory`` argument
diff --git a/pyramid/url.py b/pyramid/url.py
index 2e73e9cf5..79740821e 100644
--- a/pyramid/url.py
+++ b/pyramid/url.py
@@ -301,7 +301,7 @@ def static_url(path, request, **kw):
"""
Generates a fully qualified URL for a static :term:`resource`.
The resource must live within a location defined via the
- :meth:`pyramid.configuration.Configurator.add_static_view`
+ :meth:`pyramid.config.Configurator.add_static_view`
:term:`configuration declaration` or the ``<static>`` ZCML
directive (see :ref:`static_resources_section`).
diff --git a/pyramid/util.py b/pyramid/util.py
index 84a23bb23..faab2c54c 100644
--- a/pyramid/util.py
+++ b/pyramid/util.py
@@ -41,7 +41,7 @@ class DottedNameResolver(object):
resolver will only be able to resolve fully qualified (not
relative) names. Any attempt to resolve a relative name when the
``package`` is ``None`` will result in an
- :exc:`pyramid.configuration.ConfigurationError` exception.
+ :exc:`pyramid.config.ConfigurationError` exception.
If a *module* or *module name* (as opposed to a package or package
name) is supplied as ``package``, its containing package is
diff --git a/pyramid/view.py b/pyramid/view.py
index 2ac51406e..d18d0dba3 100644
--- a/pyramid/view.py
+++ b/pyramid/view.py
@@ -155,7 +155,7 @@ class view_config(object):
return 'OK'
Might replace the following call to the
- :meth:`pyramid.configuration.Configurator.add_view` method::
+ :meth:`pyramid.config.Configurator.add_view` method::
import views
import models
@@ -371,7 +371,7 @@ class view_config(object):
``scan`` directive.
Or, if you don't use ZCML, use the
- :meth:`pyramid.configuration.Configurator.scan` method::
+ :meth:`pyramid.config.Configurator.scan` method::
config.scan()
"""
@@ -505,7 +505,7 @@ If you use :term:`ZCML`, add the following to your application's
view="pyramid.view.append_slash_notfound_view"/>
Or use the
-:meth:`pyramid.configuration.Configurator.add_view`
+:meth:`pyramid.config.Configurator.add_view`
method if you don't use ZCML::
from pyramid.exceptions import NotFound
diff --git a/pyramid/wsgi.py b/pyramid/wsgi.py
index 414526683..3b2bd0bc2 100644
--- a/pyramid/wsgi.py
+++ b/pyramid/wsgi.py
@@ -25,7 +25,7 @@ def wsgiapp(wrapped):
/>
Or the following call to
- :meth:`pyramid.configuration.Configurator.add_view`::
+ :meth:`pyramid.config.Configurator.add_view`::
from views import hello_world
config.add_view(hello_world, name='hello_world.txt')
@@ -64,7 +64,7 @@ def wsgiapp2(wrapped):
/>
Or the following call to
- :meth:`pyramid.configuration.Configurator.add_view`::
+ :meth:`pyramid.config.Configurator.add_view`::
from views import hello_world
config.add_view(hello_world, name='hello_world.txt')
diff --git a/pyramid/zcml.py b/pyramid/zcml.py
index 06e8cee4b..07dc3f0b5 100644
--- a/pyramid/zcml.py
+++ b/pyramid/zcml.py
@@ -764,12 +764,12 @@ file_configure = zcml_configure # backwards compat (>0.8.1)
deprecated(
'zcml_configure',
'(pyramid.zcml.zcml_configure is deprecated as of Pyramid 1.0. Use'
- '``pyramid.configuration.Configurator.load_zcml`` instead.) ')
+ '``pyramid.config.Configurator.load_zcml`` instead.) ')
deprecated(
'file_configure',
'(pyramid.zcml.file_configure is deprecated as of Pyramid 1.0. Use'
- '``pyramid.configuration.Configurator.load_zcml`` instead.) ')
+ '``pyramid.config.Configurator.load_zcml`` instead.) ')
def _rolledUpFactory(factories):
def factory(ob):