summaryrefslogtreecommitdiff
path: root/classes.py
diff options
context:
space:
mode:
Diffstat (limited to 'classes.py')
-rw-r--r--classes.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/classes.py b/classes.py
new file mode 100644
index 0000000..dc4f38a
--- /dev/null
+++ b/classes.py
@@ -0,0 +1,37 @@
+import redis, socket, os
+
+r = redis.Redis()
+s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+s.connect(("8.8.8.8", 80))
+host = s.getsockname()[0]
+
+def clear():
+ try:
+ os.system('clear')
+ except:
+ os.system('cls')
+
+def userexist(name):
+ lista = r.zrange('usersname', 0, -1)
+ for i in lista:
+ if name == i.decode("utf-8"):
+ return True
+ else:
+ return False
+
+class PersonalError(Exception):
+
+ def __init__(self, value):
+ self.value = value
+
+ def __str__(self):
+ return repr(self.value)
+
+
+class Colors(object):
+
+ red = '\033[91m'
+ yellow = '\033[93m'
+ grey = '\033[90m'
+ black = '\033[0m'
+ bold = '\033[1m'