[Zope3-checkins] CVS: Zope3/src/zope/app/component -
metaconfigure.py:1.35 metadirectives.py:1.18
Mark McEahern
mark at mceahern.com
Mon Mar 22 17:32:19 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/component
In directory cvs.zope.org:/tmp/cvs-serv21401
Modified Files:
metaconfigure.py metadirectives.py
Log Message:
Added 'provides' as a required parameter to the subscriber directive.
=== Zope3/src/zope/app/component/metaconfigure.py 1.34 => 1.35 ===
--- Zope3/src/zope/app/component/metaconfigure.py:1.34 Mon Mar 22 12:44:46 2004
+++ Zope3/src/zope/app/component/metaconfigure.py Mon Mar 22 17:31:49 2004
@@ -27,7 +27,6 @@
from zope.app.component.interface import queryInterface
from zope.app.security.permission import checkPermission
from zope.app.servicenames import Adapters, Presentation
-from zope.app.event.interfaces import ISubscriber
PublicPermission = 'zope.Public'
@@ -80,13 +79,13 @@
return ob
-def subscriber(_context, factory, for_, permission=None):
+def subscriber(_context, factory, provides, for_, permission=None):
factory = [factory]
if permission is not None:
if permission == PublicPermission:
permission = CheckerPublic
- checker = InterfaceChecker(ISubscriber, permission)
+ checker = InterfaceChecker(provides, permission)
factory.append(lambda c: proxify(c, checker))
for_ = tuple(for_)
@@ -112,14 +111,14 @@
discriminator = None,
callable = checkingHandler,
args = (permission, Adapters, 'subscribe',
- for_, ISubscriber, factory),
+ for_, provides, factory),
)
- # Stating that the adapter provides the ISubscriber interface.
+ # Stating that the adapter provides the specified interface.
_context.action(
discriminator = None,
callable = provideInterface,
- args = ('', ISubscriber)
+ args = ('', provides)
)
# For each interface, state that the adapter provides that interface.
=== Zope3/src/zope/app/component/metadirectives.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/component/metadirectives.py:1.17 Mon Mar 22 12:44:48 2004
+++ Zope3/src/zope/app/component/metadirectives.py Mon Mar 22 17:31:49 2004
@@ -190,6 +190,13 @@
required=True
)
+ provides = GlobalObject(
+ title=u"Interface the component provides",
+ description=u"""This attribute specifes the interface the adapter
+ instance must provide.""",
+ required=True
+ )
+
for_ = Tokens(
title=u"Interfaces or classes that this subscriber depends on",
description=u"This should be a list of interfaces or classes",
More information about the Zope3-Checkins
mailing list