|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: init.py,v 1.34 2004-11-09 23:12:12 richard Exp $ |
| 18 | +# $Id: init.py,v 1.35 2004-11-24 07:03:47 a1s Exp $ |
19 | 19 |
|
20 | 20 | """Init (create) a roundup instance. |
21 | 21 | """ |
22 | 22 | __docformat__ = 'restructuredtext' |
23 | 23 |
|
24 | | -import os, sys, errno, rfc822 |
| 24 | +import os, errno, rfc822 |
25 | 25 |
|
26 | | -import roundup.instance |
27 | 26 | from roundup import install_util, password |
28 | 27 | from roundup.configuration import CoreConfig |
| 28 | +from roundup.i18n import _ |
29 | 29 |
|
30 | 30 | def copytree(src, dst, symlinks=0): |
31 | 31 | """Recursively copy a directory tree using copyDigestedFile(). |
@@ -98,8 +98,7 @@ def install(instance_home, template): |
98 | 98 | # if there is no config.ini or old-style config.py |
99 | 99 | # installed from the template, write default config text |
100 | 100 | config_ini_file = os.path.join(instance_home, CoreConfig.INI_FILE) |
101 | | - if not (os.path.isfile(config_ini_file) |
102 | | - or os.path.isfile(os.path.join(instance_home, 'config.py'))): |
| 101 | + if not os.path.isfile(config_ini_file): |
103 | 102 | config = CoreConfig() |
104 | 103 | config.save(config_ini_file) |
105 | 104 |
|
@@ -129,6 +128,12 @@ def loadTemplateInfo(dir): |
129 | 128 | if not os.path.exists(ti): |
130 | 129 | return None |
131 | 130 |
|
| 131 | + if os.path.exists(os.path.join(dir, 'config.py')): |
| 132 | + print _("WARNING: directory '%s'\n" |
| 133 | + "\tcontains old-style template - ignored" |
| 134 | + ) % os.path.abspath(dir) |
| 135 | + return None |
| 136 | + |
132 | 137 | # load up the template's information |
133 | 138 | f = open(ti) |
134 | 139 | try: |
|
0 commit comments