Qwael 4.0.0.1.4__py3-none-any.whl → 4.0.0.1.6__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/__init__.py +1 -3
- Qwael/filesz.py +40 -61
- Qwael/pgif.py +51 -0
- {qwael-4.0.0.1.4.dist-info → qwael-4.0.0.1.6.dist-info}/METADATA +1 -1
- qwael-4.0.0.1.6.dist-info/RECORD +12 -0
- qwael-4.0.0.1.4.dist-info/RECORD +0 -11
- {qwael-4.0.0.1.4.dist-info → qwael-4.0.0.1.6.dist-info}/WHEEL +0 -0
- {qwael-4.0.0.1.4.dist-info → qwael-4.0.0.1.6.dist-info}/licenses/LICENSE +0 -0
- {qwael-4.0.0.1.4.dist-info → qwael-4.0.0.1.6.dist-info}/top_level.txt +0 -0
Qwael/__init__.py
CHANGED
Qwael/filesz.py
CHANGED
|
@@ -1,27 +1,46 @@
|
|
|
1
|
-
import os
|
|
1
|
+
import os
|
|
2
|
+
import json
|
|
3
|
+
import base64
|
|
4
|
+
import hashlib
|
|
5
|
+
from kivy.app import App
|
|
6
|
+
from cryptography.fernet import Fernet
|
|
7
|
+
|
|
2
8
|
|
|
3
9
|
class EasyDB:
|
|
4
|
-
def __init__(self, name):
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
def __init__(self, name, password):
|
|
11
|
+
app = App.get_running_app()
|
|
12
|
+
base_dir = os.path.join(app.user_data_dir, "easydb_data")
|
|
13
|
+
os.makedirs(base_dir, exist_ok=True)
|
|
14
|
+
|
|
15
|
+
self.path = os.path.join(base_dir, f"{name}.db")
|
|
16
|
+
self.key = self._make_key(password)
|
|
17
|
+
self.cipher = Fernet(self.key)
|
|
18
|
+
|
|
7
19
|
if not os.path.exists(self.path):
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
self.data = {}
|
|
21
|
+
self._save()
|
|
22
|
+
else:
|
|
23
|
+
self._safe_load()
|
|
24
|
+
|
|
25
|
+
def _make_key(self, password):
|
|
26
|
+
digest = hashlib.sha256(password.encode()).digest()
|
|
27
|
+
return base64.urlsafe_b64encode(digest)
|
|
11
28
|
|
|
12
29
|
def _safe_load(self):
|
|
13
30
|
try:
|
|
14
|
-
with open(self.path, "
|
|
15
|
-
|
|
16
|
-
|
|
31
|
+
with open(self.path, "rb") as f:
|
|
32
|
+
encrypted = f.read()
|
|
33
|
+
decrypted = self.cipher.decrypt(encrypted)
|
|
34
|
+
self.data = json.loads(decrypted.decode())
|
|
17
35
|
except Exception:
|
|
18
|
-
print(f"[Uyarı] {self.path} bozuktu, sıfırdan oluşturuldu.")
|
|
19
36
|
self.data = {}
|
|
20
37
|
self._save()
|
|
21
38
|
|
|
22
39
|
def _save(self):
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
raw = json.dumps(self.data, ensure_ascii=False).encode()
|
|
41
|
+
encrypted = self.cipher.encrypt(raw)
|
|
42
|
+
with open(self.path, "wb") as f:
|
|
43
|
+
f.write(encrypted)
|
|
25
44
|
|
|
26
45
|
def create(self, table):
|
|
27
46
|
if table not in self.data:
|
|
@@ -29,34 +48,10 @@ class EasyDB:
|
|
|
29
48
|
self._save()
|
|
30
49
|
return self
|
|
31
50
|
|
|
32
|
-
def _value_conflict(self, table, value):
|
|
33
|
-
is_special = isinstance(value, str) and value.startswith("'") and value.endswith("'")
|
|
34
|
-
val_clean = value.strip("'") if is_special else value
|
|
35
|
-
|
|
36
|
-
for item in self.data.get(table, []):
|
|
37
|
-
for v in item.values():
|
|
38
|
-
if not isinstance(v, str):
|
|
39
|
-
continue
|
|
40
|
-
v_special = v.startswith("'") and v.endswith("'")
|
|
41
|
-
v_clean = v.strip("'") if v_special else v
|
|
42
|
-
|
|
43
|
-
# Aynı özel tekrar edemez
|
|
44
|
-
if is_special and v_special and v_clean == val_clean:
|
|
45
|
-
return True
|
|
46
|
-
# Normal ↔ özel çakışması
|
|
47
|
-
if (is_special and not v_special or not is_special and v_special) and v_clean == val_clean:
|
|
48
|
-
return True
|
|
49
|
-
return False
|
|
50
|
-
|
|
51
51
|
def add(self, table, record: dict):
|
|
52
52
|
if table not in self.data:
|
|
53
53
|
self.create(table)
|
|
54
54
|
|
|
55
|
-
for key, value in record.items():
|
|
56
|
-
if isinstance(value, str) and self._value_conflict(table, value):
|
|
57
|
-
print(f"[Uyarı] {value} çakışma nedeniyle eklenmedi.")
|
|
58
|
-
return None
|
|
59
|
-
|
|
60
55
|
record["id"] = len(self.data[table]) + 1
|
|
61
56
|
self.data[table].append(record)
|
|
62
57
|
self._save()
|
|
@@ -66,45 +61,29 @@ class EasyDB:
|
|
|
66
61
|
return self.data.get(table, [])
|
|
67
62
|
|
|
68
63
|
def find(self, table, **filters):
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if all(item.get(k) == v for k, v in filters.items())
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# 🔹 Yeni: ID bazlı silme
|
|
76
|
-
def delete(self, table, record_id, field=None):
|
|
64
|
+
return [
|
|
65
|
+
item for item in self.data.get(table, [])
|
|
66
|
+
if all(item.get(k) == v for k, v in filters.items())
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
def delete(self, table, record_id):
|
|
77
70
|
if table not in self.data:
|
|
78
|
-
print(f"[Hata] '{table}' tablosu yok.")
|
|
79
71
|
return 0
|
|
80
72
|
|
|
81
73
|
for item in self.data[table]:
|
|
82
74
|
if item.get("id") == record_id:
|
|
83
|
-
|
|
84
|
-
self.data[table].remove(item)
|
|
85
|
-
print(f"[Silindi] ID {record_id} tamamen silindi.")
|
|
86
|
-
else:
|
|
87
|
-
if field in item:
|
|
88
|
-
print(f"[Silindi] ID {record_id} kaydındaki '{field}' alanı silindi.")
|
|
89
|
-
del item[field]
|
|
75
|
+
self.data[table].remove(item)
|
|
90
76
|
self._save()
|
|
91
77
|
return 1
|
|
92
|
-
|
|
93
|
-
print(f"[Uyarı] ID {record_id} bulunamadı.")
|
|
94
78
|
return 0
|
|
95
79
|
|
|
96
|
-
# 🔹 Yeni: ID bazlı güncelleme
|
|
97
80
|
def update(self, table, record_id, **updates):
|
|
98
81
|
if table not in self.data:
|
|
99
|
-
print(f"[Hata] '{table}' tablosu yok.")
|
|
100
82
|
return 0
|
|
101
83
|
|
|
102
84
|
for item in self.data[table]:
|
|
103
85
|
if item.get("id") == record_id:
|
|
104
86
|
item.update(updates)
|
|
105
87
|
self._save()
|
|
106
|
-
print(f"[Güncellendi] ID {record_id} başarıyla güncellendi.")
|
|
107
88
|
return 1
|
|
108
|
-
|
|
109
|
-
print(f"[Uyarı] ID {record_id} bulunamadı.")
|
|
110
|
-
return 0
|
|
89
|
+
return 0
|
Qwael/pgif.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from kivy.uix.image import Image
|
|
2
|
+
from kivy.clock import Clock
|
|
3
|
+
from kivy.properties import ListProperty, NumericProperty
|
|
4
|
+
|
|
5
|
+
class gif(Image):
|
|
6
|
+
source_list = ListProperty([])
|
|
7
|
+
time = NumericProperty(0.1)
|
|
8
|
+
umit = NumericProperty(0)
|
|
9
|
+
|
|
10
|
+
def __init__(self, **kwargs):
|
|
11
|
+
super().__init__(**kwargs)
|
|
12
|
+
self.index = 0
|
|
13
|
+
self.turn = 0
|
|
14
|
+
self._event = None
|
|
15
|
+
|
|
16
|
+
Clock.schedule_once(self._start)
|
|
17
|
+
|
|
18
|
+
def _start(self, dt):
|
|
19
|
+
if not self.source_list:
|
|
20
|
+
return
|
|
21
|
+
|
|
22
|
+
self.source = self.source_list[0]
|
|
23
|
+
self._event = Clock.schedule_interval(
|
|
24
|
+
self._update,
|
|
25
|
+
self.time
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def _update(self, dt):
|
|
29
|
+
self.index += 1
|
|
30
|
+
|
|
31
|
+
if self.index >= len(self.source_list):
|
|
32
|
+
self.index = 0
|
|
33
|
+
self.turn += 1
|
|
34
|
+
|
|
35
|
+
if self.umit != 0 and self.turn >= self.umit:
|
|
36
|
+
self.stop()
|
|
37
|
+
return
|
|
38
|
+
|
|
39
|
+
self.source = self.source_list[self.index]
|
|
40
|
+
|
|
41
|
+
def stop(self):
|
|
42
|
+
if self._event:
|
|
43
|
+
self._event.cancel()
|
|
44
|
+
self._event = None
|
|
45
|
+
|
|
46
|
+
def play(self):
|
|
47
|
+
if not self._event:
|
|
48
|
+
self._event = Clock.schedule_interval(
|
|
49
|
+
self._update,
|
|
50
|
+
self.time
|
|
51
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Qwael/DRİVE.py,sha256=OTiyoXFb5iFP7hXr2QHnH3c0pHZijZr1sFsqguXtMfc,12976
|
|
2
|
+
Qwael/DoIP.py,sha256=5ujPzbZGepFZN0-tMI9Unodvo2gJG3PDL2ShqdBJjdE,418
|
|
3
|
+
Qwael/MultiDB.py,sha256=glptDsH22TyklZrA_ywStnsT6bGnq7JsSR5NN_U1NII,17286
|
|
4
|
+
Qwael/Multidata.py,sha256=YBofvzcuT-F8RIljw3Z1tr3Qn7VbhXjfrY6BuGNPYw0,9496
|
|
5
|
+
Qwael/__init__.py,sha256=MxqhT-06ihjEAVz2pPU5trmS-NVj7-gdX2Cnu3BUXgY,176
|
|
6
|
+
Qwael/filesz.py,sha256=6XZ1GKzXcVs7uKAirImbBuZYGrRL_-WOtiOOYOdp_nU,2501
|
|
7
|
+
Qwael/pgif.py,sha256=stiVsn1DAJyHNsAHUWaWXdGiouQ2ZeRehn_WC30SK1A,1242
|
|
8
|
+
qwael-4.0.0.1.6.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
qwael-4.0.0.1.6.dist-info/METADATA,sha256=g1bmvzT9aKWSlWH2AF-F8IGAXvNcxdE-06CIVgnbdUU,2280
|
|
10
|
+
qwael-4.0.0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
qwael-4.0.0.1.6.dist-info/top_level.txt,sha256=UtaXY8Mui4lwYNkGrplHcEVe8PjH553OT1Xu5V9bhg0,6
|
|
12
|
+
qwael-4.0.0.1.6.dist-info/RECORD,,
|
qwael-4.0.0.1.4.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Qwael/DRİVE.py,sha256=OTiyoXFb5iFP7hXr2QHnH3c0pHZijZr1sFsqguXtMfc,12976
|
|
2
|
-
Qwael/DoIP.py,sha256=5ujPzbZGepFZN0-tMI9Unodvo2gJG3PDL2ShqdBJjdE,418
|
|
3
|
-
Qwael/MultiDB.py,sha256=glptDsH22TyklZrA_ywStnsT6bGnq7JsSR5NN_U1NII,17286
|
|
4
|
-
Qwael/Multidata.py,sha256=YBofvzcuT-F8RIljw3Z1tr3Qn7VbhXjfrY6BuGNPYw0,9496
|
|
5
|
-
Qwael/__init__.py,sha256=8-RUlmpcvWxxqHWc4_sSpHdxAetSy7Oe6YNDfOGpvRw,234
|
|
6
|
-
Qwael/filesz.py,sha256=M93tuP-BQxmySgjtYR5uQ3Otx2AfqbfAuKD6pyZDBC4,3859
|
|
7
|
-
qwael-4.0.0.1.4.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
qwael-4.0.0.1.4.dist-info/METADATA,sha256=brd-b6VdLDycHC4vIQ2-mmgNzTPCEGYNuuCIUzvOba4,2280
|
|
9
|
-
qwael-4.0.0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
qwael-4.0.0.1.4.dist-info/top_level.txt,sha256=UtaXY8Mui4lwYNkGrplHcEVe8PjH553OT1Xu5V9bhg0,6
|
|
11
|
-
qwael-4.0.0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|