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/urldispatch.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'repoze/bfg/urldispatch.py') diff --git a/repoze/bfg/urldispatch.py b/repoze/bfg/urldispatch.py index 96650f9a5..526db3a9a 100644 --- a/repoze/bfg/urldispatch.py +++ b/repoze/bfg/urldispatch.py @@ -15,28 +15,22 @@ from repoze.bfg.interfaces import IRoutesContext from repoze.bfg.interfaces import ITraverser from repoze.bfg.interfaces import ITraverserFactory -from zope.deferredimport import deprecated -from zope.deprecation import deprecated as deprecated2 +from zope.deprecation import deprecated _marker = () -deprecated( - "('from repoze.bfg.urldispatch import RoutesContext' is now " - "deprecated; instead use 'from repoze.bfg.urldispatch import " - "DefaultRoutesContext')", - RoutesContext = "repoze.bfg.urldispatch:DefaultRoutesContext", - ) - -deprecated2('RoutesMapper', - 'Usage of the ``RoutesMapper`` class is deprecated. As of ' - 'repoze.bfg 0.6.3, you should use the ```` ZCML ' - 'directive instead of manually creating a RoutesMapper.') - class DefaultRoutesContext(object): implements(IRoutesContext) def __init__(self, **kw): self.__dict__.update(kw) +RoutesContext = DefaultRoutesContext +deprecated('RoutesContext', + "('from repoze.bfg.urldispatch import RoutesContext' is now " + "deprecated; instead use 'from repoze.bfg.urldispatch import " + "DefaultRoutesContext')", + ) + class RoutesMapper(object): """ The ``RoutesMapper`` is a wrapper for the ``get_root`` callable passed in to the repoze.bfg ``Router`` at initialization @@ -110,6 +104,12 @@ class RoutesMapper(object): self.mapper.connect(*arg, **kw) +deprecated('RoutesMapper', + 'Usage of the ``RoutesMapper`` class is deprecated. As of ' + 'repoze.bfg 0.6.3, you should use the ```` ZCML ' + 'directive instead of manually creating a RoutesMapper.', + ) + class RoutesContextNotFound(object): implements(IContextNotFound) def __init__(self, msg): -- cgit v1.2.3