Spacing

parent 36313df1
......@@ -7,25 +7,27 @@ from tempfile import NamedTemporaryFile
app = Flask(__name__)
@app.route('/',methods=['POST','GET'])
@app.route('/', methods=['POST', 'GET'])
def input_form():
if request.method == 'GET':
return render_template('GASGUI.html')
else:
uploaded = request.files['transcriptPDF']
uploaded = request.files['transcriptPDF']
with NamedTemporaryFile() as fil:
uploaded.save(fil)
fil.flush()
course_data = extract.extract_courses(fil.name)
courses = map(lambda x: x[0], course_data)
courses = ','.join(courses)
return render_template('GASGUI.html',classes=courses)
@app.route('/upload',methods=['POST'])
def upload():
return render_template('GASGUI.html')
return render_template('GASGUI.html', classes=courses)
@app.route('/upload', methods=['POST'])
def upload():
return render_template('GASGUI.html')
@app.route('/submit', methods=['POST'])
def submit():
name = request.form['name'].lower()
......@@ -33,9 +35,10 @@ def submit():
major = request.form['MajorList']
year = request.form['YearList']
spec = request.form['SpecializationOfDegree'].lower()
classes = request.form['classesTaken'].replace(' ','')
transcript = util.Transcript(name, degree, major, year, spec, classes.split(','))
classes = request.form['classesTaken'].replace(' ', '')
transcript = util.Transcript(
name, degree, major, year, spec, classes.split(','))
resp = Response(transcript)
return render_template('GASTemplate.html', response=resp)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment