Skip to content

Commit

Permalink
Add more deprecations
Browse files Browse the repository at this point in the history
Deprecate ``zope.site.hooks``, ``zope.site.site.setSite`` and ``zope.site.next`` with ``zope.deprecation``.
These will be removed in zope.site Version 5.0.
  • Loading branch information
thet committed Mar 3, 2016
1 parent f39331c commit c854ce5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,8 @@ Changes
4.0.1 (unreleased)
------------------

- Deprecate ``zope.site.hooks`` with ``zope.deprecation``.
- Deprecate ``zope.site.hooks``, ``zope.site.site.setSite`` and ``zope.site.next`` with ``zope.deprecation``.
These will be removed in zope.site Version 5.0.
[thet]


Expand Down
9 changes: 7 additions & 2 deletions src/zope/site/__init__.py
Expand Up @@ -20,5 +20,10 @@
from zope.site.site import threadSiteSubscriber
from zope.site.site import clearThreadSiteSubscriber

# BBB
from zope.component import getNextUtility, queryNextUtility

# BBB. Remove in Version 5.0
from zope.component import getNextUtility
from zope.component import queryNextUtility
from zope.deprecation import deprecated
getNextUtility = deprecated(getNextUtility, '``zope.site.getNextUtility`` is deprecated and will be removed in zope.site 5.0. Use it from ``zope.component`` instead.') # noqa
queryNextUtility = deprecated(queryNextUtility, '``zope.site.queryNextUtility`` is deprecated and will be removed in zope.site 5.0. Use it from ``zope.component`` instead.') # noqa
4 changes: 2 additions & 2 deletions src/zope/site/hooks.py
Expand Up @@ -13,6 +13,6 @@
##############################################################################
"""Hooks for getting and setting a site in the thread global namespace.
"""
__docformat__ = 'restructuredtext'
# BBB. Remove in Version 5.0
from zope.deprecation import moved
moved('zope.component.hooks', 'Version 4.1')
moved('zope.component.hooks', 'Version 5.0')
5 changes: 3 additions & 2 deletions src/zope/site/next.py
@@ -1,2 +1,3 @@
# BBB
from zope.component import getNextUtility, queryNextUtility
# BBB. Remove in Version 5.0
from zope.deprecation import moved
moved('zope.component', 'Version 5.0')
5 changes: 4 additions & 1 deletion src/zope/site/site.py
Expand Up @@ -41,8 +41,11 @@

from zope.site import interfaces

# BBB

# BBB. Remove in Version 5.0
from zope.component.hooks import setSite
from zope.deprecation import deprecated
setSite = deprecated(setSite, '``zope.site.site.setSite`` is deprecated and will be removed in zope.site Version 5.0. Use it from ``zope.component.hooks`` instead.') # noqa


@zope.interface.implementer(interfaces.ISiteManagementFolder)
Expand Down

0 comments on commit c854ce5

Please sign in to comment.