comparison demo.py @ 1868:1545a36ae887

Use roundup_server script in demo.py to reduce duplication (first part of fixing [SF##798659]).
author Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
date Sat, 25 Oct 2003 11:41:06 +0000
parents 63c770644afa
children 7b0a655edb88
comparison
equal deleted inserted replaced
1867:9b100d7bcb80 1868:1545a36ae887
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.5 2003-07-28 23:17:50 richard Exp $ 5 # $Id: demo.py,v 1.6 2003-10-25 11:41:06 jlgijsbers Exp $
6 6
7 import sys, os, string, re, urlparse 7 import sys, os, string, re, urlparse
8 import shutil, socket, errno, BaseHTTPServer 8 import shutil, socket, errno, BaseHTTPServer
9 from glob import glob 9 from glob import glob
10 10
79 f.close() 79 f.close()
80 hostname, port = urlparse.urlparse(url)[1].split(':') 80 hostname, port = urlparse.urlparse(url)[1].split(':')
81 port = int(port) 81 port = int(port)
82 82
83 # ok, so start up the server 83 # ok, so start up the server
84 from roundup.scripts.roundup_server import RoundupRequestHandler 84 from roundup.scripts import roundup_server
85 RoundupRequestHandler.TRACKER_HOMES = {'demo': home} 85 roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home}
86 httpd = BaseHTTPServer.HTTPServer((hostname, port), RoundupRequestHandler) 86
87 print 'Server running - connect to:\n %s'%url 87 success_message = '''Server running - connect to:
88 print '1. Log in as "demo"/"demo" or "admin"/"admin".' 88 %s
89 print '2. Hit Control-C to stop the server.' 89 1. Log in as "demo"/"demo" or "admin"/"admin".
90 print '3. Re-start the server by running "python demo.py" again.' 90 2. Hit Control-C to stop the server.
91 print '4. Re-initialise the server by running "python demo.py nuke".' 91 3. Re-start the server by running "python demo.py" again.
92 try: 92 4. Re-initialise the server by running "python demo.py nuke".''' % url
93 httpd.serve_forever() 93
94 except KeyboardInterrupt: 94 roundup_server.run(port, success_message)
95 print 'Keyboard Interrupt: exiting'
96 95
97 if __name__ == '__main__': 96 if __name__ == '__main__':
98 run_demo() 97 run_demo()
99 98
100 # vim: set filetype=python ts=4 sw=4 et si 99 # vim: set filetype=python ts=4 sw=4 et si

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