Skip to content

Commit 0cc1667

Browse files
committed
Adjust to allow to run the 'minimal' tracker, too.
1 parent 5834606 commit 0cc1667

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

demo.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ def install_demo(home, backend, template):
4949
template_dir = os.path.join('share', 'roundup', 'templates', template)
5050
init.install(home, template_dir)
5151
# don't have email flying around
52-
os.remove(os.path.join(home, 'detectors', 'nosyreaction.py'))
53-
try:
54-
os.remove(os.path.join(home, 'detectors', 'nosyreaction.pyc'))
55-
except os.error, error:
56-
if error.errno != errno.ENOENT:
57-
raise
52+
nosyreaction = os.path.join(home, 'detectors', 'nosyreaction.py')
53+
if os.path.exists(nosyreaction):
54+
os.remove(nosyreaction)
55+
nosyreaction += 'c'
56+
if os.path.exists(nosyreaction):
57+
os.remove(nosyreaction)
5858
init.write_select_db(home, backend)
5959

6060
# figure basic params for server
@@ -88,8 +88,13 @@ def install_demo(home, backend, template):
8888

8989
# add the "demo" user
9090
db = tracker.open('admin')
91-
db.user.create(username='demo', password=password.Password('demo'),
92-
realname='Demo User', roles='User')
91+
# FIXME: Move tracker-specific demo initialization into the tracker templates.
92+
if (template == 'minimal'):
93+
db.user.create(username='demo', password=password.Password('demo'),
94+
roles='User')
95+
else:
96+
db.user.create(username='demo', password=password.Password('demo'),
97+
realname='Demo User', roles='User')
9398
db.commit()
9499
db.close()
95100

0 commit comments

Comments
 (0)