[Erp5-report] r33097 luke - in /erp5/trunk/utils/erp5.recipe.createsite: ./ src/erp5/recipe...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Feb 24 16:57:37 CET 2010


Author: luke
Date: Wed Feb 24 16:57:36 2010
New Revision: 33097

URL: http://svn.erp5.org?rev=33097&view=rev
Log:
 - added support for multiple Business Template paths

Modified:
    erp5/trunk/utils/erp5.recipe.createsite/CHANGES.txt
    erp5/trunk/utils/erp5.recipe.createsite/README.txt
    erp5/trunk/utils/erp5.recipe.createsite/setup.py
    erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/__init__.py
    erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/create_erp5_instance.py

Modified: erp5/trunk/utils/erp5.recipe.createsite/CHANGES.txt
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.createsite/CHANGES.txt?rev=33097&r1=33096&r2=33097&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.createsite/CHANGES.txt [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.createsite/CHANGES.txt [utf8] Wed Feb 24 16:57:36 2010
@@ -1,5 +1,10 @@
 Changelog
 =========
+
+1.0.1 (2010-02-24)
+------------------
+
+- added support for multiple Business Template paths
 
 1.0 (2010-01-19)
 ----------------

Modified: erp5/trunk/utils/erp5.recipe.createsite/README.txt
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.createsite/README.txt?rev=33097&r1=33096&r2=33097&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.createsite/README.txt [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.createsite/README.txt [utf8] Wed Feb 24 16:57:36 2010
@@ -14,7 +14,9 @@
   portal_id = erp5
   control-script = ${erp5_instance:control-script}
   user = admin:admin
-  bt5-path = ${download_bt5:location}
+  bt5-path =
+    ${download_bt5:location}
+    ${other_download_bt5:location}
   bt5 =
     erp5_base
     erp5_pdm

Modified: erp5/trunk/utils/erp5.recipe.createsite/setup.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.createsite/setup.py?rev=33097&r1=33096&r2=33097&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.createsite/setup.py [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.createsite/setup.py [utf8] Wed Feb 24 16:57:36 2010
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 
 name = "erp5.recipe.createsite"
-version = '1.0'
+version = '1.0.1'
 
 def read(name):
     return open(name).read()

Modified: erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/__init__.py?rev=33097&r1=33096&r2=33097&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/__init__.py [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/__init__.py [utf8] Wed Feb 24 16:57:36 2010
@@ -65,8 +65,11 @@
             argv.extend(['--initial-user',
                         options['user']])
 
-        argv.extend(['--bt5-path',
-                    os.path.join(options['bt5-path'])])
+        path_list = []
+        for path in options['bt5-path'].split('\n'):
+          if path:
+            path_list.append(path)
+        argv.extend(['--bt5-path', ','.join(path_list)])
         argv.extend([bt for bt in options.get('bt5', '').split('\n') if bt])
 
         assert os.spawnl(

Modified: erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/create_erp5_instance.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/create_erp5_instance.py?rev=33097&r1=33096&r2=33097&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/create_erp5_instance.py [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.createsite/src/erp5/recipe/createsite/create_erp5_instance.py [utf8] Wed Feb 24 16:57:36 2010
@@ -28,7 +28,8 @@
                   default="zope:zope")
 parser.add_option("--bt5-path",
                   dest="bt5_path",
-                  help="Path to folder containing business templates",
+                  help="Path to folder containing business templates. "
+                  "Can be multiple, separated by commas.",
                   default="bt5")
 
 (options, args) = parser.parse_args()
@@ -90,8 +91,19 @@
 
 # install our business templates
 bt5_list = []
+bt5_path_list = options.bt5_path.split(',')
+
 for arg in args:
-  bt_path = os.path.join(options.bt5_path, arg)
+  bt_path = None
+  for path in bt5_path_list:
+    bt_path = os.path.join(path, arg)
+    if os.path.exists(bt_path):
+      break
+    else:
+      bt_path = None
+  if bt_path is None:
+    raise ValueError('Business Template %s not found in paths %s' % (arg,
+      options.bt5_path))
   installed_bt = portal.portal_templates.getInstalledBusinessTemplate(arg)
   if installed_bt is not None:
     # XXX this way works only for extracted business template, not for




More information about the Erp5-report mailing list