[Zope3-checkins]
SVN: Zope3/branches/jim-adapter/src/zope/component/zcml.py
Removed deprecated support for passing a factory without a provides
Jim Fulton
jim at zope.com
Tue Apr 18 19:56:30 EDT 2006
Log message for revision 67107:
Removed deprecated support for passing a factory without a provides
attribute.
Changed:
U Zope3/branches/jim-adapter/src/zope/component/zcml.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/component/zcml.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/zcml.py 2006-04-18 23:56:26 UTC (rev 67106)
+++ Zope3/branches/jim-adapter/src/zope/component/zcml.py 2006-04-18 23:56:29 UTC (rev 67107)
@@ -305,14 +305,9 @@
if handler is not None:
raise TypeError("Cannot use handler with factory")
if provides is None:
- import warnings
- warnings.warn(
- "\n %s\n"
- "Use of factory without provides to indicate a handler "
- "is deprecated and will change it's meaning in Zope 3.3. "
- "Use the handler attribute instead."
- % _context.info,
- DeprecationWarning)
+ raise TypeError(
+ "You must specify a provided interface when registering "
+ "a factory")
if for_ is None:
for_ = zope.component.adaptedBy(factory)
@@ -338,12 +333,20 @@
if trusted:
factory = TrustedAdapterFactory(factory)
- _context.action(
- discriminator = None,
- callable = _handler,
- args = ('subscribe',
- for_, provides, factory, _context.info),
- )
+ if handler is not None:
+ _context.action(
+ discriminator = None,
+ callable = _handler,
+ args = ('registerHandler',
+ handler, for_, u'', _context.info),
+ )
+ else:
+ _context.action(
+ discriminator = None,
+ callable = _handler,
+ args = ('registerSubscriptionAdapter',
+ factory, for_, provides, u'', _context.info),
+ )
if provides is not None:
_context.action(
More information about the Zope3-Checkins
mailing list