Skip to content
Newer
Older
100644 25 lines (20 sloc) 655 Bytes
04ee480 first svn add of trunk
lkcl authored
1 from TimeSlot import TimeSlot
2
3 class Schedule:
4
1abeb00 Added arguments for instance initialization in jsObjectToPyObject
keesbos authored
5 def __init__(self, timeSlots = None):
04ee480 first svn add of trunk
lkcl authored
6 self.timeSlots = []
4ee1c45 @keesbos Fix for issue #581 : DynaTable example and __jsonclass__ bug
keesbos authored
7 if timeSlots is not None:
1abeb00 Added arguments for instance initialization in jsObjectToPyObject
keesbos authored
8 self.timeSlots = timeSlots
04ee480 first svn add of trunk
lkcl authored
9
10 def addTimeSlot(self, timeSlot):
11 self.timeSlots.append(timeSlot)
64eff55 @xtfxme find * -name '*.py' | xargs sed -i -r 's,\s+$,,'
xtfxme authored
12
04ee480 first svn add of trunk
lkcl authored
13 def getDescription(self, daysFilter):
14 s = None
15 for timeSlot in self.timeSlots:
16 if daysFilter[timeSlot.dayOfWeek]:
4ee1c45 @keesbos Fix for issue #581 : DynaTable example and __jsonclass__ bug
keesbos authored
17 if s is None:
04ee480 first svn add of trunk
lkcl authored
18 s = timeSlot.getDescription()
19 else:
20 s += ", " + timeSlot.getDescription()
4ee1c45 @keesbos Fix for issue #581 : DynaTable example and __jsonclass__ bug
keesbos authored
21 if s is None:
1abeb00 Added arguments for instance initialization in jsObjectToPyObject
keesbos authored
22 return ""
4ee1c45 @keesbos Fix for issue #581 : DynaTable example and __jsonclass__ bug
keesbos authored
23 else:
24 return s
Something went wrong with that request. Please try again.