diff --git a/error.py b/error.py index 72e7e28..f86feef 100644 --- a/error.py +++ b/error.py @@ -1,9 +1,7 @@ #! python import json -f = open('./output/students.json') -students = json.load(f) -f.close() +with open('./output/students.json') as f: students = json.load(f) couldnt_resolve = 0 missing_classes = 0 diff --git a/scheduleGenerator/generator.py b/scheduleGenerator/generator.py index 4eca871..2c2745c 100644 --- a/scheduleGenerator/generator.py +++ b/scheduleGenerator/generator.py @@ -37,9 +37,8 @@ from util.generateCourses import getSampleCourses } ''' -def exists(n): return True if n not in ('', None) else False - -def getLineNumber(): return currentframe().f_back.f_lineno +exists = lambda n : True if n not in ('', None) else False +getLineNumber = lambda : currentframe().f_back.f_lineno # Takes in information to create or add a new conflict # Returns if the particular student has a previous error