summaryrefslogtreecommitdiff
path: root/classes.py
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-07-20 13:24:34 +0200
committerSanto Cariotti <sancn@live.com>2017-07-20 13:24:34 +0200
commit6d1aff6894408c89d7a549076293fe011e475eb0 (patch)
treee19e40b5d667b8281331a982be6a0c067cd5e8fe /classes.py
parentc95062f5ac0b16dcb0a1c5f1c3fc5762112ff371 (diff)
added get comand
Diffstat (limited to 'classes.py')
-rw-r--r--classes.py7
1 files changed, 4 insertions, 3 deletions
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