[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - syncer.py:1.12

Guido van Rossum guido@python.org
Tue, 13 May 2003 14:53:46 -0400


Update of /cvs-repository/Zope3/src/zope/app/fssync
In directory cvs.zope.org:/tmp/cvs-serv27200

Modified Files:
	syncer.py 
Log Message:
Change the default of writeOriginals to False (we don't actually need
to write originals at all any more).

Don't die if a new directory has no @@Zope dir or Entries.xml file.


=== Zope3/src/zope/app/fssync/syncer.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.11	Sat May 10 20:16:05 2003
+++ Zope3/src/zope/app/fssync/syncer.py	Tue May 13 14:53:46 2003
@@ -50,7 +50,7 @@
 def dumpFile(obj, path):
     writeFile(dumps(obj), path)
 
-def toFS(ob, name, location, writeOriginals=True):
+def toFS(ob, name, location, writeOriginals=False):
     """Check an object out to the file system
 
     ob -- The object to be checked out
@@ -59,7 +59,7 @@
 
     location -- The directory on the file system where the object will go
 
-    writeOriginals -- If True (the default), write 'Original' directory.
+    writeOriginals -- If True, write 'Original' directory.  Default False.
     """
 
     # Get name path and check that name is not an absolute path
@@ -306,6 +306,9 @@
             raise SynchronizationError("Object is directory, but data is file")
 
         dir_entries_path = os.path.join(path, '@@Zope', 'Entries.xml')
-        dir_entries = loadFile(dir_entries_path)
+        if os.path.exists(dir_entries_path):
+            dir_entries = loadFile(dir_entries_path)
+        else:
+            dir_entries = {}
         for cname in dir_entries:
             fromFS(ob, cname, path)