[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/interface - __init__.py:1.9

Jim Fulton jim at zope.com
Thu Dec 11 05:16:42 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/services/interface
In directory cvs.zope.org:/tmp/cvs-serv32764/src/zope/app/browser/services/interface

Modified Files:
	__init__.py 
Log Message:
Changed code for getting doc strings to use getattr
and fall back on an empty doc string if a doc string can't be
obtained.

Changed to use __name__ rather than getName.


=== Zope3/src/zope/app/browser/services/interface/__init__.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/services/interface/__init__.py:1.8	Wed Dec 10 01:55:31 2003
+++ Zope3/src/zope/app/browser/services/interface/__init__.py	Thu Dec 11 05:16:40 2003
@@ -45,7 +45,9 @@
         self.request = request
 
     def getInterfaces(self):
-        L = [(iface.__name__, id, iface.__doc__.split('\n')[0].strip())
+        L = [(iface.__name__, id,
+              getattr(iface, '__doc__', '').split('\n')[0].strip()
+              )
              for id, iface in self.context.items()]
         L.sort()
         return [{"id": id, "name": name, "doc": doc} for name, id, doc in L]
@@ -103,10 +105,10 @@
         from zope.proxy import getProxiedObject
         self.iface = getProxiedObject(iface)
         
-        self.name = self.iface.getName()
+        self.name = self.iface.__name__
         # XXX the doc string needs some formatting for presentation
         # XXX self.doc = self.iface.__doc__
-        self.doc = self.iface.getDoc()
+        self.doc = getattr(self.iface, '__doc__', '')
         self.methods = []
         self.schema = []
 




More information about the Zope3-Checkins mailing list