-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.py
More file actions
executable file
·42 lines (35 loc) · 960 Bytes
/
sync.py
File metadata and controls
executable file
·42 lines (35 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
from lib.Workflowy import Workflowy
from lib.GCal import GCal
from lib.Event import Event
def main():
wf = Workflowy()
if wf.has_init():
wf.parse_init()
elif wf.has_session():
wf.init()
wf.parse_init()
else:
wf.login()
gcal = GCal()
events = wf.get_events()
for event in events:
gcalEvent = gcal.get_event(event.uuid)
if gcalEvent:
print("Updating event: " + event.name)
gcal.update_event(
gcalEvent["id"],
event.name,
event.start.isoformat(),
event.end.isoformat(),
)
else:
print("Inserting event: " + event.name)
gcal.insert_event(
event.uuid,
event.name,
event.start.isoformat(),
event.end.isoformat(),
)
if __name__ == "__main__":
main()