예제 #1
0
def delete():
    dbsess = get_session()
    rule_id = request.form.get("rule_id")
    r = Rule.get(Rule.id == rule_id, sess=dbsess)
    if r:
        dbsess.delete(r[0])
        dbsess.commit()
        flash(u"予約ルールを削除しました")
    return redirect(url_for("index"))
예제 #2
0
def add():
    dbsess = get_session()
    if request.method == "POST" and request.form.get("keyword"):
        rule = Rule(conditions=generate_conditions())
        dbsess.add(rule)
        dbsess.commit()
        reserve_ctrl = u'<a class="reserve_ctrl" href="#reserve%s">&raquo;すぐに録画予約を行う</a>' % rule.id
        flash(u"予約ルールを追加しました %s" % reserve_ctrl)
        return redirect(url_for("index"))
    return render_template("add.html", channels=Channel.list(sess=dbsess))
예제 #3
0
 def __init__(self):
     self.sess = get_session()
     self.logger = settings.logging.getLogger('reserveshell')
     self.remote_api = RemoteAPI(username=settings.REMOTE_USERNAME,
                                 password=settings.REMOTE_PASSWORD)
예제 #4
0
 def __init__(self):
     self.program_api = ProgramAPI()
     self.sess = get_session()
     self.logger = logging.getLogger('storeshell')
예제 #5
0
def index():
    dbsess = get_session()
    rules = Rule.get(sess=dbsess)
    reserved = Program.get_reserved(sess=dbsess)
    return render_template("index.html", rules=rules, reserved_programs=reserved)