-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
35 lines (27 loc) · 803 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from flask import Flask, render_template, request
from main import pad2pdf
app = Flask(__name__,
static_url_path='',
static_folder='static',
template_folder='templates')
# sets Paths
@app.route("/")
def index():
# Render HTML with count variable
return render_template("index.html")
@app.route("/generate/", methods = ['POST'])
def generate():
name = request.form
numbers = False
contenttable = False
comments = False
if 'numbers' in name:
numbers= True
if 'contenttable' in name:
contenttable = True
if 'comments' in name:
comments = True
pad2pdf(name['pad'], name['style'],".", numbers, contenttable, comments)
return render_template("index.html")
if __name__ == "__main__":
app.run()