# HG changeset patch # User Paul Boddie # Date 1431534672 -7200 # Node ID 8e7d26d5c4707d74efd301a0d0f4127a99ce92a7 # Parent 6f69026c2e324ee8e18e0f01f2636508d0884dbe Support UNTIL in RRULE descriptions. diff -r 6f69026c2e32 -r 8e7d26d5c470 imiptools/data.py --- a/imiptools/data.py Wed May 13 17:52:31 2015 +0200 +++ b/imiptools/data.py Wed May 13 18:31:12 2015 +0200 @@ -433,6 +433,11 @@ parameters = get_parameters(rrule) periods = [] + until = parameters.get("UNTIL") + if until: + window_end = min(to_timezone(get_datetime(until, dtstart_attr), tzid), window_end) + inclusive = True + for start in selector.materialise(dtstart, window_end, parameters.get("COUNT"), parameters.get("BYSETPOS"), inclusive): start = to_timezone(datetime(*start), tzid) end = start + duration diff -r 6f69026c2e32 -r 8e7d26d5c470 vRecurrence.py --- a/vRecurrence.py Wed May 13 17:52:31 2015 +0200 +++ b/vRecurrence.py Wed May 13 18:31:12 2015 +0200 @@ -31,7 +31,8 @@ FREQ defines the selection resolution. DTSTART defines the start of the selection. INTERVAL defines the step of the selection. -COUNT defines a number of instances; UNTIL defines a limit to the selection. +COUNT defines a number of instances +UNTIL defines a limit to the selection. BY... qualifiers select instances within each outer selection instance according to the recurrence of instances of the next highest resolution. For example, @@ -118,6 +119,8 @@ key, value = parts if key in ("COUNT", "BYSETPOS"): d[key] = int(value) + else: + d[key] = value return d def get_qualifiers(values):