Mercurial > hg > gcmultimerge
comparison multimerge.py @ 60:37705c4a35e1
Show target calendar information in debug mode.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 06 Jul 2016 12:24:09 +0300 |
parents | a8941896c21c |
children | 9fe4faa80687 |
comparison
equal
deleted
inserted
replaced
59:a8941896c21c | 60:37705c4a35e1 |
---|---|
380 | 380 |
381 | 381 |
382 ## Filter desired SOURCE calendars based on specified regexp | 382 ## Filter desired SOURCE calendars based on specified regexp |
383 src_re = re.compile(cfg.source_regex, re.UNICODE) | 383 src_re = re.compile(cfg.source_regex, re.UNICODE) |
384 src_calendars = [] | 384 src_calendars = [] |
385 dst_calendar = None | |
385 for calendar in calendars: | 386 for calendar in calendars: |
386 if u"summary" in calendar: | 387 if u"summary" in calendar: |
387 # Find destination calendar ID if not set | 388 # Find destination calendar ID if not set |
388 if not cfg.dest_id and cfg.dest_name == calendar["summary"].strip(): | 389 if not cfg.dest_id and cfg.dest_name == calendar["summary"].strip(): |
389 cfg.mset("dest_id", calendar["id"]) | 390 cfg.mset("dest_id", calendar["id"]) |
391 dst_calendar = calendar | |
390 | 392 |
391 # If summary or summaryOverride match the regexp, add calendar | 393 # If summary or summaryOverride match the regexp, add calendar |
392 mre = src_re.match(calendar["summary"]) | 394 mre = src_re.match(calendar["summary"]) |
393 if not mre and u"summaryOverride" in calendar: | 395 if not mre and u"summaryOverride" in calendar: |
394 mre = src_re.match(calendar[u"summaryOverride"]) | 396 mre = src_re.match(calendar[u"summaryOverride"]) |
400 | 402 |
401 gcm_debug(u"{0} source calendars found.".format(len(src_calendars))) | 403 gcm_debug(u"{0} source calendars found.".format(len(src_calendars))) |
402 | 404 |
403 | 405 |
404 ## Check if we have destination calendar ID | 406 ## Check if we have destination calendar ID |
405 if not cfg.dest_id: | 407 if not dst_calendar: |
406 gcm_fatal(u"Could not find target/destination calendar ID for '"+ cfg.dest_name +"'.") | 408 gcm_fatal(u"Could not find target/destination calendar ID for '"+ cfg.dest_name +"'.") |
409 else: | |
410 gcm_debug(u"Target calendar '{0}' id {1}.".format(dst_calendar["summary"], dst_calendar["id"])) | |
407 | 411 |
408 | 412 |
409 ## Now, we fetch and collect events | 413 ## Now, we fetch and collect events |
410 gcm_debug(u"Fetching calendar events .. ") | 414 gcm_debug(u"Fetching calendar events .. ") |
411 src_events = [] | 415 src_events = [] |