[Erp5-report] r33646 daniele - in /erp5/trunk/products/ERP5: Document/ Tool/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 11 14:46:28 CET 2010


Author: daniele
Date: Thu Mar 11 14:46:25 2010
New Revision: 33646

URL: http://svn.erp5.org?rev=33646&view=rev
Log:
Enable to export several business template at the same time

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py
    erp5/trunk/products/ERP5/Tool/TemplateTool.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=33646&r1=33645&r2=33646&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Thu Mar 11 14:46:25 2010
@@ -311,7 +311,7 @@
   def addObject(self, *kw):
     pass
 
-  def finishCreation(self, **kw):
+  def finishCreation(self, name=None, **kw):
     pass
 
 class BusinessTemplateFolder(BusinessTemplateArchive):
@@ -431,10 +431,10 @@
     f.write(str(obj))
     f.close()
 
-  def finishCreation(self):
-    self.tar.add(self.path)
+  def finishCreation(self, name):
+    self.tar.add(name)
     self.tar.close()
-    shutil.rmtree(self.path)
+    shutil.rmtree(name)
     return self.fobj
 
   def _initImport(self, file=None, **kw):
@@ -5508,7 +5508,7 @@
       for item_name in self._item_name_list:
         getattr(self, item_name).export(context=self, bta=bta)
 
-      return bta.finishCreation()
+      return bta.finishCreation(self.getTitle())
 
     security.declareProtected(Permissions.ManagePortal, 'importFile')
     def importFile(self, dir = 0, file=None, root_path=None):

Modified: erp5/trunk/products/ERP5/Tool/TemplateTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TemplateTool.py?rev=33646&r1=33645&r2=33646&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] Thu Mar 11 14:46:25 2010
@@ -218,7 +218,8 @@
       # XXX not thread safe
       current_directory = os.getcwd()
       os.chdir(tmpdir_path)
-      export_string = business_template.export(path=path)
+      absolute_path = os.path.abspath(path)
+      export_string = business_template.export(path=absolute_path)
       os.chdir(current_directory)
       if RESPONSE is not None:
         RESPONSE.setHeader('Content-type','tar/x-gzip')




More information about the Erp5-report mailing list