[Zodb-checkins] CVS: ZODB3/ZEO - ClientStorage.py:1.97
Jeremy Hylton
jeremy at zope.com
Fri May 23 18:34:41 EDT 2003
Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv13675/ZEO
Modified Files:
ClientStorage.py
Log Message:
Handle extension methods explicitly rather than be getattr hack.
=== ZODB3/ZEO/ClientStorage.py 1.96 => 1.97 ===
--- ZODB3/ZEO/ClientStorage.py:1.96 Wed Apr 30 13:14:33 2003
+++ ZODB3/ZEO/ClientStorage.py Fri May 23 17:34:40 2003
@@ -416,11 +416,16 @@
stub = self.StorageServerStubClass(conn)
self._oids = []
self._info.update(stub.get_info())
+ self._handle_extensions()
self.verify_cache(stub)
if not conn.is_async():
log2(INFO, "Waiting for cache verification to finish")
self._wait_sync()
+ def _handle_extensions(self):
+ for name in self.getExtensionMethods():
+ setattr(self, name, self._server.extensionMethod(name))
+
def set_server_addr(self, addr):
# Normalize server address and convert to string
if isinstance(addr, types.StringType):
@@ -548,7 +553,7 @@
Dictionary values should be None; this will be a handy place
for extra marshalling information, should we need it
"""
- return self._info['extensionMethods']
+ return self._info.get('extensionMethods', {})
def supportsUndo(self):
"""Storage API: return whether we support undo."""
@@ -619,12 +624,6 @@
"""
return self._server.history(oid, version, length)
- def __getattr__(self, name):
- if self.getExtensionMethods().has_key(name):
- return self._server.extensionMethod(name)
- else:
- raise AttributeError(name)
-
def loadSerial(self, oid, serial):
"""Storage API: load a historical revision of an object."""
return self._server.loadSerial(oid, serial)
@@ -757,7 +756,6 @@
self._tbuf.clear()
self._seriald.clear()
del self._serials[:]
- self._tbuf.clear()
def end_transaction(self):
"""Internal helper to end a transaction."""
More information about the Zodb-checkins
mailing list