Exemplo n.º 1
0
 def do_GET(self):
     self._set_headers()
     if (self.path != "/favicon.ico"):
         print self.path
         obj = instance.get_instance()
         data = (urllib.unquote(self.path[1:]).decode('utf8'))
         obj.handler(self, data)
Exemplo n.º 2
0
 def do_POST(self):
     # Doesn't do anything with posted data
     self._set_headers()
     content_len = int(self.headers.getheader('content-length', 0))
     post_body = self.rfile.read(content_len)
     obj = instance.get_instance()
     data = (urllib.unquote(post_body).decode('utf8'))
     obj.handler(self, data)
Exemplo n.º 3
0
 def do_GET(self):
     global disp_count
     self._set_headers()
     if (self.path != "/favicon.ico"):
         print("Handling request", disp_count, self.path)
         disp_count += 1
         obj = instance.get_instance()
         obj.handler(self)
     else:
         print("    +++Skipping favico request")
Exemplo n.º 4
0
 def do_GET(self):
     global HTTPD
     self._set_headers()
     if (self.path != "/favicon.ico"):
         print(self.path)
         obj = instance.get_instance()
         try:
             obj.handler(self)
         except:
             print("Shutting down")
             HTTPD.shutdown()
             sys.exit(1)
             raise SystemExit
Exemplo n.º 5
0
 def process(self,status_code):
     self.send_response(status_code)
     self.send_header('Content-type', 'text/plain')
     self.end_headers()
     obj = instance.get_instance()
     obj.handler(self)