Skip to content

Commit

Permalink
Merge pull request #4 from zopefoundation/jw-zope.component.hooks
Browse files Browse the repository at this point in the history
use zope.component.hooks not zope.site.hooks.
  • Loading branch information
janwijbrand committed Jan 11, 2018
2 parents 44b542f + d7c224a commit 5fe2686
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Changes
3.0.2 (unreleased)
------------------

- Nothing changed yet.

- Do not import `getSite` from `zope.site.hooks` anymore but from
`zope.component.hooks.

3.0.1 (2018-01-10)
------------------
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/site/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
##############################################################################

from zope.site.hooks import getSite
from zope.component.hooks import getSite
from grokcore.component import *
from grokcore.site.directive import site, local_utility, install_on
from grokcore.site.components import Site, LocalUtility, Application
Expand Down
6 changes: 3 additions & 3 deletions src/grokcore/site/ftests/application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
Let's create an application, then get it using grok.getApplication():
>>> import grokcore.site
>>> import zope.site.hooks
>>> import zope.component.hooks
>>> root = getRootFolder()
>>> app = grokcore.site.util.create_application(Cave, root, 'mycave')
>>> root['cave'] = app
>>> zope.site.hooks.setSite(app)
>>> zope.component.hooks.setSite(app)
>>> grokcore.site.getApplication()
<grokcore.site.ftests.application.application.Cave object at ...>
Expand All @@ -29,7 +29,7 @@
we'll get the box:
>>> root['cave']['box'] = WoodBox()
>>> zope.site.hooks.setSite(root['cave']['box'])
>>> zope.component.hooks.setSite(root['cave']['box'])
>>> getSite()
<grokcore.site.ftests.application.application.WoodBox object at ...>
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/site/ftests/utility/install_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>>> getRootFolder()['cave'] = cave
>>> from zope.component import queryUtility
>>> from zope.site.hooks import setSite
>>> from zope.component.hooks import setSite
>>> from zope.event import notify
>>> setSite(cave)
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/site/ftests/utility/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>>> getRootFolder()["cave"] = cave
>>> from zope import component
>>> from zope.site.hooks import getSite, setSite
>>> from zope.component.hooks import getSite, setSite
>>> setSite(cave)
>>> fireplace = component.getUtility(IFireplace)
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/site/ftests/utility/local_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>>> getRootFolder()['cave'] = cave
>>> from zope import component
>>> from zope.site.hooks import getSite, setSite
>>> from zope.component.hooks import getSite, setSite
>>> setSite(cave)
>>> club = component.getUtility(IClub)
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/site/ftests/utility/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>>> getRootFolder()["cave"] = cave
>>> from zope import component
>>> from zope.site.hooks import getSite, setSite
>>> from zope.component.hooks import getSite, setSite
>>> setSite(cave)
>>> cave['fireplace'] is component.getUtility(IFireplace)
True
Expand Down
2 changes: 1 addition & 1 deletion src/grokcore/site/ftests/utility/subclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
>>> getRootFolder()["cave"] = cave
>>> from zope import component
>>> from zope.site.hooks import getSite, setSite
>>> from zope.component.hooks import getSite, setSite
>>> setSite(cave)
>>> fireplace = component.getUtility(IFireplace)
Expand Down

0 comments on commit 5fe2686

Please sign in to comment.