コード例 #1
0
ファイル: ajax.py プロジェクト: tonicbupt/elegon
def off(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})
        
    if not get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already off'})

    remove_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})
コード例 #2
0
def off(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})

    if not get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already off'})

    remove_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})
コード例 #3
0
ファイル: ajax.py プロジェクト: tonicbupt/elegon
def on(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})
        
    if get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already on'})

    add_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})
コード例 #4
0
def on(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})

    if get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already on'})

    add_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})