imip-agent

Change of imiptools/period.py

381:f5fe45d84ecc
imiptools/period.py recurring-events
     1.1 --- a/imiptools/period.py	Thu Mar 05 15:26:50 2015 +0100
     1.2 +++ b/imiptools/period.py	Thu Mar 05 16:30:13 2015 +0100
     1.3 @@ -82,6 +82,21 @@
     1.4          else:
     1.5              i += 1
     1.6  
     1.7 +def remove_additional_periods(freebusy, uid):
     1.8 +
     1.9 +    """
    1.10 +    Remove from 'freebusy' all periods associated with 'uid' having a
    1.11 +    recurrence identifier indicating an additional or modified period.
    1.12 +    """
    1.13 +
    1.14 +    i = 0
    1.15 +    while i < len(freebusy):
    1.16 +        t = freebusy[i]
    1.17 +        if len(t) >= 5 and t[2] == uid and t[4]:
    1.18 +            del freebusy[i]
    1.19 +        else:
    1.20 +            i += 1
    1.21 +
    1.22  def remove_affected_period(freebusy, uid, recurrenceid):
    1.23  
    1.24      """