From 6d1aff6894408c89d7a549076293fe011e475eb0 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 20 Jul 2017 13:24:34 +0200 Subject: added get comand --- app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index 2dc8f66..1d9b65b 100644 --- a/app.py +++ b/app.py @@ -9,16 +9,16 @@ class Stout(Commands): self.user = Stout.username() def getName(self): - word = " (" + self.name + ") " + word = ' (' + self.name + ') ' if self.user == '': return word else: - return word + Colors.grey + "(" + self.user + ":" + host + ") " + return word + Colors.grey + '(' + self.user + ':' + host + ') ' @staticmethod def username(): if r.hget('user:'+host, 'name') is not None: - return r.hget('user:'+host, 'name').decode("utf-8") + return r.hget('user:'+host, 'name').decode('utf-8') else: return '' @@ -34,7 +34,7 @@ class Stout(Commands): if cmd[0] == 'info' and count == 1: print(ListCommands.info['info']) elif cmd[0] == 'info' and count == 2: - print(ListCommands.info[cmd[1]]) + print(ListCommands.info[cmd[1]][0]) else: raise KeyError except (KeyError, IndexError): @@ -52,7 +52,7 @@ if __name__ == '__main__': app = Stout() cmd = '' while cmd != 'quit': - cmd = input(">" + Colors.yellow + app.getName() + Colors.black) + cmd = input('>' + Colors.yellow + app.getName() + Colors.black) app.action(cmd) r.save() -- cgit v1.2.3-71-g8e6c