From 18da3e8465dce7b47fdeed28f19af0ad81d482bd Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 7 Dec 2010 22:13:27 -0500 Subject: move with_context to API --- pyramid/configuration.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyramid/configuration.py b/pyramid/configuration.py index 8d9a3780d..a6b712d99 100644 --- a/pyramid/configuration.py +++ b/pyramid/configuration.py @@ -267,12 +267,6 @@ class Configurator(object): session_factory=session_factory, ) - @classmethod - def with_context(cls, context): - configurator = cls(registry=context.registry, package=context.package) - configurator._ctx = context - return configurator - def _action(self, discriminator, callable=None, args=(), kw=None, order=0): """ Register an action which will be executed during a commit. """ if kw is None: @@ -401,6 +395,12 @@ class Configurator(object): self._ctx.execute_actions() self._ctx = self._make_context(self._ctx.autocommit) + @classmethod + def with_context(cls, context): + configurator = cls(registry=context.registry, package=context.package) + configurator._ctx = context + return configurator + def with_package(self, package, _ctx=None): """ Return a new Configurator instance with the same registry as this configurator using the package supplied as the -- cgit v1.2.3