summaryrefslogtreecommitdiff
path: root/kanbanscripts/addtask.py
diff options
context:
space:
mode:
Diffstat (limited to 'kanbanscripts/addtask.py')
-rwxr-xr-xkanbanscripts/addtask.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/kanbanscripts/addtask.py b/kanbanscripts/addtask.py
new file mode 100755
index 0000000..59522a2
--- /dev/null
+++ b/kanbanscripts/addtask.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+import os
+from os.path import abspath, dirname
+from operator import itemgetter
+
+class bcolors:
+ HEADER = '\033[95m'
+ OKBLUE = '\033[94m'
+ OKGREEN = '\033[92m'
+ WARNING = '\033[93m'
+ FAIL = '\033[91m'
+ ENDC = '\033[0m'
+project_list = []
+waiting_list = []
+with open('~/notes/gtd.txt', "rw") as todo:
+ waiting = False
+ inprogress = False
+ for line in todo:
+ for part in line.split():
+ if "@waiting" in part:
+ waiting = True
+ project_list.append({
+ "file": f,
+ "name": name,
+ "task": task,
+ "inprogress": inprogress,
+ "waiting": waiting,
+ })
+
+newlist = sorted(project_list, key=itemgetter('name', 'task'))
+
+#projects_file = open("/Users/sng/gtd/@projects.txt", 'w')
+l_name = ''
+for i,p in enumerate(newlist):
+ if not p['inprogress'] and not p['waiting']:
+ if l_name == p['name']:
+ print(p['file'][:-4])
+ else:
+ if i != 0:
+ print(" ")
+ print(p['file'][:-4])
+ l_name = p['name']
+
+for i,p in enumerate(newlist):
+ if i == 0:
+ print(bcolors.WARNING + "\n------ TASKS WAITING -----" + bcolors.ENDC)
+ if p['waiting'] == True:
+ print(p['file'][:-4])