summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-08-22 11:30:58 +0200
committerSanto Cariotti <sancn@live.com>2017-08-22 11:30:58 +0200
commitb6f3a3ff002cbfa33d7544f7e5fca907fa5c306c (patch)
tree0dc519d299576dd8f865c4fa878cf4d3c353c7f9 /lib
parentc9b925158e52e67c41b94555b52470eff8b91ca0 (diff)
fixed counter of todo
Diffstat (limited to 'lib')
-rw-r--r--lib/commands.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/commands.py b/lib/commands.py
index eaeaf98..c3f88ee 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -64,12 +64,14 @@ class Commands(object):
for num, i in enumerate(todolist): #num = index, i = value
print('| {} |\t {}'.format(num, i.decode('utf-8')))
elif cmd[1] == 'ctodo':
- count = r.get('idTODO')
-
- if count is None: #if idTODO is None or 0
+ with open(co['path'], 'rb') as fout:
+ for i, val in enumerate(fout.readlines()):
+ count = i
+
+ if count is 0: #if idTODO is None or 0
print('0')
else:
- print(count.decode('utf-8'))
+ print(count)
else:
raise KeyError
except (IndexError, KeyError) as e: