Skip to content

Commit 9341c39

Browse files
author
Alexander Smishlajev
committed
instant-gratification script for binary distributions
1 parent f3bfcb1 commit 9341c39

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

roundup/scripts/roundup_demo.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#! /usr/bin/env python
2+
#
3+
# Copyright 2004 Richard Jones ([email protected])
4+
#
5+
# $Id: roundup_demo.py,v 1.1 2004-10-18 07:56:09 a1s Exp $
6+
7+
import sys
8+
9+
from roundup import admin, configuration, demo, instance
10+
from roundup.i18n import _
11+
12+
DEFAULT_HOME = './demo'
13+
14+
def run():
15+
home = DEFAULT_HOME
16+
nuke = sys.argv[-1] == 'nuke'
17+
# if there is no tracker in home, force nuke
18+
try:
19+
instance.open(home)
20+
except configuration.NoConfigError:
21+
nuke = 1
22+
# if we are to create the tracker, prompt for home
23+
if nuke:
24+
if len(sys.argv) > 2:
25+
backend = sys.argv[-2]
26+
else:
27+
backend = 'anydbm'
28+
# FIXME: i'd like to have an option to abort the tracker creation
29+
# say, by entering a single dot. but i cannot think of
30+
# appropriate prompt for that.
31+
home = raw_input(
32+
_('Enter directory path to create demo tracker [%s]: ') % home)
33+
if not home:
34+
home = DEFAULT_HOME
35+
# install
36+
demo.install_demo(home, backend,
37+
admin.AdminTool().listTemplates()['classic']['path'])
38+
# run
39+
demo.run_demo(home)
40+
41+
if __name__ == '__main__':
42+
run()
43+
44+
# vim: set et sts=4 sw=4 :

0 commit comments

Comments
 (0)