arpakitlib 1.4.8__py3-none-any.whl → 1.5.1__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.
Potentially problematic release.
This version of arpakitlib might be problematic. Click here for more details.
- arpakitlib/ar_fastapi_util.py +3 -3
- arpakitlib/ar_sqlalchemy_util.py +5 -5
- arpakitlib/ar_zabbix_util.py +1 -1
- {arpakitlib-1.4.8.dist-info → arpakitlib-1.5.1.dist-info}/METADATA +1 -1
- {arpakitlib-1.4.8.dist-info → arpakitlib-1.5.1.dist-info}/RECORD +8 -8
- {arpakitlib-1.4.8.dist-info → arpakitlib-1.5.1.dist-info}/LICENSE +0 -0
- {arpakitlib-1.4.8.dist-info → arpakitlib-1.5.1.dist-info}/NOTICE +0 -0
- {arpakitlib-1.4.8.dist-info → arpakitlib-1.5.1.dist-info}/WHEEL +0 -0
arpakitlib/ar_fastapi_util.py
CHANGED
|
@@ -86,7 +86,7 @@ class APIException(fastapi.exceptions.HTTPException):
|
|
|
86
86
|
error_data = {}
|
|
87
87
|
self.error_data = error_data
|
|
88
88
|
|
|
89
|
-
self.
|
|
89
|
+
self.api_error_so = APIErrorSO(
|
|
90
90
|
has_error=True,
|
|
91
91
|
error_code=self.error_code,
|
|
92
92
|
error_specification=self.error_code_specification,
|
|
@@ -96,7 +96,7 @@ class APIException(fastapi.exceptions.HTTPException):
|
|
|
96
96
|
|
|
97
97
|
super().__init__(
|
|
98
98
|
status_code=self.status_code,
|
|
99
|
-
detail=self.
|
|
99
|
+
detail=self.api_error_so.model_dump(mode="json")
|
|
100
100
|
)
|
|
101
101
|
|
|
102
102
|
|
|
@@ -115,7 +115,7 @@ def from_exception_to_api_json_response(
|
|
|
115
115
|
status_code = starlette.status.HTTP_500_INTERNAL_SERVER_ERROR
|
|
116
116
|
|
|
117
117
|
if isinstance(exception, APIException):
|
|
118
|
-
easy_api_error_so = exception.
|
|
118
|
+
easy_api_error_so = exception.api_error_so
|
|
119
119
|
|
|
120
120
|
elif isinstance(exception, starlette.exceptions.HTTPException):
|
|
121
121
|
status_code = exception.status_code
|
arpakitlib/ar_sqlalchemy_util.py
CHANGED
|
@@ -44,7 +44,7 @@ class SimpleDBM(BaseDBM):
|
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
class
|
|
47
|
+
class EasySQLAlchemyDB:
|
|
48
48
|
def __init__(self, *, db_url: str, echo: bool = False):
|
|
49
49
|
self._logger = logging.getLogger(self.__class__.__name__)
|
|
50
50
|
self.engine = create_engine(
|
|
@@ -101,16 +101,16 @@ class SQLAlchemyDB:
|
|
|
101
101
|
return False
|
|
102
102
|
return True
|
|
103
103
|
|
|
104
|
-
def generate_unique_id(self, *, class_dbm: type[
|
|
104
|
+
def generate_unique_id(self, *, class_dbm: type[SimpleDBM]):
|
|
105
105
|
with self.new_session() as session:
|
|
106
|
-
res = session.query(func.max(class_dbm.id)).scalar()
|
|
106
|
+
res: int = session.query(func.max(class_dbm.id)).scalar()
|
|
107
107
|
while session.query(class_dbm).filter(class_dbm.id == res).first() is not None:
|
|
108
108
|
res += 1
|
|
109
109
|
return res
|
|
110
110
|
|
|
111
|
-
def generate_unique_long_id(self, *, class_dbm: type[
|
|
111
|
+
def generate_unique_long_id(self, *, class_dbm: type[SimpleDBM]):
|
|
112
112
|
with self.new_session() as session:
|
|
113
|
-
res = str(uuid4())
|
|
113
|
+
res: str = str(uuid4())
|
|
114
114
|
while session.query(class_dbm).filter(class_dbm.long_id == res).first() is not None:
|
|
115
115
|
res = str(uuid4())
|
|
116
116
|
return res
|
arpakitlib/ar_zabbix_util.py
CHANGED
|
@@ -35,7 +35,7 @@ arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css,sha256=jzPZlgJTFwSdSphk9C
|
|
|
35
35
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css.map,sha256=5wq8eXMLU6Zxb45orZPL1zAsBFJReFw6GjYqGpUX3hg,262650
|
|
36
36
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js,sha256=ffrLZHHEQ_g84A-ul3yWa10Kk09waOAxHcQXPuZuavg,339292
|
|
37
37
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js.map,sha256=9UhIW7MqCOZPAz1Sl1IKfZUuhWU0p-LJqrnjjJD9Xhc,1159454
|
|
38
|
-
arpakitlib/ar_fastapi_util.py,sha256
|
|
38
|
+
arpakitlib/ar_fastapi_util.py,sha256=SVryWKVc9bRbtWyM-ndk4h8PdWzaIqRBJvwxk7HFyBg,9714
|
|
39
39
|
arpakitlib/ar_file_storage_in_dir.py,sha256=caS2hRpjKYvK7UNp7qrbSoxT1PfQjJGLOrWEbx-dk-o,3663
|
|
40
40
|
arpakitlib/ar_generate_env_example.py,sha256=aFuHK38bZfGwr57D7AFMCCOOda824o9k95ney_CUbfE,314
|
|
41
41
|
arpakitlib/ar_hash_util.py,sha256=rWKjUaJyzzLNyrMVXe90bcJt0KMkPBPlJGa42qc8zOE,329
|
|
@@ -55,14 +55,14 @@ arpakitlib/ar_postgresql_util.py,sha256=bsnp5ylMvi7qJaj5fA3QZdQ4wUtrCZxElNikMWNs
|
|
|
55
55
|
arpakitlib/ar_run_cmd.py,sha256=2Cs1xn3jS3xfAbgIHthtLCKQC-qr1k7w15rID2Zya3A,1061
|
|
56
56
|
arpakitlib/ar_safe_sleep.py,sha256=fxJIe85G62qmcHeujqu8FfHOKYfuZPz315ZW-BO_w0Q,398
|
|
57
57
|
arpakitlib/ar_schedule_uust_api_client.py,sha256=bK79j0EAqQKnSYlr0Rqp2vz84hNlBrmjmjp7FADK3PU,6783
|
|
58
|
-
arpakitlib/ar_sqlalchemy_util.py,sha256=
|
|
58
|
+
arpakitlib/ar_sqlalchemy_util.py,sha256=HEld593ppr5Z_7pFP_KqrW0NlvcZiQm-RQ_m56P0wPU,4142
|
|
59
59
|
arpakitlib/ar_ssh_runner.py,sha256=-VL1RjQRVDjlnIFQfl_TTpQP05OehNxmvkfoQNgvNYw,6785
|
|
60
60
|
arpakitlib/ar_str_util.py,sha256=y1KQ5q9WPMhQdmLqqL1R1GrPEEEj_Jo4dxbAPCgW780,1874
|
|
61
61
|
arpakitlib/ar_type_util.py,sha256=9fSSJKWsHtXOjGcFHgfEI_1ezrHfjF_o3y1RAJvMX9c,1750
|
|
62
62
|
arpakitlib/ar_yookassa_api_client.py,sha256=jCoeK9WfwGK4IUPYYsRgxWEqkNfUV5-ZJQg0b2evtTc,6438
|
|
63
|
-
arpakitlib/ar_zabbix_util.py,sha256=
|
|
64
|
-
arpakitlib-1.
|
|
65
|
-
arpakitlib-1.
|
|
66
|
-
arpakitlib-1.
|
|
67
|
-
arpakitlib-1.
|
|
68
|
-
arpakitlib-1.
|
|
63
|
+
arpakitlib/ar_zabbix_util.py,sha256=BvtqIT4PnUw4OzzRKPpdu-nLyYZ5cMatYUDeSdXPgGw,6302
|
|
64
|
+
arpakitlib-1.5.1.dist-info/LICENSE,sha256=1jqWIkbnMxDfs_i0SXP5qbV6PHjBr1g8506oW7uPjfg,11347
|
|
65
|
+
arpakitlib-1.5.1.dist-info/METADATA,sha256=82YUbhaBG3CWvAaYZmhPvB6Cn_2IK1jSAhdz91O8ORM,9050
|
|
66
|
+
arpakitlib-1.5.1.dist-info/NOTICE,sha256=wHwmiq3wExfFfgMsE5U5TOBP9_l72ocIG82KurEels0,43
|
|
67
|
+
arpakitlib-1.5.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
68
|
+
arpakitlib-1.5.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|