Mercurial > p > roundup > code
comparison roundup/init.py @ 3432:3876b94ffe8c
install: accept configuration setting overrides
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 03 Dec 2005 11:22:50 +0000 |
| parents | 1e7a3c001c6a |
| children | c8b0a23ba38d |
comparison
equal
deleted
inserted
replaced
| 3431:26dc6b92ac26 | 3432:3876b94ffe8c |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: init.py,v 1.35 2004-11-24 07:03:47 a1s Exp $ | 18 # $Id: init.py,v 1.36 2005-12-03 11:22:50 a1s Exp $ |
| 19 | 19 |
| 20 """Init (create) a roundup instance. | 20 """Init (create) a roundup instance. |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 53 elif os.path.isdir(srcname): | 53 elif os.path.isdir(srcname): |
| 54 copytree(srcname, dstname, symlinks) | 54 copytree(srcname, dstname, symlinks) |
| 55 else: | 55 else: |
| 56 install_util.copyDigestedFile(srcname, dstname) | 56 install_util.copyDigestedFile(srcname, dstname) |
| 57 | 57 |
| 58 def install(instance_home, template): | 58 def install(instance_home, template, settings={}): |
| 59 '''Install an instance using the named template and backend. | 59 '''Install an instance using the named template and backend. |
| 60 | 60 |
| 61 'instance_home' | 61 'instance_home' |
| 62 the directory to place the instance data in | 62 the directory to place the instance data in |
| 63 'template' | 63 'template' |
| 64 the directory holding the template to use in creating the instance data | 64 the directory holding the template to use in creating the instance data |
| 65 'settings' | |
| 66 config.ini setting overrides (dictionary) | |
| 65 | 67 |
| 66 The instance_home directory will be created using the files found in | 68 The instance_home directory will be created using the files found in |
| 67 the named template (roundup.templates.<name>). A usual instance_home | 69 the named template (roundup.templates.<name>). A usual instance_home |
| 68 contains: | 70 contains: |
| 69 | 71 |
| 97 | 99 |
| 98 # if there is no config.ini or old-style config.py | 100 # if there is no config.ini or old-style config.py |
| 99 # installed from the template, write default config text | 101 # installed from the template, write default config text |
| 100 config_ini_file = os.path.join(instance_home, CoreConfig.INI_FILE) | 102 config_ini_file = os.path.join(instance_home, CoreConfig.INI_FILE) |
| 101 if not os.path.isfile(config_ini_file): | 103 if not os.path.isfile(config_ini_file): |
| 102 config = CoreConfig() | 104 config = CoreConfig(settings=settings) |
| 103 config.save(config_ini_file) | 105 config.save(config_ini_file) |
| 104 | 106 |
| 105 | 107 |
| 106 def listTemplates(dir): | 108 def listTemplates(dir): |
| 107 ''' List all the Roundup template directories in a given directory. | 109 ''' List all the Roundup template directories in a given directory. |
