allow lecture view specification to be a comma separated list
This commit is contained in:
parent
81b46dd01b
commit
44b299ad70
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,7 @@ class Lectures(list):
|
|||
elif string == 'prev':
|
||||
return self[-1].number - 1
|
||||
|
||||
def parse_range_string(self, arg):
|
||||
def parse_range_string_section(self, arg):
|
||||
all_numbers = [lecture.number for lecture in self]
|
||||
if 'all' in arg:
|
||||
return all_numbers
|
||||
|
@ -94,6 +94,10 @@ class Lectures(list):
|
|||
|
||||
return [self.parse_lecture_spec(arg)]
|
||||
|
||||
def parse_range_string(self, arg):
|
||||
sets = [set(self.parse_range_string_section(part)) for part in arg.split(',')]
|
||||
return list(set.union(*sets))
|
||||
|
||||
def new_lecture(self):
|
||||
if len(self) != 0:
|
||||
new_lecture_number = self[-1].number + 1
|
||||
|
|
Loading…
Reference in a new issue