24 class simplehttpserver(httpserver.httpserver): |
24 class simplehttpserver(httpserver.httpserver): |
25 address_family = socket.AF_INET6 |
25 address_family = socket.AF_INET6 |
26 else: |
26 else: |
27 simplehttpserver = httpserver.httpserver |
27 simplehttpserver = httpserver.httpserver |
28 |
28 |
|
29 class _httprequesthandler(httpserver.simplehttprequesthandler): |
|
30 def log_message(self, format, *args): |
|
31 httpserver.simplehttprequesthandler.log_message(self, format, *args) |
|
32 sys.stderr.flush() |
|
33 |
29 class simplehttpservice(object): |
34 class simplehttpservice(object): |
30 def __init__(self, host, port): |
35 def __init__(self, host, port): |
31 self.address = (host, port) |
36 self.address = (host, port) |
32 def init(self): |
37 def init(self): |
33 self.httpd = simplehttpserver( |
38 self.httpd = simplehttpserver(self.address, _httprequesthandler) |
34 self.address, httpserver.simplehttprequesthandler) |
|
35 def run(self): |
39 def run(self): |
36 self.httpd.serve_forever() |
40 self.httpd.serve_forever() |
37 |
41 |
38 if __name__ == '__main__': |
42 if __name__ == '__main__': |
39 parser = OptionParser() |
43 parser = OptionParser() |