Minor changes

parent 5d9ce6f6
......@@ -16,19 +16,15 @@
You should have received a copy of the GNU General Public License
along with Graduation Audit System. If not, see <http://www.gnu.org/licenses/>.
"""
"""
This program writes writes <bs/ba><major><year>req2.lp.
Pass in the degree major and year as command line arguments.
"""
from __future__ import print_function
import re
import sys
import gradaudit
def main():
"""
This program writes writes <bs/ba><major><year>req2.lp.
Pass in the degree major and year as command line arguments.
Run as:
python req_writer.py <degree_type> <major> <degree_year>
ex: python req_writer.py bs cs 2015
......@@ -42,16 +38,16 @@ def main():
directory = "%s/%s/%s/" % (degree, major, year)
prefix = "%s%s" % (major, year)
# Get list of courses from course.lp
# Get list of courses all from course.lp
courses = gradaudit.get_courses()
with open(directory + prefix + 'req.lp', 'r') as fil:
req = file.read()
# Get list of required courses for this degre plan
req = gradaudit.get_required_courses(degree, major, year)
with open(directory + prefix + 'req2.lp', 'w') as fil:
for course in courses:
if not course in req:
file.write('_req(%s,none).\n' % course)
fil.write('_req(%s,none).\n' % course)
if __name__ == '__main__':
main()
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