From: stefan Date: Wed, 17 Jun 2009 15:24:08 +0000 (+0000) Subject: Adjust to allow to run the 'minimal' tracker, too. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=85c83e38df5255dcc1d023e09641f3d7c6caa3cc;p=roundup.git Adjust to allow to run the 'minimal' tracker, too. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4228 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/demo.py b/demo.py index acaa13c..20f9f12 100644 --- a/demo.py +++ b/demo.py @@ -49,12 +49,12 @@ def install_demo(home, backend, template): 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 @@ -88,8 +88,13 @@ def install_demo(home, backend, template): # 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()