def AddSchedule(self, NewRelayNumber, NewScheduleDate, NewRelayState, NewRepeat): self.ScheduleItems.append( ScheduleItem.ScheduleItem(NewRelayNumber, NewScheduleDate, NewRelayState, NewRepeat)) self.SortSchedule() self.Save(True)
def Load(self): try: File = open("Data/Schedule.txt", 'r', 0) Result = True while Result: NewSchedule = ScheduleItem.ScheduleItem(0, 0, 0, 0) Result = NewSchedule.Load(File) if Result: self.ScheduleItems.append(NewSchedule) File.close() self.SortSchedule() except: print("")