Qwael 3.9.1__tar.gz → 3.9.2__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.1 → qwael-3.9.2}/PKG-INFO +1 -1
- {qwael-3.9.1 → qwael-3.9.2}/Qwael/MultiDB.py +17 -20
- {qwael-3.9.1 → qwael-3.9.2}/Qwael.egg-info/PKG-INFO +1 -1
- {qwael-3.9.1 → qwael-3.9.2}/setup.py +1 -1
- {qwael-3.9.1 → qwael-3.9.2}/LICENSE +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael/DR/304/260VE.py" +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael/DoIP.py +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael/__init__.py +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael/filesz.py +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael.egg-info/SOURCES.txt +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael.egg-info/dependency_links.txt +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael.egg-info/requires.txt +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/Qwael.egg-info/top_level.txt +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/README.md +0 -0
- {qwael-3.9.1 → qwael-3.9.2}/setup.cfg +0 -0
|
@@ -42,13 +42,19 @@ class MultiDB:
|
|
|
42
42
|
return -1
|
|
43
43
|
|
|
44
44
|
# -----------------------------
|
|
45
|
-
# RULE SPLITTER
|
|
45
|
+
# RULE SPLITTER (25 LIMIT)
|
|
46
46
|
# -----------------------------
|
|
47
47
|
def _split_rules(self, rule):
|
|
48
48
|
if not rule:
|
|
49
49
|
return []
|
|
50
|
+
|
|
50
51
|
rule = rule.replace(" ", "").replace("+", ",").replace("#-", ",#-")
|
|
51
|
-
|
|
52
|
+
rules = [r for r in rule.split(",") if r]
|
|
53
|
+
|
|
54
|
+
if len(rules) > 25:
|
|
55
|
+
raise ValueError("Bir sütun için maksimum 25 kural eklenebilir!")
|
|
56
|
+
|
|
57
|
+
return rules
|
|
52
58
|
|
|
53
59
|
# -----------------------------
|
|
54
60
|
# CREATE TABLE
|
|
@@ -104,7 +110,8 @@ class MultiDB:
|
|
|
104
110
|
return False
|
|
105
111
|
|
|
106
112
|
if r == "small":
|
|
107
|
-
|
|
113
|
+
# small kuralı artık tüm value için geçerli (domain dahil)
|
|
114
|
+
if not all(ch.islower() or ch.isdigit() or ch in "@." for ch in value):
|
|
108
115
|
return False
|
|
109
116
|
|
|
110
117
|
if r == "#-":
|
|
@@ -158,7 +165,7 @@ class MultiDB:
|
|
|
158
165
|
if not self._validate(final_values[i], rule, lines, tpos, i):
|
|
159
166
|
raise ValueError(f"{col} alanı için veri kurala uymuyor: {rule}")
|
|
160
167
|
|
|
161
|
-
# Insert
|
|
168
|
+
# Insert
|
|
162
169
|
lines.insert(tpos + 3, json.dumps(final_values, ensure_ascii=False))
|
|
163
170
|
self._write(lines)
|
|
164
171
|
self._unlock()
|
|
@@ -194,12 +201,11 @@ class MultiDB:
|
|
|
194
201
|
return result
|
|
195
202
|
|
|
196
203
|
# -----------------------------
|
|
197
|
-
# CLEAR
|
|
204
|
+
# CLEAR DATA (Keep structure)
|
|
198
205
|
# -----------------------------
|
|
199
206
|
def clear_full(self, table):
|
|
200
207
|
self._lock()
|
|
201
208
|
lines = self._read()
|
|
202
|
-
|
|
203
209
|
tpos = self._find_table(lines, table)
|
|
204
210
|
if tpos == -1:
|
|
205
211
|
self._unlock()
|
|
@@ -213,14 +219,13 @@ class MultiDB:
|
|
|
213
219
|
i += 1
|
|
214
220
|
continue
|
|
215
221
|
|
|
216
|
-
new_lines.append(lines[i])
|
|
222
|
+
new_lines.append(lines[i])
|
|
217
223
|
new_lines.append(lines[i + 1])
|
|
218
224
|
new_lines.append(lines[i + 2])
|
|
219
225
|
|
|
220
226
|
j = i + 3
|
|
221
227
|
while j < len(lines) and not lines[j].startswith("[TABLE"):
|
|
222
228
|
j += 1
|
|
223
|
-
|
|
224
229
|
i = j
|
|
225
230
|
|
|
226
231
|
self._write(new_lines)
|
|
@@ -232,7 +237,6 @@ class MultiDB:
|
|
|
232
237
|
def table_update(self, table, columns):
|
|
233
238
|
self._lock()
|
|
234
239
|
lines = self._read()
|
|
235
|
-
|
|
236
240
|
tpos = self._find_table(lines, table)
|
|
237
241
|
if tpos == -1:
|
|
238
242
|
self._unlock()
|
|
@@ -243,9 +247,8 @@ class MultiDB:
|
|
|
243
247
|
for col in columns:
|
|
244
248
|
if isinstance(col, dict):
|
|
245
249
|
key = list(col.keys())[0]
|
|
246
|
-
rule = col[key]
|
|
247
250
|
col_names.append(key)
|
|
248
|
-
rules[key] =
|
|
251
|
+
rules[key] = col[key]
|
|
249
252
|
else:
|
|
250
253
|
col_names.append(col)
|
|
251
254
|
rules[col] = ""
|
|
@@ -257,13 +260,12 @@ class MultiDB:
|
|
|
257
260
|
idx += 1
|
|
258
261
|
|
|
259
262
|
new_data_rows = []
|
|
260
|
-
|
|
261
|
-
|
|
263
|
+
old_cols = json.loads(lines[tpos + 1])
|
|
262
264
|
for row in data_rows:
|
|
263
265
|
new_row = []
|
|
264
266
|
for col in col_names:
|
|
265
|
-
if col in
|
|
266
|
-
new_row.append(row[
|
|
267
|
+
if col in old_cols:
|
|
268
|
+
new_row.append(row[old_cols.index(col)])
|
|
267
269
|
else:
|
|
268
270
|
new_row.append("")
|
|
269
271
|
new_data_rows.append(new_row)
|
|
@@ -282,7 +284,6 @@ class MultiDB:
|
|
|
282
284
|
while j < len(lines) and not lines[j].startswith("[TABLE"):
|
|
283
285
|
j += 1
|
|
284
286
|
i = j
|
|
285
|
-
|
|
286
287
|
else:
|
|
287
288
|
new_lines.append(lines[i])
|
|
288
289
|
i += 1
|
|
@@ -304,20 +305,16 @@ class MultiDB:
|
|
|
304
305
|
|
|
305
306
|
found = False
|
|
306
307
|
idx = tpos + 3
|
|
307
|
-
|
|
308
308
|
while idx < len(lines) and not lines[idx].startswith("[TABLE"):
|
|
309
309
|
row = json.loads(lines[idx])
|
|
310
|
-
|
|
311
310
|
match = True
|
|
312
311
|
for key, val in conditions.items():
|
|
313
312
|
if row[col_indexes[key]] != val:
|
|
314
313
|
match = False
|
|
315
314
|
break
|
|
316
|
-
|
|
317
315
|
if match:
|
|
318
316
|
found = True
|
|
319
317
|
break
|
|
320
|
-
|
|
321
318
|
idx += 1
|
|
322
319
|
|
|
323
320
|
if output_list is None:
|
|
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
|