summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-12-09 02:38:51 -0500
committerChris McDonough <chrism@plope.com>2010-12-09 02:38:51 -0500
commit13173e9e1d1c5f3873e8bfed91e6f3ed561dafaf (patch)
tree8227389dd2741dee1a184613cd105df7693faf7e
parentd7f2590a4c2c2164bdb01ba977119ccbb6b2b09c (diff)
downloadpyramid-13173e9e1d1c5f3873e8bfed91e6f3ed561dafaf.tar.gz
pyramid-13173e9e1d1c5f3873e8bfed91e6f3ed561dafaf.tar.bz2
pyramid-13173e9e1d1c5f3873e8bfed91e6f3ed561dafaf.zip
docs fixes
-rw-r--r--pyramid/config.py8
-rw-r--r--pyramid/configuration.py2
-rw-r--r--pyramid/tests/test_config.py6
3 files changed, 13 insertions, 3 deletions
diff --git a/pyramid/config.py b/pyramid/config.py
index 4d969cf4f..25f4f9aaf 100644
--- a/pyramid/config.py
+++ b/pyramid/config.py
@@ -404,7 +404,7 @@ class Configurator(object):
respectively, which are passed to ``callable`` when this action is
executed.
- ``order`` is a crude order control mechanism, rarely used.
+ ``order`` is a crude order control mechanism, only rarely used.
"""
if kw is None:
kw = {}
@@ -514,8 +514,10 @@ class Configurator(object):
@classmethod
def with_context(cls, context):
- """ Used by ZCML directives to obtain a configurator with 'the right'
- context """
+ """A classmethod used by ZCML directives,
+ :meth:`pyramid.config.Configurator.with_package`, and
+ :meth:`pyramid.config.Configurator.include` to obtain a configurator
+ with 'the right' context. Returns a new Configurator instance."""
configurator = cls(registry=context.registry, package=context.package,
autocommit=context.autocommit)
configurator._ctx = context
diff --git a/pyramid/configuration.py b/pyramid/configuration.py
index 8cf764840..cdb9bc983 100644
--- a/pyramid/configuration.py
+++ b/pyramid/configuration.py
@@ -5,6 +5,8 @@ from pyramid.path import caller_package
from zope.deprecation import deprecated
+ConfigurationError = ConfigurationError # pyflakes
+
deprecated(
'ConfigurationError',
'pyramid.configuration.ConfigurationError is deprecated as of '
diff --git a/pyramid/tests/test_config.py b/pyramid/tests/test_config.py
index 7f84362ab..a1e5e28f4 100644
--- a/pyramid/tests/test_config.py
+++ b/pyramid/tests/test_config.py
@@ -667,6 +667,12 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(context_after.includepath, ())
self.failUnless(context_after is context_before)
+ def test_with_context(self):
+ config = self._makeOne()
+ ctx = config._make_context()
+ newconfig = config.with_context(ctx)
+ self.assertEqual(newconfig._ctx, ctx)
+
def test_add_view_view_callable_None_no_renderer(self):
from pyramid.exceptions import ConfigurationError
config = self._makeOne(autocommit=True)