-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaux.py
executable file
·71 lines (46 loc) · 1005 Bytes
/
aux.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## SERGIO DEL CASTILLO t.me/sercliff
import auth
import pyrebase
import json
from enum import Enum
from random import randint
import hashlib
class DEBUG(Enum):
ALL = 1
ERROR = 2
WARNING = 3
PRINT = 4
NONE = 5
log = 1
def iprint(DEBUG, text):
global log
if DEBUG == DEBUG.ERROR:
print ("[ERROR]"+decode(text))
elif DEBUG == DEBUG.WARNING:
print (decode(text))
elif DEBUG == DEBUG.ALL:
print (decode(text))
elif DEBUG == DEBUG.PRINT:
if log == 0:
print (decode(text))
def decode(text):
try:
text = unidecode(unicode(text, errors='replace'))
except Exception as e:
try:
text = unidecode(text)
except Exception as e:
try:
text = str(text.toAscii)
except Exception as e:
text = str(text)
text = text.replace("\'", "\"")
return text
def set_log(value):
global log
log = value
def d2j(data):
""" Convert dictionary and lists data to JSON """
return json.loads(json.dumps(data))