[Zope-Checkins] CVS: Zope/lib/python/Interface - Implements.py:1.3.6.2

Christian 'Tiran' Heimes heimes at faho.rwth-aachen.de
Thu Feb 26 21:51:38 EST 2004


Update of /cvs-repository/Zope/lib/python/Interface
In directory cvs.zope.org:/tmp/cvs-serv27634/lib/python/Interface

Modified Files:
      Tag: Zope-2_6-branch
	Implements.py 
Log Message:
Checking in my fix to the interface package from zope-2_7-branch to zope-2_6-branch.
I applied a patch to Implements.py some month ago to fix nested interfaces but I forgot to check it into this branch. Because of the missing fix some interface tests were broken on Zope 2.6.x. Thx to Stefan Holek to point me on this problem.


=== Zope/lib/python/Interface/Implements.py 1.3.6.1 => 1.3.6.2 ===
--- Zope/lib/python/Interface/Implements.py:1.3.6.1	Wed Feb 12 03:43:26 2003
+++ Zope/lib/python/Interface/Implements.py	Thu Feb 26 21:51:37 2004
@@ -128,10 +128,19 @@
         for b in bases:
             _flatten(b, append)
 
+def _detuplize(interface, append):
+    if type(interface) is TupleType:
+        for subinterface in interface:
+             _detuplize(subinterface, append)
+    else:
+        append(interface)
 
 def flattenInterfaces(interfaces, remove_duplicates=1):
+    detupledInterfaces = []
+    for interface in interfaces:
+        _detuplize(interface, detupledInterfaces.append)
     res = []
-    for i in interfaces:
+    for i in detupledInterfaces:
         _flatten(i, res.append)
     if remove_duplicates:
         # Remove duplicates in reverse.




More information about the Zope-Checkins mailing list