[Zope-CVS] CVS: Products/Ape/apelib/zope2 - fsmapper.py:1.3

Shane Hathaway shane@zope.com
Sat, 29 Mar 2003 21:15:14 -0500


Update of /cvs-repository/Products/Ape/apelib/zope2
In directory cvs.zope.org:/tmp/cvs-serv7510/zope2

Modified Files:
	fsmapper.py 
Log Message:
- Finished the plumbing for writing template and script files in text
mode.

- Fixed an intermittent conflict error resulting from mismanagement of
SQL-based modification times.


=== Products/Ape/apelib/zope2/fsmapper.py 1.2 => 1.3 ===
--- Products/Ape/apelib/zope2/fsmapper.py:1.2	Sat Mar 29 17:27:51 2003
+++ Products/Ape/apelib/zope2/fsmapper.py	Sat Mar 29 21:15:14 2003
@@ -34,7 +34,8 @@
     root_mapper.getClassifier().setGateway(
         classification.FSClassificationSection(conn))
     root_mapper.setKeychainGenerator(keygen.PathKeychainGenerator())
-    file_data = structure.FSFileData(conn)
+    file_binary_data = structure.FSFileData(conn, text=0)
+    file_text_data = structure.FSFileData(conn, text=1)
 
     # abstract base gateway
     g = gateways.CompositeGateway()
@@ -58,34 +59,34 @@
 
     # page template gateway
     g = gateways.CompositeGateway(base_p)
-    g.addGateway('text', file_data)
+    g.addGateway('text', file_text_data)
     root_mapper.getSubMapper('ZopePageTemplate').setGateway(g)
 
     # dtml method gateway
     g = gateways.CompositeGateway(base)
-    g.addGateway('text', file_data)
+    g.addGateway('text', file_text_data)
     root_mapper.getSubMapper('OFS.DTMLMethod.DTMLMethod').setGateway(g)
     
     # dtml document gateway
     g = gateways.CompositeGateway(base_p)
-    g.addGateway('text', file_data)
+    g.addGateway('text', file_text_data)
     root_mapper.getSubMapper('OFS.DTMLDocument.DTMLDocument').setGateway(g)
 
     # zsqlmethod mapper
     g = gateways.CompositeGateway(base)
-    g.addGateway('text', file_data)
+    g.addGateway('text', file_text_data)
     g.addGateway('properties', properties.FSProperties(
         conn, 'ZSQL Properties'), 1)
     root_mapper.getSubMapper('Products.ZSQLMethods.SQL.SQL').setGateway(g)
 
     # python script mapper
     g = gateways.CompositeGateway(base)
-    g.addGateway('body', file_data)
+    g.addGateway('body', file_text_data)
     root_mapper.getSubMapper('PythonScript').setGateway(g)
 
     # file gateway
     g = gateways.CompositeGateway(base_p)
-    g.addGateway('data', file_data)
+    g.addGateway('data', file_binary_data)
     root_mapper.getSubMapper('OFS.Image.File').setGateway(g)
 
     # image gateway is identical
@@ -103,7 +104,7 @@
 
     # anyfile object gateway
     g = gateways.CompositeGateway(base_p)
-    g.addGateway('remainder', file_data, 1)
+    g.addGateway('remainder', file_binary_data, 1)
     root_mapper.getSubMapper('anyfile').setGateway(g)
 
     # application gateway