[Erp5-report] r36072 nicolas - /erp5/trunk/products/ERP5/Tool/TemplateTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 8 09:53:18 CEST 2010


Author: nicolas
Date: Tue Jun  8 09:53:17 2010
New Revision: 36072

URL: http://svn.erp5.org?rev=36072&view=rev
Log:
Extend installBusinessTemplatesFromRepositories with new update_catalog parameter.
It allow to disable the clearing catalog when installing business template.


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

Modified: erp5/trunk/products/ERP5/Tool/TemplateTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TemplateTool.py?rev=36072&r1=36071&r2=36072&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] Tue Jun  8 09:53:17 2010
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 ##############################################################################
 #
 # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
@@ -60,6 +61,8 @@
 
 
 WIN = os.name == 'nt'
+
+_MARKER = []
 
 class BusinessTemplateUnknownError(Exception):
   """ Exception raised when the business template
@@ -1042,7 +1045,7 @@
     security.declareProtected(Permissions.ManagePortal,
         'installBusinessTemplatesFromRepositories' )
     def installBusinessTemplatesFromRepositories(self, template_list,
-        only_newer=True):
+        only_newer=True, update_catalog=_MARKER):
       """Installs template_list from configured repositories by default only newest"""
       # XXX-Luke: This method could replace
       # TemplateTool_installRepositoryBusinessTemplateList while still being
@@ -1057,7 +1060,10 @@
               template_name]['revision']:
             template_document = self.download(template_dict[template_name][
               'url'])
-            template_document.install()
+            if update_catalog is _MARKER:
+              template_document.install()
+            else:
+              template_document.install(update_catalog=update_catalog)
             opreation_log.append('Installed %s with revision %s' % (
               template_document.getTitle(), template_document.getRevision()))
           else:




More information about the Erp5-report mailing list