PageRenderTime 81ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 38ms app.codeStats 0ms

/pyjs/tests/test019.py

http://pyjamas.googlecode.com/
Python | 20 lines | 17 code | 3 blank | 0 comment | 6 complexity | c6ccffc5c6ee341040743dcbfb791107 MD5 | raw file
 1class Schedule:
 2
 3    def __init__(self):
 4        self.timeSlots = []
 5
 6    def addTimeSlot(self, timeSlot):
 7        self.timeSlots.append(timeSlot)
 8        
 9    def getDescription(self, daysFilter):
10        s = None
11        for timeSlot in self.timeSlots:
12            if daysFilter[timeSlot.dayOfWeek]:
13                if not s:
14                    s = timeSlot.getDescription()
15                else:
16                    s += ", " + timeSlot.getDescription()
17        if s:
18            return s
19        else:
20            return ""