Qwael 4.0.4.7__tar.gz → 4.0.4.8__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 4.0.4.7
3
+ Version: 4.0.4.8
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -1,6 +1,5 @@
1
1
  from supabase import create_client
2
2
  from threading import Thread
3
- import time
4
3
 
5
4
 
6
5
  class ADB:
@@ -11,29 +10,36 @@ class ADB:
11
10
 
12
11
  # ================= THREAD SİSTEM =================
13
12
 
14
- def _async(self, func, callback=None):
13
+ def _async(self, func, callback=None, verify=None):
15
14
  def run():
16
15
  try:
17
16
  sonuc = func()
17
+ if verify is not None:
18
+ verify.clear()
19
+ verify.append(True)
18
20
  if callback:
19
21
  callback(sonuc)
20
22
  except Exception as e:
23
+ if verify is not None:
24
+ verify.clear()
25
+ verify.append(False)
21
26
  print("ADB HATA:", e)
22
27
 
23
28
  Thread(target=run, daemon=True).start()
24
29
 
25
30
  # ================= AUTH =================
26
31
 
27
- def a_kayit_ol(self, email, sifre, callback=None):
32
+ def a_kayit_ol(self, email, sifre, callback=None, verify=None):
28
33
  self._async(
29
34
  lambda: self.db.auth.sign_up({
30
35
  "email": email,
31
36
  "password": sifre
32
37
  }),
33
- callback
38
+ callback,
39
+ verify
34
40
  )
35
41
 
36
- def a_giris_yap(self, email, sifre, callback=None):
42
+ def a_giris_yap(self, email, sifre, callback=None, verify=None):
37
43
 
38
44
  def islem():
39
45
  res = self.db.auth.sign_in_with_password({
@@ -43,42 +49,34 @@ class ADB:
43
49
  self.current_uid = res.user.id
44
50
  return self.current_uid
45
51
 
46
- self._async(islem, callback)
52
+ self._async(islem, callback, verify)
47
53
 
48
- def cikis_yap(self):
49
- try:
54
+ def cikis_yap(self, verify=None):
55
+
56
+ def islem():
50
57
  self.db.auth.sign_out()
51
58
  self.current_uid = None
52
- except:
53
- pass
59
+
60
+ self._async(islem, verify=verify)
54
61
 
55
62
  # ================= VERİ TABANI =================
56
63
 
57
- def add(self, tablo, uid=None, callback=None, **veriler):
64
+ def add(self, tablo, uid=None, callback=None, verify=None, **veriler):
58
65
 
59
66
  def islem():
60
- if uid is None:
61
- uid_kullan = self.current_uid
62
- else:
63
- uid_kullan = uid
64
-
67
+ uid_kullan = uid if uid is not None else self.current_uid
65
68
  if uid_kullan is None:
66
69
  raise Exception("UID yok, önce giriş yap")
67
70
 
68
71
  veriler["user_id"] = uid_kullan
69
-
70
72
  return self.db.table(tablo).insert(veriler).execute()
71
73
 
72
- self._async(islem, callback)
74
+ self._async(islem, callback, verify)
73
75
 
74
- def get(self, tablo, uid=None, callback=None):
76
+ def get(self, tablo, uid=None, callback=None, verify=None):
75
77
 
76
78
  def islem():
77
- if uid is None:
78
- uid_kullan = self.current_uid
79
- else:
80
- uid_kullan = uid
81
-
79
+ uid_kullan = uid if uid is not None else self.current_uid
82
80
  if uid_kullan is None:
83
81
  raise Exception("UID yok")
84
82
 
@@ -87,16 +85,12 @@ class ADB:
87
85
  .eq("user_id", uid_kullan)\
88
86
  .execute().data
89
87
 
90
- self._async(islem, callback)
88
+ self._async(islem, callback, verify)
91
89
 
92
- def update(self, tablo, uid=None, callback=None, **veriler):
90
+ def update(self, tablo, uid=None, callback=None, verify=None, **veriler):
93
91
 
94
92
  def islem():
95
- if uid is None:
96
- uid_kullan = self.current_uid
97
- else:
98
- uid_kullan = uid
99
-
93
+ uid_kullan = uid if uid is not None else self.current_uid
100
94
  if uid_kullan is None:
101
95
  raise Exception("UID yok")
102
96
 
@@ -105,16 +99,12 @@ class ADB:
105
99
  .eq("user_id", uid_kullan)\
106
100
  .execute()
107
101
 
108
- self._async(islem, callback)
102
+ self._async(islem, callback, verify)
109
103
 
110
- def delete(self, tablo, uid=None, callback=None):
104
+ def delete(self, tablo, uid=None, callback=None, verify=None):
111
105
 
112
106
  def islem():
113
- if uid is None:
114
- uid_kullan = self.current_uid
115
- else:
116
- uid_kullan = uid
117
-
107
+ uid_kullan = uid if uid is not None else self.current_uid
118
108
  if uid_kullan is None:
119
109
  raise Exception("UID yok")
120
110
 
@@ -123,7 +113,7 @@ class ADB:
123
113
  .eq("user_id", uid_kullan)\
124
114
  .execute()
125
115
 
126
- self._async(islem, callback)
116
+ self._async(islem, callback, verify)
127
117
 
128
118
 
129
119
  # ================= KULLANIMI DAHA BASİT OLSUN DİYE =================
@@ -136,25 +126,29 @@ def baslat(url, key):
136
126
  _db = ADB(url, key)
137
127
 
138
128
 
139
- def a_kayit_ol(email, sifre, callback=None):
140
- _db.a_kayit_ol(email, sifre, callback)
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)
141
135
 
142
136
 
143
- def a_giris_yap(email, sifre, callback=None):
144
- _db.a_giris_yap(email, sifre, callback)
137
+ def cikis_yap(verify=None):
138
+ _db.cikis_yap(verify)
145
139
 
146
140
 
147
- def add(tablo, uid=None, callback=None, **veriler):
148
- _db.add(tablo, uid, callback, **veriler)
141
+ def add(tablo, uid=None, callback=None, verify=None, **veriler):
142
+ _db.add(tablo, uid, callback, verify, **veriler)
149
143
 
150
144
 
151
- def get(tablo, uid=None, callback=None):
152
- _db.get(tablo, uid, callback)
145
+ def get(tablo, uid=None, callback=None, verify=None):
146
+ _db.get(tablo, uid, callback, verify)
153
147
 
154
148
 
155
- def update(tablo, uid=None, callback=None, **veriler):
156
- _db.update(tablo, uid, callback, **veriler)
149
+ def update(tablo, uid=None, callback=None, verify=None, **veriler):
150
+ _db.update(tablo, uid, callback, verify, **veriler)
157
151
 
158
152
 
159
- def delete(tablo, uid=None, callback=None):
160
- _db.delete(tablo, uid, callback)
153
+ def delete(tablo, uid=None, callback=None, verify=None):
154
+ _db.delete(tablo, uid, callback, verify)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 4.0.4.7
3
+ Version: 4.0.4.8
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="Qwael",
8
- version="4.0.4.7",
8
+ version="4.0.4.8",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
11
  "google-api-python-client",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes