summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/commands.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/commands.py b/lib/commands.py
index c3f88ee..f1decba 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -80,16 +80,12 @@ class Commands(object):
ListCommands.err('personal', e.value)
elif what == 'add':
try:
- if r.get('idTODO') is None: #create idTODO if it's null
- r.set('idTODO', '0')
-
- idTODO = r.get('idTODO').decode('utf-8')
-
msg = ' '.join(cmd[1:]) #join first word after 'add' to last word
try:
- r.zadd('todo', msg, idTODO)
- r.incr('idTODO')
+ with open(co['path'], 'ab') as fout:
+ fout.write(('\n' + msg).encode('utf-8'))
+
print('Ok')
except:
raise KeyError