Skip to content

Commit 4bd06cf

Browse files
author
Anthony Baxter
committed
HTTP_HOST and HTTP_PORT config options.
1 parent c32c47a commit 4bd06cf

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

config.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# $Id: config.py,v 1.5 2001-07-19 06:27:07 anthonybaxter Exp $
1+
# $Id: config.py,v 1.6 2001-07-19 10:43:01 anthonybaxter Exp $
22

3-
ROUNDUP_HOME=MAIL_DOMAIN=MAILHOST=None
3+
ROUNDUP_HOME=MAIL_DOMAIN=MAILHOST=HTTP_HOST=None
4+
HTTP_PORT=0
45

56
try:
67
from localconfig import *
@@ -21,6 +22,12 @@
2122
if not MAIL_DOMAIN:
2223
MAIL_DOMAIN = 'bizarsoftware.com.au'
2324

25+
# the next two are only used for the standalone HTTP server.
26+
if not HTTP_HOST:
27+
HTTP_HOST = ''
28+
if not HTTP_PORT:
29+
HTTP_PORT = 9080
30+
2431
# This is the directory that the database is going to be stored in
2532
DATABASE = os.path.join(ROUNDUP_HOME, 'db')
2633

@@ -37,6 +44,13 @@
3744

3845
#
3946
# $Log: not supported by cvs2svn $
47+
# Revision 1.5 2001/07/19 06:27:07 anthonybaxter
48+
# fixing (manually) the (dollarsign)Log(dollarsign) entries caused by
49+
# my using the magic (dollarsign)Id(dollarsign) and (dollarsign)Log(dollarsign)
50+
# strings in a commit message. I'm a twonk.
51+
#
52+
# Also broke the help string in two.
53+
#
4054
# Revision 1.4 2001/07/19 05:52:22 anthonybaxter
4155
# Added CVS keywords Id and Log to all python files.
4256
#

server.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Stolen from CGIHTTPServer
55
6-
$Id: server.py,v 1.3 2001-07-19 06:27:07 anthonybaxter Exp $
6+
$Id: server.py,v 1.4 2001-07-19 10:43:01 anthonybaxter Exp $
77
88
"""
99
import sys
@@ -144,14 +144,25 @@ def nobody_uid():
144144
nobody = 1 + max(map(lambda x: x[2], pwd.getpwall()))
145145
return nobody
146146

147-
if __name__ == '__main__':
148-
address = ('dirk.adroit', 9080)
147+
def main():
148+
from config import HTTP_HOST, HTTP_PORT
149+
address = (HTTP_HOST, HTTP_PORT)
149150
httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler)
150151
print 'Roundup server started on', address
151152
httpd.serve_forever()
152153

154+
if __name__ == '__main__':
155+
main()
156+
153157
#
154158
# $Log: not supported by cvs2svn $
159+
# Revision 1.3 2001/07/19 06:27:07 anthonybaxter
160+
# fixing (manually) the (dollarsign)Log(dollarsign) entries caused by
161+
# my using the magic (dollarsign)Id(dollarsign) and (dollarsign)Log(dollarsign)
162+
# strings in a commit message. I'm a twonk.
163+
#
164+
# Also broke the help string in two.
165+
#
155166
# Revision 1.2 2001/07/19 05:52:22 anthonybaxter
156167
# Added CVS keywords Id and Log to all python files.
157168
#

0 commit comments

Comments
 (0)