def _main():
args = docopt(__doc__, version="1")
print("Loading courses...")
courses = json.load(open(args['--file']), object_pairs_hook=OrderedDict)
college = args['<college>']
course_number = args['<course_number>']
for matching_course in get_course_instances(courses, college, course_number):
print(get_term(matching_course))
print(matching_course['title'])
max_teach_len = max(map(len, (x['Instructor'] for x in matching_course['sections'].values() if 'Instructor' in x)))
for section_number, section in matching_course['sections'].items():
if 'Instructor' in section:
print("Section {} - {:<{}s} ({}/{})"
.format(section_number,
section['Instructor'],
max_teach_len,
section['Enrolled'],
section['Class Max']))
print("")
评论列表
文章目录