def __init__(self, request, client_address, server):
    if ElServer.isAcceptable(client_address[0]):
      CGIHTTPRequestHandler.__init__(self, request, client_address,server)
    else:
      f = open('error.html','rb')
      errorPage = f.read()
      f.close()

      wfile = request.makefile('wb',0)
      rfile = request.makefile('rb',-1)
      try:
        raw_requestline = rfile.readline(65537)
        wfile.write("HTTP/1.0 200 OK\r\n")
        wfile.write("Connection: close\r\n")
        wfile.write("Content-Type: text/html; charset=UTF-8\r\n")
        wfile.write("Content-Length: %d\r\n"%(len(errorPage)))
        wfile.write("\r\n")
        wfile.write(errorPage)
      except socket.timeout,e: pass
      finally:
        if not wfile.closed:
Пример #2
0
 def __init__(self, req, client_addr, server):
     CGIHTTPRequestHandler.__init__(self, req, client_addr, server)
Пример #3
0
 def __init__(self, request, client_address, server):
     self.manager = server.manager
     CGIHTTPRequestHandler.__init__(self, request, client_address, server)
Пример #4
0
 def __init__(self, req, client_addr, server):
     CGIHTTPRequestHandler.__init__(self, req, client_addr, server)
    def __init__(self, a, b, c):
        global jukeboxState
        self.state = jukeboxState

        CGIHTTPRequestHandler.__init__(self, a, b, c)
Пример #6
0
 def __init__(self, request, client_address, server):
     """Constructor."""
     CGIHTTPRequestHandler.__init__(self, request, client_address, server)
Пример #7
0
 def __init__(self, *args, **params):
     SimpleHandler.__init__(self, *args, **params)
 def __init__(self, *args, **kwargs):
     CGIHTTPRequestHandler.__init__(self, *args, **kwargs)
Пример #9
0
 def __init__(self, *args, **kwargs):
     CGIHTTPRequestHandler.__init__(self, *args, **kwargs)
     self.cgi_directories.append("/cgi-bin")