i.e. if you have an event in Exchange where a matching google event
isn't found by matching, then create that event in google.
recur = 0
matched = 0
skipped = 0
recur = 0
matched = 0
skipped = 0
for ev_id in events:
event = get_ex_event_by_itemid(ex_acct.calendar,ev_id)
for ev_id in events:
event = get_ex_event_by_itemid(ex_acct.calendar,ev_id)
-# if event.is_recurring:
-# recur += 1
-# continue
-#next line needs to be elif if above uncommented
if event.gcal_link is not None and ignore_link is False:
skipped += 1
continue
if event.gcal_link is not None and ignore_link is False:
skipped += 1
continue
matches = gcal_acct.events().list(calendarId=gcal_id,
timeMin=event.start.isoformat(),
timeMax=event.end.isoformat()).execute()
matches = gcal_acct.events().list(calendarId=gcal_id,
timeMin=event.start.isoformat(),
timeMax=event.end.isoformat()).execute()
if err.resp.status == 403:
pass
matched += 1
if err.resp.status == 403:
pass
matched += 1
+ if missing == True:
+ toadd.append(ev_id)
logger.info("Matched %d events, skipped %d with existing link, and %d recurring ones" % (matched,skipped,recur))
logger.info("Matched %d events, skipped %d with existing link, and %d recurring ones" % (matched,skipped,recur))
def get_gcal_cred():
#each such file can only store a single credential
def get_gcal_cred():
#each such file can only store a single credential
del_ex_to_gcal(ex_account,gcal_account,cache,deleted)
update_ex_to_gcal(ex_account,gcal_account,gcal_tz,current,changed)
else:
del_ex_to_gcal(ex_account,gcal_account,cache,deleted)
update_ex_to_gcal(ex_account,gcal_account,gcal_tz,current,changed)
else:
- match_ex_to_gcal(ex_account,gcal_account,gcal_tz,current)
+ toadd = match_ex_to_gcal(ex_account,gcal_account,gcal_tz,current)
+ add_ex_to_gcal(ex_account,gcal_account,gcal_tz,current,toadd)
with open(cachepath,"wb") as f:
pickle.dump(current,f)
with open(cachepath,"wb") as f:
pickle.dump(current,f)