From df1c6f7fcba90ced4cc5b3ea98cceacac39e8af1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 1 May 2009 18:34:36 +0000 Subject: Remove dependencies on zope.deferredimport. zope.deferredimport was only used as a deprecation mechanism, so where possible we've kept around the deprecation warnings and we've used zope.deprectation instead. However, when cross-module deprecations were included, rather than introducing a cyclic dependency, we just removed the deprecation itself. As a result: - Since version 0.6.1, a deprecation warning has been emitted when the name ``model_url`` is imported from the ``repoze.bfg.traversal`` module. This import alias (and the deprecation warning) has been removed. Any import of the ``model_url`` function will now need to be done from ``repoze.bfg.url``; any import of the name ``model_url`` from ``repoze.bfg.traversal`` will now fail. This was done to remove a dependency on zope.deferredimport. - Since version 0.6.5, a deprecation warning has been emitted when the name ``RoutesModelTraverser`` is imported from the ``repoze.bfg.traversal`` module. This import alias (and the deprecation warning) has been removed. Any import of the ``RoutesModelTraverser`` class will now need to be done from ``repoze.bfg.urldispatch``; any import of the name ``RoutesModelTraverser`` from ``repoze.bfg.traversal`` will now fail. This was done to remove a dependency on zope.deferredimport. --- repoze/bfg/interfaces.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'repoze/bfg/interfaces.py') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 8f75a4f4a..f9a0a17e5 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -1,28 +1,10 @@ from zope.interface import Attribute from zope.interface import Interface -from zope.deferredimport import deprecated +from zope.deprecation import deprecated from zope.component.interfaces import IObjectEvent -deprecated( - '(repoze.bfg.interfaces.ITemplate should now be imported ' - 'as repoze.bfg.interfaces.ITemplateRenderer)', - ITemplate = 'repoze.bfg.interfaces:ITemplateRenderer', - ) - -deprecated( - '(repoze.bfg.interfaces.ITemplateFactory should now be imported ' - 'as repoze.bfg.interfaces.ITemplateRendererFactory)', - ITemplateFactory = 'repoze.bfg.interfaces:ITemplateRendererFactory', - ) - -deprecated( - '(repoze.bfg.interfaces.IRootPolicy should now be imported ' - 'as repoze.bfg.interfaces.IRootFactory)', - IRootPolicy = "repoze.bfg.interfaces:IRootFactory", - ) - class IRequestFactory(Interface): """ A utility which generates a request object """ def __call__(): @@ -69,6 +51,12 @@ class IRootFactory(Interface): def __call__(environ): """ Return a root object """ +IRootPolicy = IRootFactory +deprecated('IRootPolicy', + '(repoze.bfg.interfaces.IRootPolicy should now be imported ' + 'as repoze.bfg.interfaces.IRootFactory)', + ) + class ITraverser(Interface): def __call__(environ): """ Return a tuple in the form ``(context, view_name, subpath, @@ -102,10 +90,22 @@ class ITemplateRenderer(Interface): passed in as arguments and return the result (a string or unicode object) """ +ITemplate = ITemplateRenderer +deprecated('ITemplate', + '(repoze.bfg.interfaces.ITemplate should now be imported ' + 'as repoze.bfg.interfaces.ITemplateRenderer)', + ) + class ITemplateRendererFactory(Interface): def __call__(path, auto_reload=False): """ Return an object that implements ``ITemplateRenderer`` """ +ITemplateFactory = ITemplateRendererFactory +deprecated('ITemplateFactory', + '(repoze.bfg.interfaces.ITemplateFactory should now be imported ' + 'as repoze.bfg.interfaces.ITemplateRendererFactory)', + ) + class ISecurityPolicy(Interface): """ A utility that provides a mechanism to check authorization using authentication data """ -- cgit v1.2.3