[Zodb-checkins] CVS: Zope3/src/zodb/zeo - client.py:1.10

Jim Fulton jim at zope.com
Fri Apr 18 19:12:58 EDT 2003


Update of /cvs-repository/Zope3/src/zodb/zeo
In directory cvs.zope.org:/tmp/cvs-serv8556/src/zodb/zeo

Modified Files:
	client.py 
Log Message:
In prepration for the upcoming interface changes, I added some
new functions for making interface assertions on instances.  

Rather than:

  class C:

     __class_implements__ = I1, I2

use:

  class C:

     classProvides(I1, I2)

rather than:

__implements__ = I1, I2

use:

moduleProvides(I1, I2)

rather than:

someinstance.__implements__ = I1, I2

use:

directlyProvides(I1, I2)

Note that interface assertions on persistent objects should be aboided
since the internal representation will change.

Continue to make assertions about the interfaces that class instances
implement the same way:

  class C:

     __implements__ = I1, I2


I also modified the core software to use the new spellings.



=== Zope3/src/zodb/zeo/client.py 1.9 => 1.10 ===
--- Zope3/src/zodb/zeo/client.py:1.9	Wed Apr  9 18:44:16 2003
+++ Zope3/src/zodb/zeo/client.py	Fri Apr 18 18:12:26 2003
@@ -30,6 +30,8 @@
 import time
 import logging
 
+from zope.interface import directlyProvides
+
 from zodb.zeo import cache
 from zodb.zeo.stubs import StorageServerStub
 from zodb.zeo.tbuf import TransactionBuffer
@@ -408,7 +410,7 @@
                 L.append(IUndoStorage)
             elif name == "IVersionStorage":
                 L.append(IVersionStorage)
-        self.__implements__ = tuple(L)
+        directlyProvides(self, *L)
 
     def set_server_addr(self, addr):
         # Normalize server address and convert to string




More information about the Zodb-checkins mailing list