1.1 --- a/imiptools/data.py Sat Dec 16 22:01:04 2017 +0100
1.2 +++ b/imiptools/data.py Sat Dec 16 22:44:26 2017 +0100
1.3 @@ -1236,13 +1236,9 @@
1.4 if not selector:
1.5 return iter([main_period])
1.6
1.7 - parameters = get_parameters(rrule)
1.8 - until = parameters and parameters.get("UNTIL") or None
1.9 - until = until and to_timezone(get_datetime(until), tzid)
1.10 -
1.11 # Obtain the periods generated by the rule.
1.12
1.13 - rule_periods = get_periods_using_selector(selector, until,
1.14 + rule_periods = get_periods_using_selector(selector,
1.15 main_period, tzid, start, end,
1.16 inclusive)
1.17
1.18 @@ -1262,7 +1258,7 @@
1.19
1.20 return filter(lambda p, excluded=exdates: p not in excluded, periods)
1.21
1.22 -def get_periods_using_selector(selector, until, main_period, tzid, start, end,
1.23 +def get_periods_using_selector(selector, main_period, tzid, start, end,
1.24 inclusive=False):
1.25
1.26 # Filter periods using a start point. The period from the given start
1.27 @@ -1270,7 +1266,7 @@
1.28 # included. The end will be handled in the materialisation process.
1.29
1.30 return ifilter(Period(start, None).wraps,
1.31 - RulePeriodCollection(selector, until, main_period, tzid,
1.32 + RulePeriodCollection(selector, main_period, tzid,
1.33 end, inclusive))
1.34
1.35 def get_main_period(periods):
2.1 --- a/imiptools/period.py Sat Dec 16 22:01:04 2017 +0100
2.2 +++ b/imiptools/period.py Sat Dec 16 22:44:26 2017 +0100
2.3 @@ -422,11 +422,11 @@
2.4
2.5 "A collection of rule periods."
2.6
2.7 - def __init__(self, selector, until, main_period, tzid, end, inclusive=False):
2.8 + def __init__(self, selector, main_period, tzid, end, inclusive=False):
2.9
2.10 """
2.11 - Initialise a period collection for the given 'selectors', limited by any
2.12 - 'until' datetime, employing the 'main_period' and 'tzid'.
2.13 + Initialise a period collection for the given 'selectors', employing the
2.14 + 'main_period' and 'tzid'.
2.15
2.16 The specified 'end' datetime indicates the end of the window for which
2.17 periods shall be computed.
2.18 @@ -438,18 +438,8 @@
2.19 self.selector = selector
2.20 self.main_period = main_period
2.21 self.tzid = tzid
2.22 -
2.23 - # Any UNTIL qualifier changes the nature of the end of the collection.
2.24 -
2.25 - if until:
2.26 - if to_datetime(end, tzid) < to_datetime(until, tzid):
2.27 - self.end = end
2.28 - else:
2.29 - self.end = until
2.30 - self.inclusive = True
2.31 - else:
2.32 - self.end = end
2.33 - self.inclusive = inclusive
2.34 + self.end = end
2.35 + self.inclusive = inclusive
2.36
2.37 def __iter__(self):
2.38