chiark / gitweb /
add utility function to pop an event from the cache
authorMatthew Vernon <mv3@sanger.ac.uk>
Fri, 19 Oct 2018 10:21:36 +0000 (11:21 +0100)
committerMatthew Vernon <mv3@sanger.ac.uk>
Fri, 19 Oct 2018 10:21:36 +0000 (11:21 +0100)
gooswapper.py

index a4029f0971779d625a847e7338f31d363cea1c8e..b14a6954d5865547df89141990ccc921da4edf79 100644 (file)
@@ -56,6 +56,14 @@ class ex_gcal_link(exchangelib.ExtendedProperty):
 
 exchangelib.CalendarItem.register('gcal_link',ex_gcal_link)
 
+#useful if you want to replay an event
+def drop_from_ex_cache(itemid):
+    with open(cachepath,"rb") as f:
+        cache = pickle.load(f)
+    cache.pop(itemid)
+    with open(cachepath,"wb") as f:
+        pickle.dump(cache,f)
+
 def get_ex_event_by_itemid(calendar,itemid):
     return calendar.get(item_id=itemid)