Small fixes in app.py
This commit is contained in:
parent
117efa3589
commit
c4436d040b
1 changed files with 6 additions and 4 deletions
10
app.py
10
app.py
|
@ -7,8 +7,6 @@ from print import *
|
|||
from format_image import *
|
||||
import os
|
||||
|
||||
valid_height=800
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config['UPLOAD_FOLDER'] = 'static/uploads'
|
||||
app.config['TEXT_FOLDER'] = 'static/text'
|
||||
|
@ -22,6 +20,10 @@ if not os.path.exists(app.config['TEXT_FOLDER']):
|
|||
|
||||
#TODO: make it so sessions don't interfere with eachother
|
||||
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
def base():
|
||||
return render_template('base.html')
|
||||
|
||||
@app.route('/image', methods=['GET', 'POST'])
|
||||
def image():
|
||||
if request.method == 'POST':
|
||||
|
@ -51,7 +53,7 @@ def image():
|
|||
|
||||
#TODO: maybe merge some stuff with text-print
|
||||
@app.route('/image-print', methods=['GET', 'POST'])
|
||||
def text_print():
|
||||
def image_print():
|
||||
if request.method == 'POST':
|
||||
image = format_image_to_label(session["filepath"])
|
||||
print_image(image)
|
||||
|
@ -147,7 +149,7 @@ def text():
|
|||
|
||||
|
||||
@app.route('/text-print', methods=['GET', 'POST'])
|
||||
def tex_print():
|
||||
def text_print():
|
||||
if request.method == 'POST':
|
||||
image = format_image_to_label("static/text/text.png")
|
||||
print_image(image)
|
||||
|
|
Loading…
Reference in a new issue