Fixed response to use template

parent 73f83681
import os
import re
import gradaudit.gradaudit as gradaudit
from flask import Flask, render_template, request
......@@ -29,6 +30,13 @@ def submit():
main_contents = gradaudit.gen_main(*student_data)
with open('main.lp','w') as main_file:
main_file.write(main_contents)
response = os.popen('sasp main.lp').read()
return response
can_grad = 'ableToGraduate({0})'.format(name) in response
reqClasses = re.findall('[a-zA-z]+[1-4][0-9][0-9V][0-9]',response)
return render_template('GASTemplate.html',
ableToGraduate=can_grad,
studentName=name,
requiredClasses=reqClasses,
degree=major)
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