[Zope3-checkins] CVS: Zope3/utilities/fssync - checkout.py:1.3

Guido van Rossum guido@python.org
Mon, 5 May 2003 17:24:32 -0400


Update of /cvs-repository/Zope3/utilities/fssync
In directory cvs.zope.org:/tmp/cvs-serv31593

Modified Files:
	checkout.py 
Log Message:
Remove all traces of setPrint().

=== Zope3/utilities/fssync/checkout.py 1.2 => 1.3 ===
--- Zope3/utilities/fssync/checkout.py:1.2	Mon May  5 14:01:03 2003
+++ Zope3/utilities/fssync/checkout.py	Mon May  5 17:24:32 2003
@@ -12,17 +12,14 @@
 #
 ##############################################################################
 
-import string, os
+import os
 
 from zope.app.fssync.syncer import toFS
 
 from common import getObject, getApplicationRoot
 from common import makeNewEntry, getObjectAdapter
 
-def checkout(fspath
-             , dbpath
-             , siteconfpath
-             , objpath):
+def checkout(fspath, dbpath, siteconfpath, objpath):
     """Checks out objects from ZODB to the file system
 
     Downloads ZODB objects in file system to the specified path
@@ -30,38 +27,32 @@
     """
     sandbox_path = fspath
     if not os.path.isabs(objpath):
-        objpath = '/'+objpath
+        objpath = '/' + objpath
     objpath = os.path.abspath(objpath)
     root = getApplicationRoot(dbpath, siteconfpath)
     main_ob = getObject(objpath, root)
     ob_name = os.path.basename(objpath)
     if main_ob is not None:
         path = ''
-        for dir in string.split(objpath[:string.rfind(objpath,ob_name)], '/')[1:-1]:
-            path = os.path.join(path,dir)
+        for dir in objpath[:objpath.rfind(ob_name)].split('/')[1:-1]:
+            path = os.path.join(path, dir)
             sandbox_path = os.path.join(fspath, path)
             admin_dir = os.path.join(os.path.dirname(sandbox_path), '@@Zope')
             entries_path = os.path.join(os.path.dirname(sandbox_path),
-                                        '@@Zope'
-                                        , 'Entries.xml')
+                                        '@@Zope', 'Entries.xml')
             if not os.path.exists(sandbox_path):
                 os.mkdir(sandbox_path)
             if not os.path.exists(admin_dir):
                 os.mkdir(admin_dir)
             if not os.path.exists(entries_path):
                 makeNewEntry(admin_dir)
-
             o_path = '/'+path
             ob = getObject(o_path, root)
             adapter = getObjectAdapter(ob)
             type = adapter.typeIdentifier()
             factory = adapter.factory()
             name = os.path.basename(o_path)
-            makeNewEntry(admin_dir
-                         , name
-                         , type
-                         , factory
-                         , o_path)
+            makeNewEntry(admin_dir, name, type, factory, o_path)
 
         fspath = sandbox_path
         toFS(main_ob, ob_name, fspath)