tests/dumbhttp.py
branchstable
changeset 34944 bf2db35a6fe7
parent 34925 8b95e420e248
child 37672 8bacc09814ba
equal deleted inserted replaced
34943:3423f7e2d287 34944:bf2db35a6fe7
    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()