Exemplo n.º 1
0
def config():
    auth = request.authorization
    log.debug("Configuration requested by username:%s" % auth.username)
    config = {"type":"configuration"}
    db = databaseFactory()
    config.update(db.GetConfiguration(auth.username))
    config.update({"supportedoperations":db.GetSupportedOperations(auth.username)})
    return flask.jsonify(config)
Exemplo n.º 2
0
def config():
    auth = request.authorization
    log.debug("Configuration requested by username:%s" % auth.username)
    config = {"type": "configuration"}
    db = databaseFactory()
    config.update(db.GetConfiguration(auth.username))
    config.update(
        {"supportedoperations": db.GetSupportedOperations(auth.username)})
    return flask.jsonify(config)
Exemplo n.º 3
0
def runstate():
    auth = request.authorization
    log.debug("State requested by username:%s" % auth.username)
    db = databaseFactory()
    user = db.GetUser(auth.username,auth.username)
    system = getCurrentSystemState(auth.username) 
    client = getCurrentClientState(auth.username)
    systemRunning = (system['runstate']['username']!="") 
    state = {"type":"state",
            "user":auth.username,
            "serverstate":system,
            "clientstate":copy.deepcopy(client),
            "timestamp":time.time()}
    if system["runstate"]["running"]:
        state["clientstate"]["screen"] = "RUN"
    else:
        state["clientstate"]["screen"] = "HOME"
        state["clientstate"]["prompt"]["show"] = False

    return flask.jsonify(state)
Exemplo n.º 4
0
def state():
    auth = request.authorization
    log.debug("State requested by username:%s" % auth.username)
    db = databaseFactory()
    user = db.GetUser(auth.username,auth.username)
    system = getCurrentSystemState(auth.username) 
    client = getCurrentClientState(auth.username)
    systemRunning = (system['runstate']['username']!="") 


    options = {"HOME":home,
                "SELECT_SAVEDSEQUENCES":savedSeq,
                "SELECT_RUNHIST":runHist,
                "VIEW":view,
                "EDIT":edit,
                "RUN":run}

    choice = client["screen"]
    state = options.get(choice, default)(db,auth.username, system, client)
    return flask.jsonify(state)
Exemplo n.º 5
0
def state():
    auth = request.authorization
    log.debug("State requested by username:%s" % auth.username)
    db = databaseFactory()
    user = db.GetUser(auth.username, auth.username)
    system = getCurrentSystemState(auth.username)
    client = getCurrentClientState(auth.username)
    systemRunning = (system['runstate']['username'] != "")

    options = {
        "HOME": home,
        "SELECT_SAVEDSEQUENCES": savedSeq,
        "SELECT_RUNHIST": runHist,
        "VIEW": view,
        "EDIT": edit,
        "RUN": run
    }

    choice = client["screen"]
    state = options.get(choice, default)(db, auth.username, system, client)
    return flask.jsonify(state)
Exemplo n.º 6
0
def runstate():
    auth = request.authorization
    log.debug("State requested by username:%s" % auth.username)
    db = databaseFactory()
    user = db.GetUser(auth.username, auth.username)
    system = getCurrentSystemState(auth.username)
    client = getCurrentClientState(auth.username)
    systemRunning = (system['runstate']['username'] != "")
    state = {
        "type": "state",
        "user": auth.username,
        "serverstate": system,
        "clientstate": copy.deepcopy(client),
        "timestamp": time.time()
    }
    if system["runstate"]["running"]:
        state["clientstate"]["screen"] = "RUN"
    else:
        state["clientstate"]["screen"] = "HOME"
        state["clientstate"]["prompt"]["show"] = False

    return flask.jsonify(state)