From 13173e9e1d1c5f3873e8bfed91e6f3ed561dafaf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 9 Dec 2010 02:38:51 -0500 Subject: docs fixes --- pyramid/config.py | 8 +++++--- pyramid/configuration.py | 2 ++ pyramid/tests/test_config.py | 6 ++++++ 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) -- cgit v1.2.3