Beispiel #1
0
def new_pad():
    user = flask.g.user
    pad = user.get_current_pad()
    if not pad.is_default():
        pad = Pad.make(user)
        user.set_current_pad(pad)
    return redirect_to_pad(pad)
Beispiel #2
0
def copy_pad(pad_id):
    user = flask.g.user
    pad = user.get_current_pad()
    pad_input = pad.get_input()
    pad_output = pad.get_output()
    pad = Pad.make(user, title=pad.get_title(), mode=pad.get_eval_mode(),
                   pad_input=pad.get_input(), pad_output=pad.get_output())
    user.set_current_pad(pad)
    flash('Saved an editable copy.')
    return redirect_to_pad(pad)