diff options
author | Santo Cariotti <sancn@live.com> | 2017-08-22 11:35:01 +0200 |
---|---|---|
committer | Santo Cariotti <sancn@live.com> | 2017-08-22 11:35:01 +0200 |
commit | 53d71f4b358aafc53c4ed4bdc335599cf183a8c7 (patch) | |
tree | e612d4c1cc5ca922a7d7fa239a70cddbaf9257fe /lib | |
parent | b6f3a3ff002cbfa33d7544f7e5fca907fa5c306c (diff) |
add TODO
Diffstat (limited to 'lib')
-rw-r--r-- | lib/commands.py | 10 |
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 |