imip-agent

Change of imiptools/period.py

395:df76475bf82c
imiptools/period.py
     1.1 --- a/imiptools/period.py	Sat Mar 07 00:13:41 2015 +0100
     1.2 +++ b/imiptools/period.py	Sun Mar 08 01:35:43 2015 +0100
     1.3 @@ -33,7 +33,7 @@
     1.4      """
     1.5  
     1.6      for conflict in have_conflict(freebusy, periods, True):
     1.7 -        start, end, found_uid, found_transp, found_recurrenceid = conflict
     1.8 +        start, end, found_uid, found_transp, found_recurrenceid = conflict[:5]
     1.9          if found_uid != uid and found_recurrenceid != recurrenceid:
    1.10              return False
    1.11  
    1.12 @@ -390,7 +390,7 @@
    1.13      for point, active in slots:
    1.14          for t in active:
    1.15              if t and len(t) >= 2:
    1.16 -                start, end, uid, recurrenceid, key = get_freebusy_details(t)
    1.17 +                start, end, uid, recurrenceid, summary, organiser, key = get_freebusy_details(t)
    1.18  
    1.19                  try:
    1.20                      start_slot = points.index(start)
    1.21 @@ -406,12 +406,15 @@
    1.22  
    1.23  def get_freebusy_details(t):
    1.24  
    1.25 -    "Return a tuple of the form (start, end, uid, recurrenceid, key) from 't'."
    1.26 +    """
    1.27 +    Return a tuple of the form (start, end, uid, recurrenceid, summary,
    1.28 +    organiser, key) from 't'.
    1.29 +    """
    1.30  
    1.31      # Handle both complete free/busy details...
    1.32  
    1.33 -    if len(t) > 4:
    1.34 -        start, end, uid, transp, recurrenceid = t[:5]
    1.35 +    if len(t) >= 7:
    1.36 +        start, end, uid, transp, recurrenceid, summary, organiser = t[:7]
    1.37          key = uid, recurrenceid
    1.38  
    1.39      # ...and published details without specific event details.
    1.40 @@ -420,20 +423,22 @@
    1.41          start, end = t[:2]
    1.42          uid = None
    1.43          recurrenceid = None
    1.44 +        summary = None
    1.45 +        organiser = None
    1.46          key = (start, end)
    1.47  
    1.48 -    return start, end, uid, recurrenceid, key
    1.49 +    return start, end, uid, recurrenceid, summary, organiser, key
    1.50  
    1.51 -def update_freebusy(freebusy, periods, transp, uid, recurrenceid):
    1.52 +def update_freebusy(freebusy, periods, transp, uid, recurrenceid, summary, organiser):
    1.53  
    1.54      """
    1.55 -    Update the free/busy details with the given 'periods', 'transp' setting and
    1.56 -    'uid' plus 'recurrenceid'.
    1.57 +    Update the free/busy details with the given 'periods', 'transp' setting,
    1.58 +    'uid' plus 'recurrenceid' and 'summary' and 'organiser' details.
    1.59      """
    1.60  
    1.61      remove_period(freebusy, uid, recurrenceid)
    1.62  
    1.63      for start, end in periods:
    1.64 -        insert_period(freebusy, (start, end, uid, transp, recurrenceid))
    1.65 +        insert_period(freebusy, (start, end, uid, transp, recurrenceid, summary, organiser))
    1.66  
    1.67  # vim: tabstop=4 expandtab shiftwidth=4