Advertisement
Guest User

Untitled

a guest
Feb 5th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import time
  2. import logging
  3. import units
  4. import struct
  5. import array
  6. import daemon
  7. import urlparse
  8. from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
  9. import SocketServer
  10.  
  11. def main():
  12.   try:
  13.     server = HTTPServer(('',8080), ThreadingHTTPServer)
  14.     print 'Started httpserver on port' , 80
  15.     server.serve_forever()
  16.     #THE SCRIPT STOPS HERE
  17.     station = VantageProStation()
  18.     station.run()
  19.  
  20.   except KeyboardInterrupt:
  21.     logging.critical('Stopping, user aborted with CTRL+C')
  22.     print 'Stopping, user aborted with CTRL+C'
  23.   pass
  24.  
  25. class ThreadingHTTPServer(SocketServer.ThreadingMixIn,BaseHTTPRequestHandler):
  26.         def do_GET(self):
  27.             self.send_response(200)
  28.             self.send_header('Content-type','text/html')
  29.             self.end_headers()
  30.             self.wfile.write('bla')
  31.             return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement