Changeset 3278

Show
Ignore:
Timestamp:
04/17/08 09:34:22 (6 months ago)
Author:
swolter
Message:

Fixed a bug concerning the conversion from XML repetiton rules to the
moto weekday repetition field. The function took the day of month as
an argument for weekday computation, which only worked if the month
an event started in started with a tuesday.

Now it takes the weekday.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/moto-sync/motosync.py

    r3277 r3278  
    388388            return rest 
    389389 
    390 def moto_weekdays_to_repeat_day(weekdays, eventday): 
     390def moto_weekdays_to_repeat_day(weekdays, eventweekday): 
    391391    """Returns the repeat_day value given a set of days on which a weekly event repeats.""" 
    392392 
    393     return sum([2 ** (6 - (day - eventday) % 7) for day in weekdays]) 
     393    return sum([2 ** (6 - (day - eventweekday) % 7) for day in weekdays]) 
    394394 
    395395def moto_repeat_day_to_monthday(repeat_day): 
     
    520520            byday_nums = [daynum for (_, daynum) in byday_pairs] 
    521521            if byday_nums != [eventdt.day]: 
    522                 ret['repeat_day'] = moto_weekdays_to_repeat_day(byday_nums, eventdt.day
     522                ret['repeat_day'] = moto_weekdays_to_repeat_day(byday_nums, eventdt.weekday()
    523523    elif (freq == 'MONTHLY' and not byday and (not bymonthday or bymonthday == set([eventdt.day])) 
    524524            and not byyearday and (not bymonth or bymonth == byallmonths)):