comparison roundup/scripts/roundup_demo.py @ 4766:86ef4ab17dc5

Run scripts (roundup_admin.py, ...) directly from checkout. Convenient when you don't want to install Roundup, but want to run latest version.
author anatoly techtonik <techtonik@gmail.com>
date Thu, 21 Feb 2013 20:49:45 +0300
parents 01e8be352fb8
children 4cf48ff01e04
comparison
equal deleted inserted replaced
4765:c6694cff29bc 4766:86ef4ab17dc5
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # 2 #
3 # Copyright 2004 Richard Jones (richard@mechanicalcat.net) 3 # Copyright 2004 Richard Jones (richard@mechanicalcat.net)
4 # 4 #
5 5
6 DEFAULT_HOME = './demo'
7 DEFAULT_TEMPLATE = 'classic'
8
9
6 import sys 10 import sys
11
12
13 # --- patch sys.path to make sure 'import roundup' finds correct version
14 import os.path as osp
15
16 thisdir = osp.dirname(osp.abspath(__file__))
17 rootdir = osp.dirname(osp.dirname(thisdir))
18 if (osp.exists(thisdir + '/__init__.py') and
19 osp.exists(rootdir + '/roundup/__init__.py')):
20 # the script is located inside roundup source code
21 sys.path.insert(0, rootdir)
22 # --/
23
7 24
8 from roundup import admin, configuration, demo, instance 25 from roundup import admin, configuration, demo, instance
9 from roundup.i18n import _ 26 from roundup.i18n import _
10
11 DEFAULT_HOME = './demo'
12 DEFAULT_TEMPLATE = 'classic'
13 27
14 def run(): 28 def run():
15 home = DEFAULT_HOME 29 home = DEFAULT_HOME
16 template = DEFAULT_TEMPLATE 30 template = DEFAULT_TEMPLATE
17 nuke = sys.argv[-1] == 'nuke' 31 nuke = sys.argv[-1] == 'nuke'

Roundup Issue Tracker: http://roundup-tracker.org/