[Zope-CVS] CVS: Products/Ape/apelib/fs - structure.py:1.3

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


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

Modified Files:
	structure.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/fs/structure.py 1.2 => 1.3 ===
--- Products/Ape/apelib/fs/structure.py:1.2	Sat Mar 29 17:27:49 2003
+++ Products/Ape/apelib/fs/structure.py	Sat Mar 29 21:15:12 2003
@@ -30,8 +30,9 @@
 
     schema = FieldSchema('data', 'string')
 
-    def __init__(self, fs_conn):
+    def __init__(self, fs_conn, text=0):
         self.fs_conn = fs_conn
+        self.text = text
 
     def getSchema(self):
         return self.schema
@@ -40,7 +41,7 @@
         c = self.fs_conn
         p = event.getKeychain()[-1]
         assert c.readNodeType(p) == 'f'
-        state = c.readData(p)
+        state = c.readData(p, as_text=self.text)
         return state, state
 
     def store(self, event, state):
@@ -49,7 +50,7 @@
         c = self.fs_conn
         p = event.getKeychain()[-1]
         c.writeNodeType(p, 'f')
-        c.writeData(p, state)
+        c.writeData(p, state, as_text=self.text)
         return state
 
 
@@ -123,7 +124,7 @@
 
     __implements__ = IGateway
 
-    schema = FieldSchema('mtime', 'float')
+    schema = FieldSchema('mtime', 'int')
 
     def __init__(self, fs_conn):
         self.fs_conn = fs_conn
@@ -133,7 +134,7 @@
 
     def load(self, event):
         p = event.getKey()
-        state = float(self.fs_conn.getModTime(p))
+        state = long(self.fs_conn.getModTime(p))
         return state, None  # Use None as the hash (see store())
 
     def store(self, event, state):