Renamed response.py to gasresponse.py

parent 171767de
......@@ -4,7 +4,7 @@ import re
import gradaudit.util as util
class Response(object):
class GASResponse(object):
""" GAS advising information """
_missing_class_re = r'hasNotTaken\({},([a-z]+[1-4][0-9V][0-9][0-9])\)'
_missing_hours_re = r'needsHours\({},([a-zA-Z]+),([0-9]+)\)'
......@@ -15,8 +15,8 @@ class Response(object):
self.transcript = transcript
main_contents = util.gen_main(transcript)
answer_set = Response._run(main_contents)
advice = Response._extract_advice(answer_set, transcript.name)
answer_set = GASResponse._run(main_contents)
advice = GASResponse._extract_advice(answer_set, transcript.name)
self.missing_classes = advice[0]
self.missing_hours = advice[1]
......@@ -36,10 +36,10 @@ class Response(object):
@classmethod
def _extract_advice(cls, answer_set, name):
""" Parses answer set for advising information """
class_re = Response._missing_class_re.format(name)
hours_re = Response._missing_hours_re.format(name)
electives_re = Response._missing_electives_re.format(name)
grad = Response._grad.format(name)
class_re = GASResponse._missing_class_re.format(name)
hours_re = GASResponse._missing_hours_re.format(name)
electives_re = GASResponse._missing_electives_re.format(name)
grad = GASResponse._grad.format(name)
classes = re.findall(class_re, answer_set)
hours = re.findall(hours_re, answer_set)
......
import gradaudit.util as util
import gradaudit.extract as extract
from flask import Flask, render_template, request
from response import Response
from gasresponse import GASResponse
from tempfile import NamedTemporaryFile
app = Flask(__name__)
......@@ -39,6 +39,6 @@ def submit():
transcript = util.Transcript(
name, degree, major, year, spec, classes.split(','))
resp = Response(transcript)
resp = GASResponse(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