[Zope-CVS] CVS: Products/AdaptableStorage/mapper_std - MappingGateway.py:1.2
Shane Hathaway
shane@zope.com
Thu, 9 Jan 2003 09:34:38 -0500
Update of /cvs-repository/Products/AdaptableStorage/mapper_std
In directory cvs.zope.org:/tmp/cvs-serv19323/mapper_std
Modified Files:
MappingGateway.py
Log Message:
- Added LoadEvent and StoreEvent, which currently serve only to
clarify the code.
- Added tests of conflict detection.
- Added NoStateFoundError. Classification gateways now raise
NoStateFoundError at the right times so it's possible to detect
attempts to overwrite state with new objects
- Made it easier for a SQL gateway to use multiple tables by adding a
setupTables() method to SQLGatewayBase
- Made FieldSchema.addFieldType public.
=== Products/AdaptableStorage/mapper_std/MappingGateway.py 1.1 => 1.2 ===
--- Products/AdaptableStorage/mapper_std/MappingGateway.py:1.1 Tue Dec 31 16:47:47 2002
+++ Products/AdaptableStorage/mapper_std/MappingGateway.py Thu Jan 9 09:34:05 2003
@@ -18,7 +18,7 @@
import time
-from mapper_public import IGateway
+from mapper_public import IGateway, NoStateFoundError
class MappingGateway:
"""Stores data in a mapping."""
@@ -34,7 +34,11 @@
def load(self, event):
# Returns (data, serial)
- return self.data[event.getKeychain()]
+ keychain = event.getKeychain()
+ try:
+ return self.data[keychain]
+ except KeyError:
+ raise NoStateFoundError(keychain)
def store(self, event, data):
serial = time.time()