def debug(args): port = int(args.port) data_path = utility.abspath(args.json) utility.check_file(data_path) app.config["DATA_PATH"] = data_path app.config["SECRET_KEY"] = "development key" app.run(debug=True, port=port)
def start(args): port = int(args.port) log_path = args.logfilepath lock_path = args.lockfile data_path = utility.abspath(args.json) utility.check_file(data_path) app.config["DATA_PATH"] = data_path app.config["SECRET_KEY"] = "development key" if not op.exists(lock_path): dc = DaemonContext(pidfile=PIDLockFile(lock_path), stderr=open(log_path, "w+"), working_directory=ROOT) with dc: app.run(port=port) else: raise exception.DataProcessorError("Server already stands.")