Mercurial > hg > gcmultimerge
changeset 37:c1764df8b65c
Update events.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 05 Jul 2016 10:49:42 +0300 |
parents | 2d7767f0fb67 |
children | 54405de302d0 |
files | multimerge.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/multimerge.py Tue Jul 05 10:36:22 2016 +0300 +++ b/multimerge.py Tue Jul 05 10:49:42 2016 +0300 @@ -420,7 +420,10 @@ # Does the event exist already in the target? if event["gcm_id"] in dst_gcm_ids: ## Yes. Thus, we just update the event. - event["status"] = "confirmed" + try: + new_event = service.events().update(calendarId=cfg.dest_id, eventId=event["id"], body=event).execute() + except Exception as e: + gcm_fatal("Failed to update event:\n{0}\n\nERROR: {1}\n".format(event, str(e))) else: ## Event does not seem to exist. Insert new event. event.pop("iCalUID", None) # Remove the iCalUID, having it conflicts with event ID