# HG changeset patch # User Matti Hamalainen # Date 1469535284 -10800 # Node ID da09a3b1edaa4bda96d17b7a887d6b145080145d # Parent 16edb168daa1d9f6798ceffc7b20cf75c5dcf4a0 Count and report number of purged events. diff -r 16edb168daa1 -r da09a3b1edaa multimerge.py --- 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 ##