def open(): seg_id = request.args.get("seg_id") if seg_id: Segment.open(seg_id) flash("opened file " + Segment.get_current()) else: flash("could not open file") return redirect(url_for('editor'))
def save(): Segment.save() flash("saved") return redirect(url_for('editor'))
def get_segment(): seg_id = Segment.get_current() return Segment.open(seg_id)