[Zope3-checkins] SVN: Zope3/trunk/src/zope/component/registry.py
Add 'value' as a deprecated attribute (use factory instead). Whether
Martijn Faassen
faassen at infrae.com
Thu Apr 27 08:50:58 EDT 2006
Log message for revision 67642:
Add 'value' as a deprecated attribute (use factory instead). Whether
'component' is actually correctly deprecated attribute I doubt, but
since the deprecation warning doesn't hurt I've left it in to be sure.
Changed:
U Zope3/trunk/src/zope/component/registry.py
-=-
Modified: Zope3/trunk/src/zope/component/registry.py
===================================================================
--- Zope3/trunk/src/zope/component/registry.py 2006-04-27 12:50:09 UTC (rev 67641)
+++ Zope3/trunk/src/zope/component/registry.py 2006-04-27 12:50:58 UTC (rev 67642)
@@ -436,6 +436,8 @@
def __cmp__(self, other):
return cmp(self.__repr__(), other.__repr__())
+ # this may actually not be needed as component did not exist as
+ # an attribute in Zope 3.2, but we'll leave it in to be sure.
@property
@zope.deprecation.deprecate(
"The component attribute on adapter registrations will be unsupported "
@@ -443,6 +445,13 @@
def component(self):
return self.factory
+ @property
+ @zope.deprecation.deprecate(
+ "The value attribute on adapter registrations will be unsupported "
+ "in Zope 3.5. Use the factory attribute instead.")
+ def value(self):
+ return self.factory
+
class SubscriptionRegistration(AdapterRegistration):
interface.implementsOnly(interfaces.ISubscriptionAdapterRegistration)
More information about the Zope3-Checkins
mailing list