You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
840 B
23 lines
840 B
#! /usr/bin/python3
|
|
|
|
class UnIndexable(Exception):
|
|
def __init__(self, course):
|
|
self.course = course
|
|
|
|
@property
|
|
def reason(self):
|
|
course = self.course
|
|
if not course["code"] and not course["title"]:
|
|
message = "there was no course code and no title defined"
|
|
if not course["code"]:
|
|
message = "there was no course code defined"
|
|
if not course["title"]:
|
|
message = "there was no course title defined"
|
|
if not course["sections"]:
|
|
message = "there were no sections defined"
|
|
return """
|
|
There was a problem with indexing this course.
|
|
%s
|
|
There could be several reasons why, my best guess is that %s
|
|
We need at least the course code, title, and one or more sections to index
|
|
""" % (course, message)
|
|
|