Skip to content

Commit b21047c

Browse files
author
Alexander Smishlajev
committed
ignore old-style tracker templates [SF#1071402]; remove unused imports
1 parent 5285979 commit b21047c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

roundup/init.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
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 $
1919

2020
"""Init (create) a roundup instance.
2121
"""
2222
__docformat__ = 'restructuredtext'
2323

24-
import os, sys, errno, rfc822
24+
import os, errno, rfc822
2525

26-
import roundup.instance
2726
from roundup import install_util, password
2827
from roundup.configuration import CoreConfig
28+
from roundup.i18n import _
2929

3030
def copytree(src, dst, symlinks=0):
3131
"""Recursively copy a directory tree using copyDigestedFile().
@@ -98,8 +98,7 @@ def install(instance_home, template):
9898
# if there is no config.ini or old-style config.py
9999
# installed from the template, write default config text
100100
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):
103102
config = CoreConfig()
104103
config.save(config_ini_file)
105104

@@ -129,6 +128,12 @@ def loadTemplateInfo(dir):
129128
if not os.path.exists(ti):
130129
return None
131130

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+
132137
# load up the template's information
133138
f = open(ti)
134139
try:

0 commit comments

Comments
 (0)