[Checkins] SVN: z3c.componentdebug/trunk/src/z3c/componentdebug/
Collect a list of available regs
Ross Patterson
me at rpatterson.net
Wed May 30 20:36:02 EDT 2007
Log message for revision 76027:
Collect a list of available regs
Changed:
U z3c.componentdebug/trunk/src/z3c/componentdebug/README.txt
U z3c.componentdebug/trunk/src/z3c/componentdebug/component.py
U z3c.componentdebug/trunk/src/z3c/componentdebug/tests/tests.py
-=-
Modified: z3c.componentdebug/trunk/src/z3c/componentdebug/README.txt
===================================================================
--- z3c.componentdebug/trunk/src/z3c/componentdebug/README.txt 2007-05-31 00:35:43 UTC (rev 76026)
+++ z3c.componentdebug/trunk/src/z3c/componentdebug/README.txt 2007-05-31 00:36:01 UTC (rev 76027)
@@ -77,12 +77,12 @@
>>> pprint([i for i in registrations.byObjects()])
[(<Foo object at ...>,
{<InterfaceClass __builtin__.IFoo>:
- AdapterRegistration(<BaseGlobalComponents base>, [IFoo, IBar],
- IBaz, '', getBaz, u'')}),
+ [AdapterRegistration(<BaseGlobalComponents base>, [IFoo, IBar],
+ IBaz, '', getBaz, u'')]}),
(<Bar object at ...>,
{<InterfaceClass __builtin__.IBar>:
- AdapterRegistration(<BaseGlobalComponents base>, [IFoo, IBar],
- IBaz, '', getBaz, u'')})]
+ [AdapterRegistration(<BaseGlobalComponents base>, [IFoo, IBar],
+ IBaz, '', getBaz, u'')]})]
When we remove one of the required interfaces, we can see what
regisration might have otherwise fulfilled the lookup and which object
@@ -97,6 +97,6 @@
>>> pprint([i for i in registrations.byObjects()])
[(<Foo object at ...>,
{<InterfaceClass __builtin__.IFoo>:
- AdapterRegistration(<BaseGlobalComponents base>, [IFoo, IBar],
- IBaz, '', getBaz, u'')}),
+ [AdapterRegistration(<BaseGlobalComponents base>, [IFoo, IBar],
+ IBaz, '', getBaz, u'')]}),
(<Bar object at ...>, {})]
Modified: z3c.componentdebug/trunk/src/z3c/componentdebug/component.py
===================================================================
--- z3c.componentdebug/trunk/src/z3c/componentdebug/component.py 2007-05-31 00:35:43 UTC (rev 76026)
+++ z3c.componentdebug/trunk/src/z3c/componentdebug/component.py 2007-05-31 00:36:01 UTC (rev 76027)
@@ -57,6 +57,6 @@
required = reg.required[idx]
for prov in provided:
if prov.isOrExtends(required):
- result[required] = reg
+ result.setdefault(required, []).append(reg)
break
yield object, result
Modified: z3c.componentdebug/trunk/src/z3c/componentdebug/tests/tests.py
===================================================================
--- z3c.componentdebug/trunk/src/z3c/componentdebug/tests/tests.py 2007-05-31 00:35:43 UTC (rev 76026)
+++ z3c.componentdebug/trunk/src/z3c/componentdebug/tests/tests.py 2007-05-31 00:36:01 UTC (rev 76027)
@@ -4,6 +4,7 @@
def test_suite():
suite = doctest.DocFileSuite(
'../README.txt',
+ 'component.txt',
optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE)
return suite
More information about the Checkins
mailing list