Mercurial > hg > gcmultimerge
comparison multimerge.py @ 107:f3949e4aca4b
We should not fetch single events. It is bad for you.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 18 Oct 2016 11:55:14 +0300 |
parents | 481cfea49e19 |
children | 7677c4992381 |
comparison
equal
deleted
inserted
replaced
105:481cfea49e19 | 107:f3949e4aca4b |
---|---|
520 gcm_debug(4, u"- {0} ({1})".format(calendar["id"], calendar["summary"])) | 520 gcm_debug(4, u"- {0} ({1})".format(calendar["id"], calendar["summary"])) |
521 try: | 521 try: |
522 result = service.events().list( | 522 result = service.events().list( |
523 timeZone="EEST", | 523 timeZone="EEST", |
524 calendarId=calendar["id"], | 524 calendarId=calendar["id"], |
525 singleEvents=True, | 525 singleEvents=False, |
526 showDeleted=False, | 526 showDeleted=False, |
527 # orderBy="startTime", | 527 # orderBy="startTime", |
528 ).execute() | 528 ).execute() |
529 except Exception as e: | 529 except Exception as e: |
530 gcm_fatal(u"Failed to fetch calendar events for {0}:\n\n{1}\n\nERROR: {2}\n".format(calendar["id"], calendar, str(e))) | 530 gcm_fatal(u"Failed to fetch calendar events for {0}:\n\n{1}\n\nERROR: {2}\n".format(calendar["id"], calendar, str(e))) |
553 | 553 |
554 ## Get current events | 554 ## Get current events |
555 gcm_debug(3, u"Fetching current target calendar events.") | 555 gcm_debug(3, u"Fetching current target calendar events.") |
556 result = service.events().list( | 556 result = service.events().list( |
557 calendarId=cfg.dst_id, | 557 calendarId=cfg.dst_id, |
558 singleEvents=True, | 558 singleEvents=False, |
559 showDeleted=True, | 559 showDeleted=True, |
560 ).execute() | 560 ).execute() |
561 | 561 |
562 dst_events = gcm_generate_ids(result.get("items", []), "", "") | 562 dst_events = gcm_generate_ids(result.get("items", []), "", "") |
563 gcm_debug(3, u"Found {0} event(s).".format(len(dst_events))) | 563 gcm_debug(3, u"Found {0} event(s).".format(len(dst_events))) |