1.1 --- a/imiptools/period.py Sun Oct 18 23:24:37 2015 +0200
1.2 +++ b/imiptools/period.py Sun Oct 18 23:32:32 2015 +0200
1.3 @@ -794,11 +794,14 @@
1.4
1.5 return d
1.6
1.7 -def add_empty_days(days, tzid):
1.8 +def add_empty_days(days, tzid, start=None, end=None):
1.9
1.10 - "Add empty days to 'days' between busy days."
1.11 + """
1.12 + Add empty days to 'days' between busy days, and optionally from the given
1.13 + 'start' day and until the given 'end' day.
1.14 + """
1.15
1.16 - last_day = None
1.17 + last_day = start
1.18 all_days = days.keys()
1.19 all_days.sort()
1.20
1.21 @@ -808,7 +811,13 @@
1.22 while empty_day < day:
1.23 days[empty_day] = [(Point(get_start_of_day(empty_day, tzid)), None)]
1.24 empty_day += timedelta(1)
1.25 - last_day = day
1.26 + last_day = day
1.27 +
1.28 + if end:
1.29 + empty_day = last_day + timedelta(1)
1.30 + while empty_day < end:
1.31 + days[empty_day] = [(Point(get_start_of_day(empty_day, tzid)), None)]
1.32 + empty_day += timedelta(1)
1.33
1.34 def get_spans(slots):
1.35