summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c4b07ad)
raw | patch | inline | side by side (parent: c4b07ad)
author | jlgijsbers <jlgijsbers@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 25 Oct 2003 11:41:06 +0000 (11:41 +0000) | ||
committer | jlgijsbers <jlgijsbers@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 25 Oct 2003 11:41:06 +0000 (11:41 +0000) |
of fixing bug #798659).
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1937 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1937 57a73879-2fb5-44c3-a270-3262357dd7e2
demo.py | patch | blob | history | |
roundup/scripts/roundup_server.py | patch | blob | history |
index b047e843418c9d099117b49bdae17a08ed48e4fd..bf288e2f217d5e64c655d2cf61378f2afc4f57a1 100644 (file)
--- a/demo.py
+++ b/demo.py
#
# Copyright (c) 2003 Richard Jones (richard@mechanicalcat.net)
#
-# $Id: demo.py,v 1.5 2003-07-28 23:17:50 richard Exp $
+# $Id: demo.py,v 1.6 2003-10-25 11:41:06 jlgijsbers Exp $
import sys, os, string, re, urlparse
import shutil, socket, errno, BaseHTTPServer
port = int(port)
# ok, so start up the server
- from roundup.scripts.roundup_server import RoundupRequestHandler
- RoundupRequestHandler.TRACKER_HOMES = {'demo': home}
- httpd = BaseHTTPServer.HTTPServer((hostname, port), RoundupRequestHandler)
- print 'Server running - connect to:\n %s'%url
- print '1. Log in as "demo"/"demo" or "admin"/"admin".'
- print '2. Hit Control-C to stop the server.'
- print '3. Re-start the server by running "python demo.py" again.'
- print '4. Re-initialise the server by running "python demo.py nuke".'
- try:
- httpd.serve_forever()
- except KeyboardInterrupt:
- print 'Keyboard Interrupt: exiting'
+ from roundup.scripts import roundup_server
+ roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home}
+
+ success_message = '''Server running - connect to:
+ %s
+1. Log in as "demo"/"demo" or "admin"/"admin".
+2. Hit Control-C to stop the server.
+3. Re-start the server by running "python demo.py" again.
+4. Re-initialise the server by running "python demo.py nuke".''' % url
+
+ roundup_server.run(port, success_message)
if __name__ == '__main__':
run_demo()
index 97b6a5d203f957ae1c22fdcbd5b8904733696a8d..f87ce02f91073929fb1e61fd110c24cb2ce3d52d 100644 (file)
#
""" HTTP Server that serves roundup.
-$Id: roundup_server.py,v 1.30 2003-10-25 11:20:17 jlgijsbers Exp $
+$Id: roundup_server.py,v 1.31 2003-10-25 11:41:06 jlgijsbers Exp $
"""
# python version check
os.dup2(devnull, 1)
os.dup2(devnull, 2)
-def run():
+def run(port=8080, success_message=None):
''' Script entry point - handle args and figure out what to to.
'''
# time out after a minute if we can
socket.setdefaulttimeout(60)
hostname = ''
- port = 8080
pidfile = None
logfile = None
try:
# appending, unbuffered
sys.stdout = sys.stderr = open(logfile, 'a', 0)
- print _('Roundup server started on %(address)s')%locals()
+ if success_message:
+ print success_message
+ else:
+ print _('Roundup server started on %(address)s')%locals()
+
try:
httpd.serve_forever()
except KeyboardInterrupt: