[Zope3-checkins]
SVN: Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py
Fixed to reflect new separate subscription adapter and
Jim Fulton
jim at zope.com
Sun Apr 2 12:59:14 EDT 2006
Log message for revision 66298:
Fixed to reflect new separate subscription adapter and
handler-registration apis/
Changed:
U Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py 2006-04-02 16:59:11 UTC (rev 66297)
+++ Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py 2006-04-02 16:59:13 UTC (rev 66298)
@@ -72,19 +72,19 @@
elif not isinstance(required, stypes):
required = (required,)
- gsm.provideAdapter(required, provided, name, factory)
+ gsm.registerAdapter(factory, required, provided, name)
def subscribe(required, provided, factory):
gsm = zapi.getGlobalSiteManager()
- gsm.subscribe(required, provided, factory)
+ if provided is None:
+ gsm.registerHandler(factory, required)
+ else:
+ gsm.registerSubscriptionAdapter(factory, required, provided)
+
-# BBB: Deprecated. Gone in 3.3
-def handle(required, handler):
- subscribe(required, None, handler)
-
def provideUtility(provided, component, name=''):
gsm = zapi.getGlobalSiteManager()
- gsm.provideUtility(provided, component, name)
+ gsm.registerUtility(component, provided, name)
def unprovideUtility(provided, name=''):
gsm = zapi.getGlobalSiteManager()
More information about the Zope3-Checkins
mailing list