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 --- classes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'classes.py') diff --git a/classes.py b/classes.py index dc4f38a..7f872af 100644 --- a/classes.py +++ b/classes.py @@ -1,8 +1,9 @@ import redis, socket, os +from config import config as co -r = redis.Redis() +r = redis.Redis(host=co['host'], port=co['port'], unix_socket_path=co['unix_socket_path'], db=co['db']) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -s.connect(("8.8.8.8", 80)) +s.connect(('8.8.8.8', 80)) host = s.getsockname()[0] def clear(): @@ -14,7 +15,7 @@ def clear(): def userexist(name): lista = r.zrange('usersname', 0, -1) for i in lista: - if name == i.decode("utf-8"): + if name == i.decode('utf-8'): return True else: return False -- cgit v1.2.3-18-g5258