|
|
@ -51,14 +51,21 @@ def index(): |
|
|
|
|
|
|
|
@APP.route('/print/', methods=['GET', 'POST']) |
|
|
|
def print(): |
|
|
|
txt = request.args.get('printing', '') |
|
|
|
txt_normal = request.args.get('normal', '') |
|
|
|
txt_big = request.args.get('big', '') |
|
|
|
img = request.files.get('img') |
|
|
|
|
|
|
|
if txt: |
|
|
|
if txt_normal: |
|
|
|
source = 'TeleVex' |
|
|
|
txt, date = televex.preprocess(txt, type='txt') |
|
|
|
televex.update_db(db, db_path, txt, source, date) |
|
|
|
televex.print_now(txt, lp=lp, type='txt') |
|
|
|
txt, date = televex.preprocess(txt_normal, type='txt') |
|
|
|
televex.update_db(db, db_path, txt_normal, source, date) |
|
|
|
televex.print_now(txt_normal, lp=lp, type='txt', size='normal') |
|
|
|
return flask.redirect(flask.url_for('print')) |
|
|
|
elif txt_big: |
|
|
|
source = 'TeleVex' |
|
|
|
txt_big, date = televex.preprocess(txt_big, type='txt') |
|
|
|
televex.update_db(db, db_path, txt_big, source, date) |
|
|
|
televex.print_now(txt_big, lp=lp, type='txt', size='big') |
|
|
|
return flask.redirect(flask.url_for('print')) |
|
|
|
elif img: |
|
|
|
source = 'TeleVex' |
|
|
|