chiark
/
gitweb
/
~matthewv
/
gooswapper
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3185bdd
)
handle empty subjects when matching
author
Matthew Vernon
<mv3@sanger.ac.uk>
Tue, 23 Oct 2018 15:40:44 +0000
(16:40 +0100)
committer
Matthew Vernon
<mv3@sanger.ac.uk>
Tue, 23 Oct 2018 15:40:44 +0000
(16:40 +0100)
gooswapper.py
patch
|
blob
|
history
diff --git
a/gooswapper.py
b/gooswapper.py
index 89ec41e882609ac4c4025bfbb96e3e79714e1862..ffad0e0bbf82a697dcf573d0a0cb7ecaf0bd4c21 100644
(file)
--- a/
gooswapper.py
+++ b/
gooswapper.py
@@
-342,7
+342,9
@@
def match_ex_to_gcal(ex_acct,gcal_acct,gcal_tz,events,gcal_id="primary",ignore_l
timeMin=event.start.isoformat(),
timeMax=event.end.isoformat()).execute()
for ge in matches['items']:
timeMin=event.start.isoformat(),
timeMax=event.end.isoformat()).execute()
for ge in matches['items']:
- if ge['summary'].strip()==event.subject.strip():
+ if ( ge.get("summary") is None and event.subject is None ) or \
+ ( ge.get("summary") is not None and event.subject is not None \
+ and ge['summary'].strip()==event.subject.strip()):
logger.info("Matching '%s' starting at %s" % (event.subject,
event.start.isoformat()))
event.gcal_link = ge['id']
logger.info("Matching '%s' starting at %s" % (event.subject,
event.start.isoformat()))
event.gcal_link = ge['id']