diff options
author | Santo Cariotti <sancn@live.com> | 2017-07-20 13:24:34 +0200 |
---|---|---|
committer | Santo Cariotti <sancn@live.com> | 2017-07-20 13:24:34 +0200 |
commit | 6d1aff6894408c89d7a549076293fe011e475eb0 (patch) | |
tree | e19e40b5d667b8281331a982be6a0c067cd5e8fe /classes.py | |
parent | c95062f5ac0b16dcb0a1c5f1c3fc5762112ff371 (diff) |
added get comand
Diffstat (limited to 'classes.py')
-rw-r--r-- | classes.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |