diff --git a/flask/app.py b/flask/app.py index 8a529d5..d203deb 100644 --- a/flask/app.py +++ b/flask/app.py @@ -3,6 +3,8 @@ from PIL import Image from gen_image import gen_image from printer_info import * from datetime import datetime +from print import * +from format_image import * import os valid_height=800 @@ -126,8 +128,12 @@ def text(): @app.route('/text-print', methods=['GET', 'POST']) def tex_print(): if request.method == 'POST': + image = format_image("static/text/text.png") + print_image(image) + if 'cut' in request.form: print("printing and cutting") + cut_paper() session["cut"] = True; else: print("printing") diff --git a/flask/print.py b/flask/print.py index 5425d0a..0effc24 100644 --- a/flask/print.py +++ b/flask/print.py @@ -19,9 +19,9 @@ def print_image(image): # I'm sorry os.system("cd epson/; ./print_image.sh /tmp/image.png; cd ..") -image = format_image("static/text/text.png") -image.save("/tmp/image.png") -print_image(image) -cut_paper() +#image = format_image("static/text/text.png") +#image.save("/tmp/image.png") +#print_image(image) +#cut_paper()