Example #1
0
 def show_workday_description(self):
     return self.day_of_the_week, self.code, hour_minute(
         self.start_time), hour_minute(self.end_time), hour_minute(
             self.get_workday_time())
Example #2
0
 def __str__(self):
     return str(
         self.code) if self.location is None or self.time is None else str(
             self.location) + '-' + str(hour_minute(self.time))
Example #3
0
 def __str__(self):
     return str(self.station) + '-' + str(hour_minute(self.time))
Example #4
0
 def __str__(self) -> str:
     return str(hour_minute(self.start_time)) + "-" + str(
         hour_minute(self.end_time))
Example #5
0
        self.workday_sequence = sequence

    def get_duration(self):
        duration = 0
        for workday in self.workday_sequence:
            duration += workday.get_workday_time()
        return duration

    def show_workdays(self):
        workdays_press = []
        for workday in self.workday_sequence:
            workdays_press.append(workday.show_workday_description())
        return workdays_press


if __name__ == '__main__':
    wk1_bd = Workday(week_day='business_day',
                     code='1M',
                     start_time='08:00',
                     end_time='15:00',
                     break_duration_time='00:30')
    wk1_sd = Workday(week_day='saturday',
                     code='1M',
                     start_time='08:10',
                     end_time='15:10',
                     break_duration_time='00:30')
    week_sequence = WorkdaySequence([wk1_bd, wk1_sd])
    print(week_sequence.show_workdays())
    print(week_sequence.get_duration(),
          hour_minute(week_sequence.get_duration()))