|
2 | 2 | # |
3 | 3 | # Copyright (c) 2003 Richard Jones ([email protected]) |
4 | 4 | # |
5 | | -# $Id: demo.py,v 1.19 2004-10-18 07:46:59 a1s Exp $ |
| 5 | +# $Id: demo.py,v 1.20 2004-10-19 08:04:12 a1s Exp $ |
6 | 6 |
|
7 | | -import sys, os, string, re, urlparse, ConfigParser |
8 | | -import shutil, socket, errno, BaseHTTPServer |
| 7 | +import errno |
| 8 | +import os |
| 9 | +import socket |
| 10 | +import sys |
| 11 | +import urlparse |
9 | 12 | from glob import glob |
10 | 13 |
|
11 | 14 | from roundup import configuration |
@@ -91,17 +94,20 @@ def run_demo(home): |
91 | 94 | """Run the demo tracker installed in ``home``""" |
92 | 95 | roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home} |
93 | 96 | cfg = configuration.CoreConfig(home) |
| 97 | + url = cfg["TRACKER_WEB"] |
| 98 | + hostname, port = urlparse.urlparse(url)[1].split(':') |
| 99 | + port = int(port) |
94 | 100 | success_message = '''Server running - connect to: |
95 | 101 | %s |
96 | 102 | 1. Log in as "demo"/"demo" or "admin"/"admin". |
97 | 103 | 2. Hit Control-C to stop the server. |
98 | 104 | 3. Re-start the server by running "python demo.py" again. |
99 | 105 | 4. Re-initialise the server by running "python demo.py nuke". |
100 | | -''' % cfg["TRACKER_WEB"] |
| 106 | +''' % url |
101 | 107 |
|
102 | 108 | # disable command line processing in roundup_server |
103 | 109 | sys.argv = sys.argv[:1] |
104 | | - roundup_server.run(success_message=success_message) |
| 110 | + roundup_server.run(port=port, success_message=success_message) |
105 | 111 |
|
106 | 112 | def demo_main(): |
107 | 113 | """Run a demo server for users to play with for instant gratification. |
|
0 commit comments