summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cdf3b9d)
raw | patch | inline | side by side (parent: cdf3b9d)
author | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 17 Jun 2009 15:24:08 +0000 (15:24 +0000) | ||
committer | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 17 Jun 2009 15:24:08 +0000 (15:24 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4228 57a73879-2fb5-44c3-a270-3262357dd7e2
demo.py | patch | blob | history |
index acaa13c8b785062b57690df663cb05b84ac70b84..20f9f1285f1d831fa333f022a93794a14fabe873 100644 (file)
--- a/demo.py
+++ b/demo.py
template_dir = os.path.join('share', 'roundup', 'templates', template)
init.install(home, template_dir)
# don't have email flying around
- os.remove(os.path.join(home, 'detectors', 'nosyreaction.py'))
- try:
- os.remove(os.path.join(home, 'detectors', 'nosyreaction.pyc'))
- except os.error, error:
- if error.errno != errno.ENOENT:
- raise
+ nosyreaction = os.path.join(home, 'detectors', 'nosyreaction.py')
+ if os.path.exists(nosyreaction):
+ os.remove(nosyreaction)
+ nosyreaction += 'c'
+ if os.path.exists(nosyreaction):
+ os.remove(nosyreaction)
init.write_select_db(home, backend)
# figure basic params for server
# add the "demo" user
db = tracker.open('admin')
- db.user.create(username='demo', password=password.Password('demo'),
- realname='Demo User', roles='User')
+ # FIXME: Move tracker-specific demo initialization into the tracker templates.
+ if (template == 'minimal'):
+ db.user.create(username='demo', password=password.Password('demo'),
+ roles='User')
+ else:
+ db.user.create(username='demo', password=password.Password('demo'),
+ realname='Demo User', roles='User')
db.commit()
db.close()