pyquoks 2.2.0__tar.gz → 2.2.1__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.
- {pyquoks-2.2.0 → pyquoks-2.2.1}/PKG-INFO +2 -2
- {pyquoks-2.2.0 → pyquoks-2.2.1}/pyproject.toml +2 -2
- {pyquoks-2.2.0 → pyquoks-2.2.1}/src/pyquoks/data.py +23 -27
- {pyquoks-2.2.0 → pyquoks-2.2.1}/LICENSE +0 -0
- {pyquoks-2.2.0 → pyquoks-2.2.1}/README.md +0 -0
- {pyquoks-2.2.0 → pyquoks-2.2.1}/src/pyquoks/__init__.py +0 -0
- {pyquoks-2.2.0 → pyquoks-2.2.1}/src/pyquoks/localhost.py +0 -0
- {pyquoks-2.2.0 → pyquoks-2.2.1}/src/pyquoks/test.py +0 -0
- {pyquoks-2.2.0 → pyquoks-2.2.1}/src/pyquoks/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyquoks
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Пакет PyPI для часто используемых модулей в проектах diquoks
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -28,7 +28,7 @@ Requires-Dist: pydantic-core (==2.41.5)
|
|
|
28
28
|
Requires-Dist: requests (==2.32.5)
|
|
29
29
|
Requires-Dist: typing-extensions (==4.15.0)
|
|
30
30
|
Requires-Dist: typing-inspection (==0.4.2)
|
|
31
|
-
Requires-Dist: urllib3 (==2.6.
|
|
31
|
+
Requires-Dist: urllib3 (==2.6.2)
|
|
32
32
|
Requires-Dist: waitress (==3.0.2)
|
|
33
33
|
Requires-Dist: werkzeug (==3.1.4)
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyquoks"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.1"
|
|
4
4
|
description = "Пакет PyPI для часто используемых модулей в проектах diquoks"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Denis Titovets <den232titovets@yandex.ru>" }
|
|
@@ -27,7 +27,7 @@ dependencies = [
|
|
|
27
27
|
"requests (==2.32.5)",
|
|
28
28
|
"typing-inspection (==0.4.2)",
|
|
29
29
|
"typing-extensions (==4.15.0)",
|
|
30
|
-
"urllib3 (==2.6.
|
|
30
|
+
"urllib3 (==2.6.2)",
|
|
31
31
|
"waitress (==3.0.2)",
|
|
32
32
|
"werkzeug (==3.1.4)"
|
|
33
33
|
]
|
|
@@ -315,9 +315,11 @@ class ConfigManager(pyquoks.utils._HasRequiredAttributes):
|
|
|
315
315
|
if attribute not in self._VALUES.keys():
|
|
316
316
|
raise AttributeError(f"{attribute} is not specified!")
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
object_type = self._VALUES.get(attribute)
|
|
319
|
+
|
|
320
|
+
if type(value) is not object_type:
|
|
319
321
|
raise AttributeError(
|
|
320
|
-
f"{attribute} has incorrect type! (must be {
|
|
322
|
+
f"{attribute} has incorrect type! (must be {object_type.__name__})",
|
|
321
323
|
)
|
|
322
324
|
|
|
323
325
|
setattr(self, attribute, value)
|
|
@@ -398,35 +400,29 @@ class DataManager(pyquoks.utils._HasRequiredAttributes):
|
|
|
398
400
|
if attribute not in self._OBJECTS.keys():
|
|
399
401
|
raise AttributeError(f"{attribute} is not specified!")
|
|
400
402
|
|
|
401
|
-
|
|
403
|
+
object_type = self._OBJECTS.get(attribute)
|
|
402
404
|
|
|
403
|
-
|
|
404
|
-
if typing.get_origin(object_class) == list:
|
|
405
|
-
[typing.get_args(object_class)[0](**model) for model in value]
|
|
406
|
-
else:
|
|
407
|
-
object_class(**value)
|
|
408
|
-
except Exception:
|
|
405
|
+
if type(value) is not object_type:
|
|
409
406
|
raise AttributeError(
|
|
410
|
-
f"{attribute}
|
|
411
|
-
)
|
|
412
|
-
else:
|
|
413
|
-
if typing.get_origin(object_class) == list:
|
|
414
|
-
setattr(self, attribute, [typing.get_args(object_class)[0](**model) for model in value])
|
|
415
|
-
else:
|
|
416
|
-
setattr(self, attribute, object_class(**value))
|
|
417
|
-
|
|
418
|
-
os.makedirs(
|
|
419
|
-
name=self._PATH,
|
|
420
|
-
exist_ok=True,
|
|
407
|
+
f"{attribute} has incorrect type! (must be {object_type.__name__})",
|
|
421
408
|
)
|
|
422
409
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
410
|
+
setattr(self, attribute, value)
|
|
411
|
+
|
|
412
|
+
os.makedirs(
|
|
413
|
+
name=self._PATH,
|
|
414
|
+
exist_ok=True,
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
with open(self._PATH + self._FILENAME.format(attribute), "w", encoding="utf-8") as file:
|
|
418
|
+
json.dump(
|
|
419
|
+
[model.model_dump() for model in value] if typing.get_origin(
|
|
420
|
+
object_type,
|
|
421
|
+
) == list else value.model_dump(),
|
|
422
|
+
fp=file,
|
|
423
|
+
ensure_ascii=False,
|
|
424
|
+
indent=2,
|
|
425
|
+
)
|
|
430
426
|
|
|
431
427
|
|
|
432
428
|
class DatabaseManager(pyquoks.utils._HasRequiredAttributes):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|