arpakitlib 1.6.90__py3-none-any.whl → 1.6.91__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.
- arpakitlib/_arpakit_project_template/manage/check_logging.py +13 -0
- arpakitlib/ar_fastapi_util.py +18 -6
- arpakitlib/ar_logging_util.py +3 -0
- {arpakitlib-1.6.90.dist-info → arpakitlib-1.6.91.dist-info}/METADATA +1 -1
- {arpakitlib-1.6.90.dist-info → arpakitlib-1.6.91.dist-info}/RECORD +9 -8
- {arpakitlib-1.6.90.dist-info → arpakitlib-1.6.91.dist-info}/LICENSE +0 -0
- {arpakitlib-1.6.90.dist-info → arpakitlib-1.6.91.dist-info}/NOTICE +0 -0
- {arpakitlib-1.6.90.dist-info → arpakitlib-1.6.91.dist-info}/WHEEL +0 -0
- {arpakitlib-1.6.90.dist-info → arpakitlib-1.6.91.dist-info}/entry_points.txt +0 -0
arpakitlib/ar_fastapi_util.py
CHANGED
@@ -27,6 +27,7 @@ from starlette.staticfiles import StaticFiles
|
|
27
27
|
from arpakitlib.ar_base_worker_util import BaseWorker
|
28
28
|
from arpakitlib.ar_dict_util import combine_dicts
|
29
29
|
from arpakitlib.ar_enumeration_util import Enumeration
|
30
|
+
from arpakitlib.ar_file_storage_in_dir_util import FileStorageInDir
|
30
31
|
from arpakitlib.ar_json_util import safely_transfer_to_json_str_to_json_obj
|
31
32
|
from arpakitlib.ar_logging_util import setup_normal_logging
|
32
33
|
from arpakitlib.ar_sqlalchemy_model_util import StoryLogDBM
|
@@ -396,18 +397,29 @@ class InitSqlalchemyDBStartupAPIEvent(BaseStartupAPIEvent):
|
|
396
397
|
super().__init__()
|
397
398
|
self.sqlalchemy_db = sqlalchemy_db
|
398
399
|
|
399
|
-
def async_on_startup(self, *args, **kwargs):
|
400
|
+
async def async_on_startup(self, *args, **kwargs):
|
400
401
|
self.sqlalchemy_db.init()
|
401
402
|
|
402
403
|
|
403
404
|
class SafeRunWorkerStartupAPIEvent(BaseStartupAPIEvent):
|
404
|
-
def __init__(self,
|
405
|
+
def __init__(self, workers: list[BaseWorker], safe_run_in_background_mode: str):
|
405
406
|
super().__init__()
|
406
|
-
self.
|
407
|
+
self.workers = workers
|
407
408
|
self.safe_run_in_background_mode = safe_run_in_background_mode
|
408
409
|
|
409
|
-
def async_on_startup(self, *args, **kwargs):
|
410
|
-
|
410
|
+
async def async_on_startup(self, *args, **kwargs):
|
411
|
+
for worker in self.workers:
|
412
|
+
_ = worker.safe_run_in_background(safe_run_in_background_mode=self.safe_run_in_background_mode)
|
413
|
+
|
414
|
+
|
415
|
+
class InitFileStoragesInDir(BaseStartupAPIEvent):
|
416
|
+
def __init__(self, file_storages_in_dir: list[FileStorageInDir]):
|
417
|
+
super().__init__()
|
418
|
+
self.file_storages_in_dir = file_storages_in_dir
|
419
|
+
|
420
|
+
async def async_on_startup(self, *args, **kwargs):
|
421
|
+
for file_storage_in_dir in self.file_storages_in_dir:
|
422
|
+
file_storage_in_dir.init()
|
411
423
|
|
412
424
|
|
413
425
|
class BaseTransmittedAPIData(BaseModel):
|
@@ -422,7 +434,7 @@ class BaseAPIAuthData(BaseModel):
|
|
422
434
|
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True, from_attributes=True)
|
423
435
|
|
424
436
|
require_api_key_string: bool = False
|
425
|
-
require_token_string: bool =
|
437
|
+
require_token_string: bool = False
|
426
438
|
|
427
439
|
token_string: str | None = None
|
428
440
|
api_key_string: str | None = None
|
arpakitlib/ar_logging_util.py
CHANGED
@@ -8,6 +8,9 @@ _ARPAKIT_LIB_MODULE_VERSION = "3.0"
|
|
8
8
|
|
9
9
|
|
10
10
|
def init_log_file(*, log_filepath: str):
|
11
|
+
directory = os.path.dirname(log_filepath)
|
12
|
+
if directory and not os.path.exists(directory):
|
13
|
+
os.makedirs(directory, exist_ok=True)
|
11
14
|
if not os.path.exists(path=log_filepath):
|
12
15
|
with open(file=log_filepath, mode="w") as file:
|
13
16
|
file.write("")
|
@@ -8,6 +8,7 @@ arpakitlib/_arpakit_project_template/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0
|
|
8
8
|
arpakitlib/_arpakit_project_template/README.md,sha256=n7bVQwXStxdwN07oMF9ot5076qVjTk_H-rmUaSYfHK8,66
|
9
9
|
arpakitlib/_arpakit_project_template/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
arpakitlib/_arpakit_project_template/manage/beutify_json.py,sha256=mzmt-5piAHqgihLsqOpPx1JjDc1qA5F1XHBxDdR-BxY,215
|
11
|
+
arpakitlib/_arpakit_project_template/manage/check_logging.py,sha256=77OQzbolrlfc6h5EK5nkJ4RamJ034mFVW8s0rVQGnhM,211
|
11
12
|
arpakitlib/_arpakit_project_template/manage/check_settings.py,sha256=JYR-IPgvYQOmJedKY9vOctbxEcUlaxZR-P0JXT9L2JQ,143
|
12
13
|
arpakitlib/_arpakit_project_template/manage/docker_ps.sh,sha256=uwm8vHgeuNLCOn0o9hgP_uc-PUkS9FwLyzZh6ItZ3do,15
|
13
14
|
arpakitlib/_arpakit_project_template/manage/generate_env_example.py,sha256=gveKEz6zf5rwKNBXtHacPEjxxjPTbLy4n-Ztv0BqCWE,331
|
@@ -95,7 +96,7 @@ arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css,sha256=jzPZlgJTFwSdSphk9C
|
|
95
96
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css.map,sha256=5wq8eXMLU6Zxb45orZPL1zAsBFJReFw6GjYqGpUX3hg,262650
|
96
97
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js,sha256=ffrLZHHEQ_g84A-ul3yWa10Kk09waOAxHcQXPuZuavg,339292
|
97
98
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js.map,sha256=9UhIW7MqCOZPAz1Sl1IKfZUuhWU0p-LJqrnjjJD9Xhc,1159454
|
98
|
-
arpakitlib/ar_fastapi_util.py,sha256=
|
99
|
+
arpakitlib/ar_fastapi_util.py,sha256=ArREVRVsfUVELk92NcNf2ZXrjajIQXOsEdHjs8NpKHI,21587
|
99
100
|
arpakitlib/ar_file_storage_in_dir_util.py,sha256=D3e3rGuHoI6xqAA5mVvEpVVpOWY1jyjNsjj2UhyHRbE,3674
|
100
101
|
arpakitlib/ar_file_util.py,sha256=XiwmeycxoLqtYnGOu5q6IEaJJXilZvtLvsKDKtwqSLY,137
|
101
102
|
arpakitlib/ar_hash_util.py,sha256=Iqy6KBAOLBQMFLWv676boI5sV7atT2B-fb7aCdHOmIQ,340
|
@@ -107,7 +108,7 @@ arpakitlib/ar_json_util.py,sha256=GwHDdrBWiJBHSc07Qe0aN1Gp_uM0pYpTwzU9JAgsKAo,97
|
|
107
108
|
arpakitlib/ar_jwt_util.py,sha256=Rhm4ywoTAn6yOV8NLjDASfAtAtheROxxDP40G3XjnuQ,761
|
108
109
|
arpakitlib/ar_list_of_dicts_to_xlsx.py,sha256=MyjEl4Jl4beLVZqLVQMMv0-XDtBD3Xh4Z_ZPDJeFu04,745
|
109
110
|
arpakitlib/ar_list_util.py,sha256=2woOAHAU8oTIiVjZ8GLnx15odEaoQUq3Q0JPxlufFF0,457
|
110
|
-
arpakitlib/ar_logging_util.py,sha256=
|
111
|
+
arpakitlib/ar_logging_util.py,sha256=Gyd7B9k0glIXPm6dASiigWLq9LC9lw6vhXTCeWpY5PY,1644
|
111
112
|
arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
|
112
113
|
arpakitlib/ar_need_type_util.py,sha256=xq5bbAXJG-93CRVZUcLW0ZdM22rj-ZUW17C5hX_5grg,1699
|
113
114
|
arpakitlib/ar_openai_util.py,sha256=dHUbfg1sVVCjsNl_fra3iCMEz1bR-Hk9fE-DdYbu7Wc,1215
|
@@ -126,9 +127,9 @@ arpakitlib/ar_str_util.py,sha256=AhcdrEm-pXRilCaDWCdTfVkQSy0SnbE52ur43Ltr6cI,212
|
|
126
127
|
arpakitlib/ar_type_util.py,sha256=5nDnXL5Oyozlg8XvxMrogsoYiG8_atItg46A0mtv-pk,2025
|
127
128
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=5GMvu8paByni8buhc1vpHB7n6oXe0gPfj1LSvnyZCrQ,5307
|
128
129
|
arpakitlib/ar_zabbix_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
|
129
|
-
arpakitlib-1.6.
|
130
|
-
arpakitlib-1.6.
|
131
|
-
arpakitlib-1.6.
|
132
|
-
arpakitlib-1.6.
|
133
|
-
arpakitlib-1.6.
|
134
|
-
arpakitlib-1.6.
|
130
|
+
arpakitlib-1.6.91.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
131
|
+
arpakitlib-1.6.91.dist-info/METADATA,sha256=Z8GFQT2jI8crIJHoWwwS4ELu6vlK-Frcq_u1M7_0Vxo,2739
|
132
|
+
arpakitlib-1.6.91.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
|
133
|
+
arpakitlib-1.6.91.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
134
|
+
arpakitlib-1.6.91.dist-info/entry_points.txt,sha256=VHkTDXDOMrgcNzGfKhEhoOIIz6T8Kkt46hy95Zc1iL0,74
|
135
|
+
arpakitlib-1.6.91.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|