[Zope3-dev] apidoc (and notfound) break the introspector 'modify'
button
Anthony Baxter
anthony at interlink.com.au
Mon Feb 9 22:50:21 EST 2004
At the moment, the 'introspector' modify button gives an error,
AttributeError: 'Implements' object has no attribute 'names'
from line 184 of zope/app/introspector.py
Modifying the code like so:
--- introspector.py 21 Nov 2003 17:10:44 -0000 1.19
+++ introspector.py 10 Feb 2004 03:34:19 -0000
@@ -181,6 +181,9 @@
results = []
iservice = getService(self.context, Interfaces)
for id, interface in iservice.items(base=base):
+ if not hasattr(interface, 'names'):
+ print "no names", interface
+ continue
if base in interface.__bases__ and not interface.names():
results.append(interface)
results.sort()
produces the following output:
no names <implementedBy zope.products.apidoc.zcmlmodule.Directive>
no names <implementedBy zope.products.apidoc.utilitymodule.Utility>
no names <implementedBy zope.products.apidoc.APIDocumentation>
no names <implementedBy zope.products.apidoc.servicemodule.Service>
no names <implementedBy zope.products.apidoc.classmodule.ClassModule>
no names <implementedBy zope.products.apidoc.servicemodule.Service>
no names <implementedBy zope.products.apidoc.utilitymodule.Utility>
no names <implementedBy zope.products.apidoc.utilitymodule.UtilityModule>
no names <implementedBy zope.products.apidoc.zcmlmodule.ZCMLModule>
no names <implementedBy zope.products.apidoc.viewmodule.ViewModule>
no names <implementedBy zope.publisher.interfaces.NotFound>
Looking further - the above are all of type
zope.interface.declarations.Implements
while everything else is of type
zope.interface.interface.InterfaceClass
The error is because Implements doesn't have a 'names' method.
I'm not sure if it's the introspector or the code doing the
provideInterface that's doing the wrong thing here.
Anyone?
More information about the Zope3-dev
mailing list