def signal_handler(signal, frame): Metadata.save_state() Metadata.stop() Database.stop() Share.stop() if os.path.exists("tmp"): shutil.rmtree("tmp") API.stop() sys.exit(0)
if Config._config is not None: if "api" in Config._config: run_api = Config._config["api"] if "webui" in Config._config: API.ui = Config._config["webui"] if API.ui: run_api = True if "scrape" in Config._config: run_metadata = Config._config["scrape"] if "host" in Config._config: API.host = Config._config["host"] if "port" in Config._config: API.port = Config._config["port"] if os.path.exists("tmp"): shutil.rmtree("tmp") Database.start() Share.start() if run_metadata: Metadata.start() if run_api: print "Serving Web UI/RESTful API on http://%s:%i" % (API.host, API.port) API.start() else: while True: time.sleep(100)
if "api" in Config._config: run_api = Config._config["api"] if "webui" in Config._config: API.ui = Config._config["webui"] if API.ui: run_api = True if "scrape" in Config._config: run_metadata = Config._config["scrape"] if "host" in Config._config: API.host = Config._config["host"] if "port" in Config._config: API.port = Config._config["port"] if os.path.exists("tmp"): shutil.rmtree("tmp") Database.start() Share.start() if run_metadata: Metadata.start() if run_api: print "Serving Web UI/RESTful API on http://%s:%i" % (API.host, API.port) API.start() else: while True: time.sleep(100)