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

Sidnei da Silva sidnei at x3ng.com.br
Sat Jan 18 12:58:18 EST 2003


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

Modified Files:
	NZOMigrate.py 
Log Message:
fix a buglet on folder creation and harmful use of acquisition

=== Products/ZopeOrg-NV/Extensions/NZOMigrate.py 1.7 => 1.8 ===
 
         r.update_data(data, content_type, size)
         r.setPlatform(platform)
-        r.setMaturity(maturity)
-        r.setInfoURL(info_url)
-        r.setLicenseURL(license_url)
-        r.setChangesURL(changes_url)
-        r.setInstallationURL(installation_url)
-        r.setLicense(license)
+        f.setMaturity(maturity)
+        f.setInfoURL(info_url)
+        f.setLicenseURL(license_url)
+        f.setChangesURL(changes_url)
+        f.setInstallationURL(installation_url)
+        f.setLicense(license)
 
         return f
 
@@ -392,12 +392,12 @@
     def Folder2CMFPortalFolder(self, obj, source, dest):
         if dest is None or obj is None: return None
         try:
-            dest.manage_addFolder(obj.getId(), obj.title)
+            dest.invokeFactory(id=obj.getId(), type_name="Folder")
+            dest.setTitle(obj.title)
         except: pass
-        new = getattr(dest, obj.getId(), None)
-        if new is not None and hasattr(new, 'portal_type') and\
-               new.portal_type == "Folder":
-            return new
+        new = getattr(aq_base(dest), obj.getId(), None)
+        if new is not None and hasattr(aq_base(new), 'objectValues'):
+            return new.__of__(dest)
         return None
 
     def BTreeFolder2CMFBTreeFolder(self, obj, source, dest):
@@ -406,10 +406,9 @@
             bt2 = dest.manage_addProduct['BTreeFolder2']
             bt2.manage_addCMFBTreeFolder(obj.getId(), obj.title)
         except: pass
-        new = getattr(dest, obj.getId(), None)
-        if new is not None and hasattr(new, 'portal_type') and\
-               new.portal_type == "Folder":
-            return new
+        new = getattr(aq_base(dest), obj.getId(), None)
+        if new is not None and hasattr(aq_base(new), 'objectValues'):
+            return new.__of__(dest)
         return None
 
     def WikiMethodsCleanup(self, obj, ignore_path):





More information about the zopeorg-checkins mailing list