Mercurial > p > roundup > code
comparison demo.py @ 2639:75d410d11a20
duh
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 27 Jul 2004 02:34:14 +0000 |
| parents | 11811b313459 |
| children | fe71e108d998 |
comparison
equal
deleted
inserted
replaced
| 2638:18e86941c950 | 2639:75d410d11a20 |
|---|---|
| 1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2003 Richard Jones (richard@mechanicalcat.net) | 3 # Copyright (c) 2003 Richard Jones (richard@mechanicalcat.net) |
| 4 # | 4 # |
| 5 # $Id: demo.py,v 1.13 2004-07-27 01:59:27 richard Exp $ | 5 # $Id: demo.py,v 1.14 2004-07-27 02:34:14 richard Exp $ |
| 6 | 6 |
| 7 import sys, os, string, re, urlparse | 7 import sys, os, string, re, urlparse, ConfigParser |
| 8 import shutil, socket, errno, BaseHTTPServer | 8 import shutil, socket, errno, BaseHTTPServer |
| 9 from glob import glob | 9 from glob import glob |
| 10 | 10 |
| 11 def install_demo(home, backend): | 11 def install_demo(home, backend): |
| 12 from roundup import init, instance, password, backends, configuration | 12 from roundup import init, instance, password, backends, configuration |
| 82 if not os.path.exists(home) or sys.argv[-1] == 'nuke': | 82 if not os.path.exists(home) or sys.argv[-1] == 'nuke': |
| 83 if len(sys.argv) > 2: | 83 if len(sys.argv) > 2: |
| 84 backend = sys.argv[1] | 84 backend = sys.argv[1] |
| 85 install_demo(home, backend) | 85 install_demo(home, backend) |
| 86 | 86 |
| 87 f = open(os.path.join(home, 'config.ini'), 'r') | 87 cfg = ConfigParser.ConfigParser() |
| 88 url = re.search(r'^web\s*=\s*(http.+/)$', f.read(), | 88 cfg.read(os.path.join(home, 'config.ini')) |
| 89 re.M|re.I).group(1) | 89 url = cfg.get('tracker', 'web') |
| 90 f.close() | |
| 91 hostname, port = urlparse.urlparse(url)[1].split(':') | 90 hostname, port = urlparse.urlparse(url)[1].split(':') |
| 92 port = int(port) | 91 port = int(port) |
| 93 | 92 |
| 94 # ok, so start up the server | 93 # ok, so start up the server |
| 95 from roundup.scripts import roundup_server | 94 from roundup.scripts import roundup_server |
