Mercurial > p > roundup > code
comparison server.py @ 11:cdb38951a7ab
HTTP_HOST and HTTP_PORT config options.
| author | Anthony Baxter <anthonybaxter@users.sourceforge.net> |
|---|---|
| date | Thu, 19 Jul 2001 10:43:01 +0000 |
| parents | 3b0a72f54613 |
| children | af157c0a36a3 |
comparison
equal
deleted
inserted
replaced
| 10:e09edaebc9de | 11:cdb38951a7ab |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 """ HTTP Server that serves roundup. | 2 """ HTTP Server that serves roundup. |
| 3 | 3 |
| 4 Stolen from CGIHTTPServer | 4 Stolen from CGIHTTPServer |
| 5 | 5 |
| 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 $ |
| 7 | 7 |
| 8 """ | 8 """ |
| 9 import sys | 9 import sys |
| 10 if int(sys.version[0]) < 2: | 10 if int(sys.version[0]) < 2: |
| 11 print "Content-Type: text/plain\n" | 11 print "Content-Type: text/plain\n" |
| 142 nobody = pwd.getpwnam('nobody')[2] | 142 nobody = pwd.getpwnam('nobody')[2] |
| 143 except KeyError: | 143 except KeyError: |
| 144 nobody = 1 + max(map(lambda x: x[2], pwd.getpwall())) | 144 nobody = 1 + max(map(lambda x: x[2], pwd.getpwall())) |
| 145 return nobody | 145 return nobody |
| 146 | 146 |
| 147 if __name__ == '__main__': | 147 def main(): |
| 148 address = ('dirk.adroit', 9080) | 148 from config import HTTP_HOST, HTTP_PORT |
| 149 address = (HTTP_HOST, HTTP_PORT) | |
| 149 httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler) | 150 httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler) |
| 150 print 'Roundup server started on', address | 151 print 'Roundup server started on', address |
| 151 httpd.serve_forever() | 152 httpd.serve_forever() |
| 152 | 153 |
| 154 if __name__ == '__main__': | |
| 155 main() | |
| 156 | |
| 153 # | 157 # |
| 154 # $Log: not supported by cvs2svn $ | 158 # $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 # | |
| 155 # Revision 1.2 2001/07/19 05:52:22 anthonybaxter | 166 # Revision 1.2 2001/07/19 05:52:22 anthonybaxter |
| 156 # Added CVS keywords Id and Log to all python files. | 167 # Added CVS keywords Id and Log to all python files. |
| 157 # | 168 # |
| 158 # | 169 # |
| 159 | 170 |
