[zopeorg-checkins] CVS: Products/ZopeOrg-NV/Extensions - NZOMigrate.py:1.7

Sidnei da Silva sidnei at x3ng.com.br
Sun Jan 12 12:59:58 EST 2003


Update of /cvs-zopeorg/Products/ZopeOrg-NV/Extensions
In directory cvs.zope.org:/tmp/cvs-serv7666/Extensions

Modified Files:
	NZOMigrate.py 
Log Message:
fix string.join. added creation_date to migration. cleanup a bit the log. a typo.

=== Products/ZopeOrg-NV/Extensions/NZOMigrate.py 1.6 => 1.7 ===
 from StringIO import StringIO
 from ZODB.POSException import POSKeyError
-from Acquisition import aq_base
+from Acquisition import aq_base, aq_parent, aq_inner
 from Products.CMFCore.utils import getToolByName
 from DateTime import DateTime
 import zLOG
@@ -95,14 +95,14 @@
             if udb is not None:
                 ob._owner = udb, uid
                 res.append('Changed ownership of %s from %s!%s to %s!%s' %
-                           (join(ob.getPhysicalPath(), '/'),
-                            join(old_udb, '/'), uid,
-                            join(udb, '/'), uid,))
+                           ('/'.join(ob.getPhysicalPath()),
+                            '/'.join(old_udb), uid,
+                            '/'.join(udb), uid,))
             else:
                 res.append('Could not fix the ownership of %s, '
                            'which is set to %s!%s' %
-                           (join(ob.getPhysicalPath(), '/'),
-                            join(old_udb, '/'), uid,))
+                           ('/'.join(ob.getPhysicalPath()),
+                            '/'.join(old_udb), uid,))
                 
     if cleanup_children:
         if hasattr(ob, 'objectValues'):
@@ -469,6 +469,7 @@
         mod_date = orig.bobobase_modification_time().ISO()
         if hasattr(aq_base(new), 'setModificationDate'):
             new.setModificationDate(mod_date)
+            new.creation_date = DateTime(mod_date)
         return new
 
     def copyProperties(self, orig, new):
@@ -529,8 +530,9 @@
                     new_obj = self.fixOwnership(obj, new_obj)
                     new_obj = self.copyProperties(obj, new_obj)
                     res = []
-                    new_obj = _cleanupOwnership(obj, res, 0)
-                    self.log('\n'.join(res))
+                    res = _cleanupOwnership(new_obj, res, 0)
+                    if res != []:
+                        self.log('\n'.join(res))
                     new_obj = self.fixModificationDate(obj, new_obj)
 
                     ct = getToolByName(new_obj, 'portal_catalog', None)





More information about the zopeorg-checkins mailing list