[Zope3-checkins] Re: SVN:
Zope3/branches/jim-adapter/src/zope/component/globalregistry.py
Fixed the backward-compatible subscription registration.
Philipp von Weitershausen
philipp at weitershausen.de
Wed Mar 1 12:32:23 EST 2006
Stephan Richter wrote:
>>Log message for revision 65626:
>> Fixed the backward-compatible subscription registration.
>
> ...
>
>>Modified: Zope3/branches/jim-adapter/src/zope/component/globalregistry.py
>>===================================================================
>>---
>>Zope3/branches/jim-adapter/src/zope/component/globalregistry.py 2006-02
>>-28 23:45:59 UTC (rev 65625) +++
>>Zope3/branches/jim-adapter/src/zope/component/globalregistry.py 2006-02
>>-28 23:47:29 UTC (rev 65626) @@ -117,7 +117,11 @@
>> def subscribe(self, required, provided, factory, info=''):
>> # we're discarding 'provided' here, but a subscriber doesn't
>> # need that anyway
>>- self.registerHandler(factory, required, u'', info)
>>+ if provided is None:
>>+ self.registerHandler(factory, required, u'', info)
>>+ else:
>>+ self.registerSubscriptionAdapter(factory, required, provided,
>>+ info=info)
>
>
> Doesn't this mean that we need a deprecation warning here somewhere?
There *are* deprecation warnings. See the @deprecate decorator (which I
implemented on this branch in r65578):
@deprecate("The subscribe method of the global site manager has been "
"deprecated. Use registerHandler instead.")
def subscribe(self, required, provided, factory, info=''):
# we're discarding 'provided' here, but a subscriber doesn't
# need that anyway
if provided is None:
self.registerHandler(factory, required, u'', info)
else:
self.registerSubscriptionAdapter(factory, required, provided,
info=info)
Philipp
More information about the Zope3-Checkins
mailing list