Ejemplo n.º 1
0
def expression_add_get():
    g.menu = 'expressions'
    a = None
    o = Expression.get(int(request.args.get('id', '0').strip()))
    if o:
        a = Action.get(o.action_id)
    return render_template('expression/add.html',
                           data={'action': a, 'expression': o, 'uic_address': UIC_ADDRESS['external']})
Ejemplo n.º 2
0
def expression_view_get(eid):
    eid = int(eid)
    g.menu = "expressions"
    a = None
    o = Expression.get(eid)
    if o:
        a = Action.get(o.action_id)
    else:
        return "no such expression"
    return render_template("expression/view.html", data={"action": a, "expression": o}, config=config)
Ejemplo n.º 3
0
def expression_view_get(eid):
    eid = int(eid)
    g.menu = 'expressions'
    a = None
    o = Expression.get(eid)
    if o:
        a = Action.get(o.action_id)
    else:
        return 'no such expression'
    return render_template('expression/view.html', data={'action': a, 'expression': o})
Ejemplo n.º 4
0
def expression_add_get():
    g.menu = "expressions"
    a = None
    o = Expression.get(int(request.args.get("id", "0").strip()))
    if o:
        a = Action.get(o.action_id)
    return render_template(
        "expression/add.html",
        data={"action": a, "expression": o, "uic_address": UIC_ADDRESS["external"]},
        config=config,
    )
Ejemplo n.º 5
0
def expression_add_get():
    g.menu = 'expressions'
    a = None
    o = Expression.get(int(request.args.get('id', '0').strip()))
    if o:
        a = Action.get(o.action_id)
    return render_template('expression/add.html',
                           data={
                               'action': a,
                               'expression': o,
                               'uic_address': UIC_ADDRESS['external']
                           })
Ejemplo n.º 6
0
def expression_view_get(eid):
    eid = int(eid)
    g.menu = 'expressions'
    a = None
    o = Expression.get(eid)
    if o:
        a = Action.get(o.action_id)
    else:
        return 'no such expression'
    return render_template('expression/view.html',
                           data={
                               'action': a,
                               'expression': o
                           })
def expression_pause_get():
    expression_id = request.args.get("id", '')
    pause = request.args.get('pause', '')
    if not expression_id:
        return jsonify(msg='id is blank')

    if not pause:
        return jsonify(msg='pause is blank')

    e = Expression.get(expression_id)
    if not e:
        return jsonify('no such expression %s' % expression_id)

    Expression.update_dict({'pause': pause}, 'id=%s', [expression_id])
    return jsonify(msg='')
Ejemplo n.º 8
0
def expression_pause_get():
    expression_id = request.args.get("id", '')
    pause = request.args.get('pause', '')
    if not expression_id:
        return jsonify(msg='id is blank')

    if not pause:
        return jsonify(msg='pause is blank')

    e = Expression.get(expression_id)
    if not e:
        return jsonify('no such expression %s' % expression_id)

    Expression.update_dict({'pause': pause}, 'id=%s', [expression_id])
    return jsonify(msg='')
Ejemplo n.º 9
0
def expression_pause_get():
    expression_id = request.args.get("id", "")
    pause = request.args.get("pause", "")
    if not expression_id:
        return jsonify(msg="id is blank")

    if not pause:
        return jsonify(msg="pause is blank")

    e = Expression.get(expression_id)
    if not e:
        return jsonify("no such expression %s" % expression_id)

    Expression.update_dict({"pause": pause}, "id=%s", [expression_id])
    return jsonify(msg="")
Ejemplo n.º 10
0
def api_expression_get(exp_id):
    exp_id = int(exp_id)
    expression = Expression.get(exp_id)
    if not expression:
        return jsonify(msg="no such expression")
    return jsonify(msg='', data=expression.to_json())
Ejemplo n.º 11
0
def api_expression_get(exp_id):
    exp_id = int(exp_id)
    expression = Expression.get(exp_id)
    if not expression:
        return jsonify(msg="no such expression")
    return jsonify(msg='', data=expression.to_json())