def estimate_hours(normalized_hours): start_time = get_estimated_start_time(normalized_hours) end_time = get_estimated_end_time(normalized_hours) estimated_hours = workhours.WorkingHours() estimated_hours.date = normalized_hours[0].date estimated_hours.start = start_time estimated_hours.end = end_time estimated_hours.potential_start = [] estimated_hours.potential_end = [] for potential_hours in normalized_hours: estimated_hours.potential_start.append(potential_hours.start) estimated_hours.potential_end.append(potential_hours.end) return estimated_hours
def parse_workingperiod(line): workingperiod = workhours.WorkingHours() workingperiod.date = parsedate(line) workingperiod.start = parsestarttime(line) workingperiod.end = parseendtime(line) return workingperiod
def new_working_hours_on(date, start, end): hours = workhours.WorkingHours() hours.date = datetime.strptime(date, '%d/%m/%Y') hours.start = datetime.strptime(start, '%M:%H') hours.end = datetime.strptime(end, '%M:%H') return hours
def new_workinghours(start, end): hours = workhours.WorkingHours() hours.start = datetime.datetime.strptime(start, '%H:%M') hours.end = datetime.datetime.strptime(end, '%H:%M') return [hours]
def setUp(self): self.hours = workhours.WorkingHours()