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

Sidnei da Silva sidnei at x3ng.com.br
Wed Aug 13 10:37:16 EDT 2003


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

Modified Files:
      Tag: dreamcatcher-ttwschema-branch
	__init__.py 
Log Message:
__name__-geddon. Use getName for getting the name of interfaces

=== Zope3/src/zope/app/browser/services/utility/__init__.py 1.8 => 1.8.2.1 ===
--- Zope3/src/zope/app/browser/services/utility/__init__.py:1.8	Thu Aug  7 13:41:39 2003
+++ Zope3/src/zope/app/browser/services/utility/__init__.py	Wed Aug 13 09:36:11 2003
@@ -25,7 +25,7 @@
 from zope.app import zapi
 from zope.interface import providedBy
 from zope.proxy import removeAllProxies
-
+from zope.app.introspector import interfaceToName
 
 class UtilityInterfaceWidget(InterfaceWidget):
     """Custom widget to select an interface from the component's interfaces.
@@ -37,8 +37,8 @@
         result = ['\n<select name="%s">' % self.name]
         for interface in providedBy(component).flattened():
             result.append('  <option value="%s.%s">%s</option>' %
-                          (interface.__module__, interface.__name__,
-                           interface.__name__))
+                          (interface.__module__, interface.getName(),
+                           interface.getName()))
         result.append('</select>')
         return '\n'.join(result)
         
@@ -172,7 +172,7 @@
             active = obj = cr.active()
             if obj is None:
                 obj = cr.info()[0]['registration'] # Pick a representative
-            ifname = _interface_name(iface)
+            ifname = interfaceToName(self.context, iface)
             d = {"interface": ifname,
                  "name": name,
                  "url": "",
@@ -199,7 +199,3 @@
         form = zapi.getView(regstack, "ChangeRegistrations", self.request)
         form.update()
         return form
-
-
-def _interface_name(iface):
-    return "%s.%s" % (iface.__module__, iface.__name__)




More information about the Zope3-Checkins mailing list