Skip to content

Commit

Permalink
A local utility is now IAttributeAnnotatable.
Browse files Browse the repository at this point in the history
  • Loading branch information
thefunny42 committed Sep 18, 2009
1 parent ab3acd7 commit 61942aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Changes
=======

1.0.2 (unreleased)
------------------
1.1 (unreleased)
----------------

* A local utility implements now IAttributeAnnotatable.

* Update code documentation from Grok itself.

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(*rnames):

setup(
name='grokcore.site',
version='1.0.2dev',
version='1.1dev',
author='Grok Team',
author_email='grok-dev@zope.org',
url='http://grok.zope.org',
Expand All @@ -35,6 +35,7 @@ def read(*rnames):
install_requires=['setuptools',
'martian',
'ZODB3',
'zope.annotation',
'zope.component',
'zope.interface',
'zope.app.component',
Expand Down
5 changes: 2 additions & 3 deletions src/grokcore/site/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
from persistent import Persistent

from zope.interface import implements

from zope.annotation.interfaces import IAttributeAnnotatable
from zope.app.component.site import SiteManagerContainer

from zope.app.container.contained import Contained


Expand Down Expand Up @@ -61,4 +60,4 @@ class LocalUtility(Contained, Persistent):
used explicitly anyway).
"""
implements(IContext)
implements(IContext, IAttributeAnnotatable)
6 changes: 4 additions & 2 deletions src/grokcore/site/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import grokcore.site.interfaces

class SiteGrokker(martian.ClassGrokker):
"""Grokker for subclasses of `grokcore.site.Site`."""
martian.component(grokcore.site.components.BaseSite)
martian.priority(500)
martian.directive(grokcore.site.local_utility, name='infos')
Expand Down Expand Up @@ -63,7 +64,8 @@ def localUtilityRegistrationSubscriber(site, event):
if installed:
return

setupUtility = component.getUtility(grokcore.site.interfaces.IUtilityInstaller)
setupUtility = component.getUtility(
grokcore.site.interfaces.IUtilityInstaller)
for info in getattr(site.__class__, '__grok_utilities_to_install__', []):
setupUtility(site, info.factory(), info.provides, name=info.name,
name_in_container=info.name_in_container,
Expand All @@ -75,7 +77,7 @@ def localUtilityRegistrationSubscriber(site, event):


@grokcore.component.provider(grokcore.site.interfaces.IUtilityInstaller)
def setupUtility(site, utility, provides, name=u'',
def setupUtility(Site, utility, provides, name=u'',
name_in_container=None, public=False, setup=None):
"""Set up a utility in a site.
Expand Down

0 comments on commit 61942aa

Please sign in to comment.