def main(): try: if configuration.c.getCfgValueAsBool("createDaemon"): # detach from controlling tty and go to background daemon.createDaemon() # start the server port = configuration.c.getCfgValueAsInt("port") server = ThreadingHTTPServer(('', port), HttpServerHandler) # load motes motes.addAll() # start listening thread listenThread = threading.Thread(target = listenSerial) listenThread.start() # report ok and enter the main loop print("<remoteaccess>: started, listening to TCP port {}, serial baudrate {}".format( port, configuration.c.getCfgValueAsInt("baudrate"))) server.serve_forever() except Exception as e: print("<remoteaccess>: exception occurred:") print(e) print(traceback.format_exc()) return 1
def main(): try: if configuration.c.getCfgValueAsBool("createDaemon"): # detach from controlling tty and go to background daemon.createDaemon() # start the server port = configuration.c.getCfgValueAsInt("port") server = ThreadingHTTPServer(('', port), HttpServerHandler) # load motes motes.addAll() # start listening thread listenThread = threading.Thread(target=listenSerial) listenThread.start() # report ok and enter the main loop print( "<remoteaccess>: started, listening to TCP port {}, serial baudrate {}" .format(port, configuration.c.getCfgValueAsInt("baudrate"))) server.serve_forever() except Exception as e: print("<remoteaccess>: exception occurred:") print(e) print(traceback.format_exc()) return 1
def main(): try: if configuration.c.getCfgValueAsBool("createDaemon"): # detach from controlling tty and go to background daemon.createDaemon() # load users initalizeUsers() # start the server port = configuration.c.getCfgValueAsInt("port") server = ThreadingHTTPServer(('', port), HttpServerHandler) # load motes motes.addAll() # report ok and enter the main loop print("<http-server>: started, listening to TCP port {}, serial baudrate {}".format(port, configuration.c.getCfgValueAsInt("baudrate"))) server.serve_forever() except SystemExit: raise # XXX except Exception as e: print("<http-server>: exception occurred:") print(e) print(traceback.format_exc()) sys.exit(1)
def main(): try: configuration.setupPaths() if configuration.c.getCfgValueAsBool("createDaemon"): # detach from controlling tty and go to background daemon.createDaemon() # load users initalizeUsers() # start the server port = configuration.c.getCfgValueAsInt("port") server = ThreadingHTTPServer(('', port), HttpServerHandler) # load motes motes.addAll() # report ok and enter the main loop print("<http-server>: started, listening to TCP port {}, serial baudrate {}".format(port, configuration.c.getCfgValueAsInt("baudrate"))) server.serve_forever() except SystemExit: raise # XXX except Exception as e: print("<http-server>: exception occurred:") print(e) print(traceback.format_exc()) sys.exit(1)