[Checkins] SVN: grokcore.component/branches/sylvain-subscribers/src/grokcore/component/meta.py ammend comments for the registration of handlers versus subscription adapters
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Mon Jan 31 04:46:18 EST 2011
Log message for revision 120014:
ammend comments for the registration of handlers versus subscription adapters
Changed:
U grokcore.component/branches/sylvain-subscribers/src/grokcore/component/meta.py
-=-
Modified: grokcore.component/branches/sylvain-subscribers/src/grokcore/component/meta.py
===================================================================
--- grokcore.component/branches/sylvain-subscribers/src/grokcore/component/meta.py 2011-01-30 15:03:51 UTC (rev 120013)
+++ grokcore.component/branches/sylvain-subscribers/src/grokcore/component/meta.py 2011-01-31 09:46:18 UTC (rev 120014)
@@ -137,8 +137,10 @@
for function in adapters:
if function in subscribers:
- # We don't register function that uses the
- # grok.subscribe directive with grok.implementer.
+ # We don't register functions that are decorated with
+ # grok.implementer() *and* the grok.subscribe()
+ # decorator. These are registered as so called
+ # subcribers and not as regular adapters.
continue
interfaces = getattr(function, '__component_adapts__', None)
if interfaces is None:
@@ -219,11 +221,11 @@
implemented = list(implementedBy(factory))
if len(implemented) == 1:
provides = implemented[0]
-
- # provideHandler is the same as
- # provideSubscriptionAdapter, where provides=None. You
- # can't use provideSubscriptionAdapter with provides=None
- # since None is used as a marker value.
+ # provideHandler is essentially the same as
+ # provideSubscriptionAdapter, where
+ # provided=None. However, handlers and subscription
+ # adapters are tracked in separately so we cannot exchange
+ # one registration call for the the other.
if provides is None:
config.action(
discriminator=None,
More information about the checkins
mailing list