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

Sidnei da Silva sidnei at x3ng.com.br
Fri Dec 27 15:08:46 EST 2002


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

Modified Files:
	NZOMigrate.py 
Log Message:
Fixed Software Package migration and a few other bits

=== Products/ZopeOrg-NV/Extensions/NZOMigrate.py 1.2 => 1.3 ===
     
     return res
 
+def massPublish(self):
+    wf_tool = getToolByName(self, 'portal_workflow')
+    if hasattr(self, 'objectValues'):
+        for subob in self.objectValues():
+            try: wf_tool.doActionFor(subob, 'publish')
+            except: pass
+            massPublish(subob)
+            
 class Transmutator:
 
     def __init__(self, source, dest, ignore_path, type_map):
@@ -197,6 +205,9 @@
         return f
 
     def ProductRelease2CMFSoftwareRelease(self, obj, source, dest):
+        if obj.getId() == 'Zope-2.5.x-to-2.5.1-linux2-x86.tgz':
+            import pdb
+            pdb.set_trace()
         dest.invokeFactory(id=obj.getId(), type_name='Software Release')
         f = getattr(dest, obj.getId())
         title = obj.title or ''
@@ -205,7 +216,7 @@
         f.setVersion(version)
 
         f.invokeFactory(id=obj.getId(), type_name='Software Release File')
-        r = getattr(dest, obj.getId())
+        r = getattr(f, obj.getId())
         platform = obj.platform
         maturity = obj.status
         info_url = obj.info_url
@@ -213,8 +224,10 @@
         changes_url = obj.changes_url
         installation_url = obj.installation_url
         license = obj.license
-        data, size = f._read_data(obj.data)
-        
+        data, size = obj._read_data(obj.data)
+        content_type = obj._get_content_type(obj.data, data, obj.__name__,
+                                            'application/octet-stream')
+
         r.update_data(data, content_type, size)
         r.setPlatform(platform)
         r.setMaturity(maturity)





More information about the zopeorg-checkins mailing list