[Zope3-checkins] CVS: Zope3/src/zope/app - introspector.py:1.14
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Aug 12 17:58:42 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv32153/src/zope/app
Modified Files:
introspector.py
Log Message:
Fixed introspector a little bit, so that ftests pass.
=== Zope3/src/zope/app/introspector.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/introspector.py:1.13 Mon Aug 11 12:55:21 2003
+++ Zope3/src/zope/app/introspector.py Tue Aug 12 16:58:37 2003
@@ -127,7 +127,8 @@
def getExtends(self):
"""Returns all the class extended up to the top most level"""
- bases = self._unpackTuple(removeAllProxies(self.currentclass).__bases__)
+ bases = self._unpackTuple(
+ removeAllProxies(self.currentclass).__bases__)
return bases
def getInterfaceRegistration(self):
@@ -189,7 +190,8 @@
if name == 'None':
return None
service = getService(context, Interfaces)
- return service.getInterface(name)
+ iface = service.getInterface(name)
+ return iface
def interfaceToName(context, interface):
interface = removeAllProxies(interface)
@@ -200,6 +202,8 @@
ids = [id for id, iface in items
if iface == interface]
if not ids:
- raise ComponentLookupError, interface
+ # Not every interface must be registered with the interface service;
+ # However the lookup should not fail, since this is just a name
+ return interface.__module__ + '.' + interface.__name__
assert len(ids) == 1, "Ambiguous interface names: %s" % ids
return ids[0]
More information about the Zope3-Checkins
mailing list