From 53d71f4b358aafc53c4ed4bdc335599cf183a8c7 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 22 Aug 2017 11:35:01 +0200 Subject: add TODO --- lib/commands.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3-18-g5258