Skip to content

Commit b9ce5c7

Browse files
committed
Allow user to choose the tracker template for demo.
1 parent 9e25c40 commit b9ce5c7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

roundup/scripts/roundup_demo.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
#
33
# Copyright 2004 Richard Jones ([email protected])
44
#
5-
# $Id: roundup_demo.py,v 1.1 2004-10-18 07:56:09 a1s Exp $
65

76
import sys
87

98
from roundup import admin, configuration, demo, instance
109
from roundup.i18n import _
1110

1211
DEFAULT_HOME = './demo'
12+
DEFAULT_TEMPLATE = 'classic'
1313

1414
def run():
1515
home = DEFAULT_HOME
16+
template = DEFAULT_TEMPLATE
1617
nuke = sys.argv[-1] == 'nuke'
1718
# if there is no tracker in home, force nuke
1819
try:
@@ -32,9 +33,15 @@ def run():
3233
_('Enter directory path to create demo tracker [%s]: ') % home)
3334
if not home:
3435
home = DEFAULT_HOME
36+
templates = admin.AdminTool().listTemplates().keys()
37+
template = raw_input(
38+
_('Enter tracker template to use (one of (%s)) [%s]: ') %
39+
(','.join(templates),template))
40+
if not template:
41+
template = DEFAULT_TEMPLATE
3542
# install
3643
demo.install_demo(home, backend,
37-
admin.AdminTool().listTemplates()['classic']['path'])
44+
admin.AdminTool().listTemplates()[template]['path'])
3845
# run
3946
demo.run_demo(home)
4047

0 commit comments

Comments
 (0)