Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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.")
Exemplo n.º 4
0
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.")