From e3496045ef68b1e83e5570b2608f14b2fcdb49f2 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Fri, 21 Jul 2017 19:32:11 +0200 Subject: added web style --- lib/commands.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/commands.py') diff --git a/lib/commands.py b/lib/commands.py index 45789f1..c61d698 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -101,10 +101,10 @@ class Commands(object): print('nessun todo con questo id') else: try: - msg = msgFromId(cmd[1]) #return value of sorted set's rank + msg = self.msgFromId(cmd[1]) #return value of sorted set's rank r.zrem('todo', msg) r.decr('idTODO') - print('Ok %s' % msg) + print('Ok') except: print('0') except IndexError: @@ -112,8 +112,7 @@ class Commands(object): except KeyError: ListCommands.err('keyword') - @staticmethod - def msgFromId(value): + def msgFromId(self, value): for i, val in enumerate(r.zrange('todo', 0, -1)): if i == int(value): return val.decode('utf-8') -- cgit v1.2.3-18-g5258