[Zope-CVS] CVS: Products/AdaptableStorage/zodb - ASStorage.py:1.8

Shane Hathaway shane@zope.com
Tue, 31 Dec 2002 16:09:06 -0500


Update of /cvs-repository/Products/AdaptableStorage/zodb
In directory cvs.zope.org:/tmp/cvs-serv13064/zodb

Modified Files:
	ASStorage.py 
Log Message:
- Added ITPCConnection.  It doesn't really belong in the serial
package, but there's no other good place for it right now.

- FSConnection now allows a hidden filename prefix other than
".", such as "_", taking advantage of the fact that the Zope 2 security
model disallows leading underscores.

- Added some more docs.


=== Products/AdaptableStorage/zodb/ASStorage.py 1.7 => 1.8 ===
--- Products/AdaptableStorage/zodb/ASStorage.py:1.7	Mon Dec 23 23:29:34 2002
+++ Products/AdaptableStorage/zodb/ASStorage.py	Tue Dec 31 16:09:06 2002
@@ -21,7 +21,7 @@
 from cStringIO import StringIO
 
 from ZODB import POSException, BaseStorage
-from serial_public import MapperEvent
+from serial_public import MapperEvent, ITPCConnection
 
 from consts import SERIAL0, SERIAL1, DEBUG
 from OIDEncoder import OIDEncoder
@@ -43,17 +43,21 @@
         sort_keys = []
         names = []
         try:
+            opened = []
             for c in tpc_conns:
+                if not ITPCConnection.isImplementedBy(c):
+                    raise RuntimeError('%s is not an ITPCConnection' % repr(c))
                 c.connect()
+                opened.append(c)
                 sort_keys.append(c.sortKey())
                 names.append(c.getName())
         except:
-            for c in tpc_conns:
+            for c in opened:
                 c.close()
             raise
         self._sort_key = tuple(sort_keys)
         if not name:
-            name = 'AdaptableStorage: ' + ', '.join(names)
+            name = 'ASStorage: ' + ', '.join(names)
         BaseStorage.BaseStorage.__init__(self, name)
 
     def __len__(self):