diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-05-01 18:34:36 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-05-01 18:34:36 +0000 |
| commit | df1c6f7fcba90ced4cc5b3ea98cceacac39e8af1 (patch) | |
| tree | 9f2dc49456c557d54b4cc1cbfc7a7021ddb816c9 /repoze/bfg/urldispatch.py | |
| parent | ba9b0e647bff1bf0c437ab204ddf11783ed698f8 (diff) | |
| download | pyramid-df1c6f7fcba90ced4cc5b3ea98cceacac39e8af1.tar.gz pyramid-df1c6f7fcba90ced4cc5b3ea98cceacac39e8af1.tar.bz2 pyramid-df1c6f7fcba90ced4cc5b3ea98cceacac39e8af1.zip | |
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.
Diffstat (limited to 'repoze/bfg/urldispatch.py')
| -rw-r--r-- | repoze/bfg/urldispatch.py | 28 |
1 files changed, 14 insertions, 14 deletions
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 ``<route.. >`` 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 ``<route.. >`` ZCML ' + 'directive instead of manually creating a RoutesMapper.', + ) + class RoutesContextNotFound(object): implements(IContextNotFound) def __init__(self, msg): |
