# HG changeset patch # User Matti Hamalainen # Date 1467730871 -10800 # Node ID f8618bae162a32e35dbcdab49139fb5fbc1c7c1a # Parent cc30383f5f0d87a20a3bc2406ae5dde56d6a2622 Improve debug messages and comments. diff -r cc30383f5f0d -r f8618bae162a multimerge.py --- a/multimerge.py Tue Jul 05 18:00:59 2016 +0300 +++ b/multimerge.py Tue Jul 05 18:01:11 2016 +0300 @@ -357,12 +357,15 @@ if len(calendars) == 0: gcm_fatal("No calendars found?") +gcm_debug(u"{0} calendars total found.".format(len(calendars))) + ## Filter desired SOURCE calendars based on specified regexp src_re = re.compile(cfg.source_regex, re.UNICODE) src_calendars = [] for calendar in calendars: if "summary" in calendar: + # Find destination calendar ID if not set if not cfg.dest_id and cfg.dest_name == calendar["summary"].strip(): cfg.mset("dest_id", calendar["id"]) @@ -372,8 +375,10 @@ calendar["gcm_id"] = mre.group(cfg.source_regmap[1]) src_calendars.append(calendar) +gcm_debug(u"{0} source calendars found.".format(len(src_calendars))) -## Check if we have target ID + +## Check if we have destination calendar ID if not cfg.dest_id: gcm_fatal(u"Could not find target/destination calendar ID for '"+ cfg.dest_name +"'.")