Mercurial > hg > gcmultimerge
diff multimerge.py @ 85:da09a3b1edaa
Count and report number of purged events.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 26 Jul 2016 15:14:44 +0300 |
parents | 16edb168daa1 |
children | d9e799a27ceb |
line wrap: on
line diff
--- a/multimerge.py Wed Jul 13 15:38:12 2016 +0300 +++ b/multimerge.py Tue Jul 26 15:14:44 2016 +0300 @@ -584,15 +584,20 @@ ## Remove "stale" events gcm_debug(3, u"Purging stale events ..") +evn_purged = 0 for event in dst_events: gcm_debug(4, u"Checking event {0}".format(event["gcm_id"])) if not event["gcm_id"] in src_ids and event["status"] != u"cancelled": gcm_debug(4, u"Deleting event {0}".format(event["gcm_id"])) + evn_purged += 1 try: service.events().delete(calendarId=cfg.dest_id, eventId=event["id"]).execute() except Exception as e: gcm_fatal(u"Failed to delete stale event:\n{0}\n\nERROR: {1}\n".format(event, str(e))) +gcm_debug(3, "{0} events purged.".format(evn_purged)) + + ## ## Finally, update the calendar name with timestamp ##