Qwael 4.0.4.6__py3-none-any.whl → 4.0.4.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Qwael/adbfull.py +133 -67
- {qwael-4.0.4.6.dist-info → qwael-4.0.4.8.dist-info}/METADATA +1 -1
- {qwael-4.0.4.6.dist-info → qwael-4.0.4.8.dist-info}/RECORD +6 -6
- {qwael-4.0.4.6.dist-info → qwael-4.0.4.8.dist-info}/WHEEL +0 -0
- {qwael-4.0.4.6.dist-info → qwael-4.0.4.8.dist-info}/licenses/LICENSE +0 -0
- {qwael-4.0.4.6.dist-info → qwael-4.0.4.8.dist-info}/top_level.txt +0 -0
Qwael/adbfull.py
CHANGED
|
@@ -1,88 +1,154 @@
|
|
|
1
1
|
from supabase import create_client
|
|
2
|
-
import
|
|
2
|
+
from threading import Thread
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class ADB:
|
|
6
|
+
|
|
6
7
|
def __init__(self, url, key):
|
|
7
|
-
self.url = url
|
|
8
|
-
self.key = key
|
|
9
8
|
self.db = create_client(url, key)
|
|
10
|
-
self.
|
|
9
|
+
self.current_uid = None
|
|
10
|
+
|
|
11
|
+
# ================= THREAD SİSTEM =================
|
|
12
|
+
|
|
13
|
+
def _async(self, func, callback=None, verify=None):
|
|
14
|
+
def run():
|
|
15
|
+
try:
|
|
16
|
+
sonuc = func()
|
|
17
|
+
if verify is not None:
|
|
18
|
+
verify.clear()
|
|
19
|
+
verify.append(True)
|
|
20
|
+
if callback:
|
|
21
|
+
callback(sonuc)
|
|
22
|
+
except Exception as e:
|
|
23
|
+
if verify is not None:
|
|
24
|
+
verify.clear()
|
|
25
|
+
verify.append(False)
|
|
26
|
+
print("ADB HATA:", e)
|
|
27
|
+
|
|
28
|
+
Thread(target=run, daemon=True).start()
|
|
11
29
|
|
|
12
30
|
# ================= AUTH =================
|
|
13
31
|
|
|
14
|
-
def a_kayit_ol(self, email, sifre):
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
def a_kayit_ol(self, email, sifre, callback=None, verify=None):
|
|
33
|
+
self._async(
|
|
34
|
+
lambda: self.db.auth.sign_up({
|
|
17
35
|
"email": email,
|
|
18
36
|
"password": sifre
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
}),
|
|
38
|
+
callback,
|
|
39
|
+
verify
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def a_giris_yap(self, email, sifre, callback=None, verify=None):
|
|
23
43
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
sonuc = self.db.auth.sign_in_with_password({
|
|
44
|
+
def islem():
|
|
45
|
+
res = self.db.auth.sign_in_with_password({
|
|
27
46
|
"email": email,
|
|
28
47
|
"password": sifre
|
|
29
48
|
})
|
|
49
|
+
self.current_uid = res.user.id
|
|
50
|
+
return self.current_uid
|
|
51
|
+
|
|
52
|
+
self._async(islem, callback, verify)
|
|
53
|
+
|
|
54
|
+
def cikis_yap(self, verify=None):
|
|
55
|
+
|
|
56
|
+
def islem():
|
|
57
|
+
self.db.auth.sign_out()
|
|
58
|
+
self.current_uid = None
|
|
59
|
+
|
|
60
|
+
self._async(islem, verify=verify)
|
|
61
|
+
|
|
62
|
+
# ================= VERİ TABANI =================
|
|
30
63
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def _kontrol_et(self):
|
|
40
|
-
try:
|
|
41
|
-
if self.oturum:
|
|
42
|
-
self.db.auth.set_session(
|
|
43
|
-
self.oturum.access_token,
|
|
44
|
-
self.oturum.refresh_token
|
|
45
|
-
)
|
|
46
|
-
except:
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
# ================= TABLO =================
|
|
50
|
-
|
|
51
|
-
def add(self, tablo, uid, **veriler):
|
|
52
|
-
"""
|
|
53
|
-
Örnek:
|
|
54
|
-
add("users_data", uid, username="Ali Kaya", skor=34)
|
|
55
|
-
"""
|
|
56
|
-
self._kontrol_et()
|
|
57
|
-
|
|
58
|
-
try:
|
|
59
|
-
veriler["user_id"] = uid
|
|
64
|
+
def add(self, tablo, uid=None, callback=None, verify=None, **veriler):
|
|
65
|
+
|
|
66
|
+
def islem():
|
|
67
|
+
uid_kullan = uid if uid is not None else self.current_uid
|
|
68
|
+
if uid_kullan is None:
|
|
69
|
+
raise Exception("UID yok, önce giriş yap")
|
|
70
|
+
|
|
71
|
+
veriler["user_id"] = uid_kullan
|
|
60
72
|
return self.db.table(tablo).insert(veriler).execute()
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
+
|
|
74
|
+
self._async(islem, callback, verify)
|
|
75
|
+
|
|
76
|
+
def get(self, tablo, uid=None, callback=None, verify=None):
|
|
77
|
+
|
|
78
|
+
def islem():
|
|
79
|
+
uid_kullan = uid if uid is not None else self.current_uid
|
|
80
|
+
if uid_kullan is None:
|
|
81
|
+
raise Exception("UID yok")
|
|
82
|
+
|
|
83
|
+
return self.db.table(tablo)\
|
|
84
|
+
.select("*")\
|
|
85
|
+
.eq("user_id", uid_kullan)\
|
|
73
86
|
.execute().data
|
|
74
|
-
except Exception as e:
|
|
75
|
-
print("Veri alma hatası:", e)
|
|
76
|
-
return None
|
|
77
87
|
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
self._async(islem, callback, verify)
|
|
89
|
+
|
|
90
|
+
def update(self, tablo, uid=None, callback=None, verify=None, **veriler):
|
|
91
|
+
|
|
92
|
+
def islem():
|
|
93
|
+
uid_kullan = uid if uid is not None else self.current_uid
|
|
94
|
+
if uid_kullan is None:
|
|
95
|
+
raise Exception("UID yok")
|
|
96
|
+
|
|
97
|
+
return self.db.table(tablo)\
|
|
98
|
+
.update(veriler)\
|
|
99
|
+
.eq("user_id", uid_kullan)\
|
|
100
|
+
.execute()
|
|
101
|
+
|
|
102
|
+
self._async(islem, callback, verify)
|
|
80
103
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
def delete(self, tablo, uid=None, callback=None, verify=None):
|
|
105
|
+
|
|
106
|
+
def islem():
|
|
107
|
+
uid_kullan = uid if uid is not None else self.current_uid
|
|
108
|
+
if uid_kullan is None:
|
|
109
|
+
raise Exception("UID yok")
|
|
110
|
+
|
|
111
|
+
return self.db.table(tablo)\
|
|
112
|
+
.delete()\
|
|
113
|
+
.eq("user_id", uid_kullan)\
|
|
85
114
|
.execute()
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
115
|
+
|
|
116
|
+
self._async(islem, callback, verify)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# ================= KULLANIMI DAHA BASİT OLSUN DİYE =================
|
|
120
|
+
|
|
121
|
+
_db = None
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def baslat(url, key):
|
|
125
|
+
global _db
|
|
126
|
+
_db = ADB(url, key)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def a_kayit_ol(email, sifre, callback=None, verify=None):
|
|
130
|
+
_db.a_kayit_ol(email, sifre, callback, verify)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def a_giris_yap(email, sifre, callback=None, verify=None):
|
|
134
|
+
_db.a_giris_yap(email, sifre, callback, verify)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def cikis_yap(verify=None):
|
|
138
|
+
_db.cikis_yap(verify)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def add(tablo, uid=None, callback=None, verify=None, **veriler):
|
|
142
|
+
_db.add(tablo, uid, callback, verify, **veriler)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def get(tablo, uid=None, callback=None, verify=None):
|
|
146
|
+
_db.get(tablo, uid, callback, verify)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def update(tablo, uid=None, callback=None, verify=None, **veriler):
|
|
150
|
+
_db.update(tablo, uid, callback, verify, **veriler)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def delete(tablo, uid=None, callback=None, verify=None):
|
|
154
|
+
_db.delete(tablo, uid, callback, verify)
|
|
@@ -4,11 +4,11 @@ Qwael/EasyWeb.py,sha256=78XBEIuHjUm0j-TOPsN0sy0iXl8UywKAi0dNn-evWSY,1283
|
|
|
4
4
|
Qwael/MultiDB.py,sha256=glptDsH22TyklZrA_ywStnsT6bGnq7JsSR5NN_U1NII,17286
|
|
5
5
|
Qwael/Multidata.py,sha256=YBofvzcuT-F8RIljw3Z1tr3Qn7VbhXjfrY6BuGNPYw0,9496
|
|
6
6
|
Qwael/__init__.py,sha256=80N86isqJ_EhDy0-wlUe6BFO1CpJvb61wYgt14b4bEM,230
|
|
7
|
-
Qwael/adbfull.py,sha256=
|
|
7
|
+
Qwael/adbfull.py,sha256=Hd_lp9ENBOq6C8CwTsfjEok9ZktTMaaCKoKPIpATPrg,4275
|
|
8
8
|
Qwael/filesz.py,sha256=6XZ1GKzXcVs7uKAirImbBuZYGrRL_-WOtiOOYOdp_nU,2501
|
|
9
9
|
Qwael/pgif.py,sha256=stiVsn1DAJyHNsAHUWaWXdGiouQ2ZeRehn_WC30SK1A,1242
|
|
10
|
-
qwael-4.0.4.
|
|
11
|
-
qwael-4.0.4.
|
|
12
|
-
qwael-4.0.4.
|
|
13
|
-
qwael-4.0.4.
|
|
14
|
-
qwael-4.0.4.
|
|
10
|
+
qwael-4.0.4.8.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
qwael-4.0.4.8.dist-info/METADATA,sha256=V_2y6TZ1xK48t-sDul1YqNl8T9L3C9HqEGlyWb8gLPc,2399
|
|
12
|
+
qwael-4.0.4.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
13
|
+
qwael-4.0.4.8.dist-info/top_level.txt,sha256=UtaXY8Mui4lwYNkGrplHcEVe8PjH553OT1Xu5V9bhg0,6
|
|
14
|
+
qwael-4.0.4.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|