Qwael 3.9.7__tar.gz → 3.9.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.
- {qwael-3.9.7 → qwael-3.9.8}/PKG-INFO +1 -1
- {qwael-3.9.7 → qwael-3.9.8}/Qwael/MultiDB.py +63 -4
- {qwael-3.9.7 → qwael-3.9.8}/Qwael.egg-info/PKG-INFO +1 -1
- {qwael-3.9.7 → qwael-3.9.8}/setup.py +1 -1
- {qwael-3.9.7 → qwael-3.9.8}/LICENSE +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael/DR/304/260VE.py" +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael/DoIP.py +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael/__init__.py +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael/filesz.py +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael.egg-info/SOURCES.txt +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael.egg-info/dependency_links.txt +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael.egg-info/requires.txt +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/Qwael.egg-info/top_level.txt +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/README.md +0 -0
- {qwael-3.9.7 → qwael-3.9.8}/setup.cfg +0 -0
|
@@ -241,15 +241,23 @@ class MultiDB:
|
|
|
241
241
|
return result
|
|
242
242
|
|
|
243
243
|
# -----------------------------
|
|
244
|
-
# CLEAR DATA
|
|
244
|
+
# CLEAR DATA (onay-listesi uyumlu)
|
|
245
245
|
# -----------------------------
|
|
246
|
-
def clear_full(self, table):
|
|
246
|
+
def clear_full(self, table, onay=None):
|
|
247
|
+
"""
|
|
248
|
+
table: temizlenecek tablo adı
|
|
249
|
+
onay: eğer bir liste verilirse, işlem başarılıysa onay.append(True),
|
|
250
|
+
başarısızsa onay.append(False) yapılır.
|
|
251
|
+
Fonksiyon ayrıca True/False döndürür (diğer fonksiyonlarla uyumlu).
|
|
252
|
+
"""
|
|
247
253
|
self._lock()
|
|
248
254
|
try:
|
|
249
255
|
lines = self._read()
|
|
250
256
|
tpos = self._find_table(lines, table)
|
|
251
257
|
if tpos == -1:
|
|
252
|
-
|
|
258
|
+
if isinstance(onay, list):
|
|
259
|
+
onay.append(False)
|
|
260
|
+
return False
|
|
253
261
|
|
|
254
262
|
new_lines = []
|
|
255
263
|
i = 0
|
|
@@ -259,16 +267,28 @@ class MultiDB:
|
|
|
259
267
|
i += 1
|
|
260
268
|
continue
|
|
261
269
|
|
|
270
|
+
# tablo başlığını koru
|
|
262
271
|
new_lines.append(lines[i])
|
|
263
272
|
new_lines.append(lines[i + 1])
|
|
264
273
|
new_lines.append(lines[i + 2])
|
|
265
274
|
|
|
275
|
+
# tablonun altındaki kayıtları atla
|
|
266
276
|
j = i + 3
|
|
267
277
|
while j < len(lines) and not lines[j].startswith("[TABLE"):
|
|
268
278
|
j += 1
|
|
269
279
|
i = j
|
|
270
280
|
|
|
271
281
|
self._write(new_lines)
|
|
282
|
+
|
|
283
|
+
if isinstance(onay, list):
|
|
284
|
+
onay.append(True)
|
|
285
|
+
return True
|
|
286
|
+
|
|
287
|
+
except Exception:
|
|
288
|
+
if isinstance(onay, list):
|
|
289
|
+
onay.append(False)
|
|
290
|
+
raise
|
|
291
|
+
|
|
272
292
|
finally:
|
|
273
293
|
self._unlock()
|
|
274
294
|
|
|
@@ -487,4 +507,43 @@ class MultiDB:
|
|
|
487
507
|
raise
|
|
488
508
|
|
|
489
509
|
finally:
|
|
490
|
-
self._unlock()
|
|
510
|
+
self._unlock()
|
|
511
|
+
|
|
512
|
+
# -----------------------------
|
|
513
|
+
# ROMEVE - Tek tablo veya tüm tabloların verilerini temizle
|
|
514
|
+
# -----------------------------
|
|
515
|
+
def romeve(self, table_or_full, onay=None):
|
|
516
|
+
"""
|
|
517
|
+
Kullanım:
|
|
518
|
+
x.romeve("kullanıcı", onay) -> sadece belirtilen tabloyu temizler (onay listesi varsa append eder)
|
|
519
|
+
x.romeve(full_var, onay) -> eğer table_or_full str değilse tüm tablolar temizlenir
|
|
520
|
+
(not: burada 'full' özel bir isim değil; str değilse 'tüm' olarak kabul edilir)
|
|
521
|
+
"""
|
|
522
|
+
# TEK TABLO ise
|
|
523
|
+
if isinstance(table_or_full, str):
|
|
524
|
+
return self.clear_full(table_or_full, onay)
|
|
525
|
+
|
|
526
|
+
# TÜM TABLOLAR ise
|
|
527
|
+
try:
|
|
528
|
+
lines = self._read()
|
|
529
|
+
tables = []
|
|
530
|
+
for line in lines:
|
|
531
|
+
if line.startswith("[TABLE "):
|
|
532
|
+
name = line.replace("[TABLE ", "").replace("]", "")
|
|
533
|
+
tables.append(name)
|
|
534
|
+
|
|
535
|
+
success = True
|
|
536
|
+
for t in tables:
|
|
537
|
+
res = self.clear_full(t, onay=None) # tek tek temizle, fakat onay append'ini biz sonradan yapacağız
|
|
538
|
+
if not res:
|
|
539
|
+
success = False
|
|
540
|
+
|
|
541
|
+
if isinstance(onay, list):
|
|
542
|
+
onay.append(success)
|
|
543
|
+
|
|
544
|
+
return success
|
|
545
|
+
|
|
546
|
+
except Exception:
|
|
547
|
+
if isinstance(onay, list):
|
|
548
|
+
onay.append(False)
|
|
549
|
+
raise
|
|
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
|