-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtasksync.py
More file actions
30 lines (25 loc) · 744 Bytes
/
tasksync.py
File metadata and controls
30 lines (25 loc) · 744 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
import TheHitList
from subprocess import *
import gtasks
import sys
thl = TheHitList.Application()
passwd = sys.argv[2]
user = sys.argv[1]
if len(sys.argv) < 3:
print """"Run this script with your Google email and password. \n
Ex: python tasksync.py [email protected] hunter2
"""
sys.exit()
if len(sys.argv) > 3:
tag = " " + sys.argv[3]
else:
tag = " /gtasks"
#kludge to get the tasks...
# TODO: when I hack the gtasks script to be importable this will go away
#tasks_raw = Popen(['python', 'gtasks.py', '-e', user, '-p', passwd], stdout=PIPE).communicate()[0]
#gtasks = tasks_raw.splitlines()
gtasks = gtasks.gtasks(user, passwd, '* ')
for gtask in gtasks:
task = gtask + tag
print task
thl.new_task(task)