[Zope-CVS] CVS: Products/AdaptableStorage/serial_ofs - MetaTypeClassifier.py:1.10

Shane Hathaway shane@zope.com
Mon, 23 Dec 2002 23:30:04 -0500


Update of /cvs-repository/Products/AdaptableStorage/serial_ofs
In directory cvs.zope.org:/tmp/cvs-serv30532/serial_ofs

Modified Files:
	MetaTypeClassifier.py 
Log Message:
Provided a way to configure ObjectMappers, with the intent of making
AdaptableStorage easier to explain.  Added IConfigurableObjectMapper
and converted all the mapper setup code to use it.  Included a
checkConfiguration() method which validates the entire object mapper
tree.  Then converted the DBTab-based configuration to use a mapper
factory, which can point to any mapper factory function installed
anywhere.  Tangents to this:

- Refactored Zope2FS and Zope2SQL to use the same code for setting up
mappers, leaving "holes" for the gateways.

- Added connect() and close() methods to ITPCConnection (which doesn't
technically exist yet since I need to choose a name for it. ;-) )

- Factored out common parts of the SQL gateways.

- Implemented the newKey() method of IKeyedObjectSystem, which will
help ZEO environments, in theory.



=== Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py 1.9 => 1.10 ===
--- Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py:1.9	Mon Dec  9 17:11:07 2002
+++ Products/AdaptableStorage/serial_ofs/MetaTypeClassifier.py	Mon Dec 23 23:29:34 2002
@@ -30,12 +30,16 @@
 
     __implements__ = IClassifier
 
-    def __init__(self, gw):
+    def __init__(self, gw=None):
         self.gw = gw
         self.key_to_res = {}
         self.ext_to_mt = {}
         self.fmt_to_mt = {}
         self.mt_to_mapper = {}
+
+    def setGateway(self, gw):
+        self.gw = gw
+
 
     def register(self, meta_type, mapper_name, extensions=()):
         for ext in extensions: