Exemplo n.º 1
0
 def test_config_reader(self):
     config = config_parser.ConfigParser()
     path = __file__
     idx = path.rfind("ascenddk")
     root_dir = path[0:idx]
     root_dir = os.path.join(
         root_dir, "ascenddk/common/presenter/server/face_detection/")
     print(config.root_path, root_dir)
     self.assertEqual(config.root_path, root_dir)
def start_webapp():
    """
    start webapp
    """
    http_server = get_webapp()
    config = config_parser.ConfigParser()
    http_server.listen(config.web_server_port, address=config.web_server_ip)

    print("Please visit http://" + config.web_server_ip + ":" +
          str(config.web_server_port) + " for face detection")
    tornado.ioloop.IOLoop.instance().start()
Exemplo n.º 3
0
 def __init__(self, server_address):
     """
     Args:
         server_address: server listen address,
                         include an ipv4 address and a port.
     """
     # thread exit switch, if set true, thread must exit immediately.
     self._thread_exit_switch = False
     self._config = config_parser.ConfigParser()
     self._channel_manager = ChannelManager()
     self._create_socket_server(server_address)