Mercurial > p > roundup > code
changeset 2953:1e7a3c001c6a
ignore old-style tracker templates [SF#1071402]; remove unused imports
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Wed, 24 Nov 2004 07:03:47 +0000 |
| parents | 1535b4b5d746 |
| children | 15620de288b1 |
| files | roundup/init.py |
| diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/init.py Wed Nov 24 05:16:15 2004 +0000 +++ b/roundup/init.py Wed Nov 24 07:03:47 2004 +0000 @@ -15,17 +15,17 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: init.py,v 1.34 2004-11-09 23:12:12 richard Exp $ +# $Id: init.py,v 1.35 2004-11-24 07:03:47 a1s Exp $ """Init (create) a roundup instance. """ __docformat__ = 'restructuredtext' -import os, sys, errno, rfc822 +import os, errno, rfc822 -import roundup.instance from roundup import install_util, password from roundup.configuration import CoreConfig +from roundup.i18n import _ def copytree(src, dst, symlinks=0): """Recursively copy a directory tree using copyDigestedFile(). @@ -98,8 +98,7 @@ # if there is no config.ini or old-style config.py # installed from the template, write default config text config_ini_file = os.path.join(instance_home, CoreConfig.INI_FILE) - if not (os.path.isfile(config_ini_file) - or os.path.isfile(os.path.join(instance_home, 'config.py'))): + if not os.path.isfile(config_ini_file): config = CoreConfig() config.save(config_ini_file) @@ -129,6 +128,12 @@ if not os.path.exists(ti): return None + if os.path.exists(os.path.join(dir, 'config.py')): + print _("WARNING: directory '%s'\n" + "\tcontains old-style template - ignored" + ) % os.path.abspath(dir) + return None + # load up the template's information f = open(ti) try:
