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

Philipp von Weitershausen philikon@philikon.de
Fri, 6 Jun 2003 12:01:31 -0400


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

Modified Files:
	useconfiguration.py 
Log Message:
Simplified flattening interfaces.


=== Zope3/src/zope/app/browser/services/utility/useconfiguration.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/services/utility/useconfiguration.py:1.9	Thu Jun  5 16:13:08 2003
+++ Zope3/src/zope/app/browser/services/utility/useconfiguration.py	Fri Jun  6 12:01:30 2003
@@ -24,7 +24,7 @@
      import Unregistered, Registered, Active
 from zope.app.traversing import getPath, getParent, objectName
 from zope.component import getServiceManager, getView, getAdapter
-from zope.interface.implements import flattenInterfaces
+from zope.interface import providedBy
 from zope.proxy import removeAllProxies
 from zope.publisher.browser import BrowserView
 
@@ -36,17 +36,8 @@
     def __call__(self):
         field = self.context
         component = field.context
-        # XXX Have to remove proxies because flattenInterfaces
-        #     doesn't work with proxies.
-        bare = removeAllProxies(component)
-        # Compute the list of interfaces that the component implements
-        interfaces = [
-            interface
-            for interface in flattenInterfaces(bare.__implements__)
-            if list(interface) # Does the interface define any names
-            ]
         result = ['\n<select name="%s">' % self.name]
-        for interface in interfaces:
+        for interface in providedBy(component).flattened():
             result.append('  <option value="%s.%s">%s</option>' %
                           (interface.__module__, interface.__name__,
                            interface.__name__))