arpakitlib 1.7.221__py3-none-any.whl → 1.7.223__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/src/api/event.py +4 -4
- arpakitlib/_arpakit_project_template/src/tg_bot/event.py +33 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/filter/__init__.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/filter/not_prod_mode.py +8 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/filter/prod_mode.py +8 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/handler/__init__.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/handler/cmd_arpakitlib.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/handler/cmd_healthcheck.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/kb/__init__.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/kb/inline_/__init__.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/kb/inline_/callback.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/kb/inline_/common.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/kb/static_/__init__.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/kb/static_/common.py +0 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/start_tg_bot.py +6 -0
- arpakitlib/_arpakit_project_template/src/tg_bot/transmitted_tg_data.py +17 -0
- arpakitlib/ar_aiogram_util.py +9 -8
- arpakitlib/ar_arpakitlib_cli_util.py +1 -1
- arpakitlib/ar_fastapi_util.py +2 -2
- {arpakitlib-1.7.221.dist-info → arpakitlib-1.7.223.dist-info}/METADATA +1 -1
- {arpakitlib-1.7.221.dist-info → arpakitlib-1.7.223.dist-info}/RECORD +24 -10
- {arpakitlib-1.7.221.dist-info → arpakitlib-1.7.223.dist-info}/LICENSE +0 -0
- {arpakitlib-1.7.221.dist-info → arpakitlib-1.7.223.dist-info}/WHEEL +0 -0
- {arpakitlib-1.7.221.dist-info → arpakitlib-1.7.223.dist-info}/entry_points.txt +0 -0
@@ -9,8 +9,8 @@ from src.operation_execution.scheduled_operations import SCHEDULED_OPERATIONS
|
|
9
9
|
|
10
10
|
|
11
11
|
class StartupAPIEvent(BaseStartupAPIEvent):
|
12
|
-
def __init__(self, transmitted_api_data: TransmittedAPIData):
|
13
|
-
super().__init__()
|
12
|
+
def __init__(self, transmitted_api_data: TransmittedAPIData, **kwargs):
|
13
|
+
super().__init__(**kwargs)
|
14
14
|
self.transmitted_api_data = transmitted_api_data
|
15
15
|
|
16
16
|
async def async_on_startup(self, *args, **kwargs):
|
@@ -54,8 +54,8 @@ class StartupAPIEvent(BaseStartupAPIEvent):
|
|
54
54
|
|
55
55
|
|
56
56
|
class ShutdownAPIEvent(BaseShutdownAPIEvent):
|
57
|
-
def __init__(self, transmitted_api_data: TransmittedAPIData):
|
58
|
-
super().__init__()
|
57
|
+
def __init__(self, transmitted_api_data: TransmittedAPIData, **kwargs):
|
58
|
+
super().__init__(**kwargs)
|
59
59
|
self.transmitted_api_data = transmitted_api_data
|
60
60
|
|
61
61
|
async def async_on_shutdown(self, *args, **kwargs):
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
from src.tg_bot.transmitted_tg_data import TransmittedTgData
|
4
|
+
|
5
|
+
|
6
|
+
class StartupTgBotEvent:
|
7
|
+
def __init__(self, *, transmitted_tg_bot_data: TransmittedTgData, **kwargs):
|
8
|
+
self._logger = logging.getLogger()
|
9
|
+
self.transmitted_tg_bot_data = transmitted_tg_bot_data
|
10
|
+
|
11
|
+
async def on_startup(self, *args, **kwargs):
|
12
|
+
self._logger.info("on_startup start")
|
13
|
+
|
14
|
+
if self.transmitted_tg_bot_data.media_file_storage_in_dir is not None:
|
15
|
+
self.transmitted_tg_bot_data.media_file_storage_in_dir.init()
|
16
|
+
|
17
|
+
if self.transmitted_tg_bot_data.cache_file_storage_in_dir is not None:
|
18
|
+
self.transmitted_tg_bot_data.cache_file_storage_in_dir.init()
|
19
|
+
|
20
|
+
if self.transmitted_tg_bot_data.dump_file_storage_in_dir is not None:
|
21
|
+
self.transmitted_tg_bot_data.dump_file_storage_in_dir.init()
|
22
|
+
|
23
|
+
self._logger.info("on_startup was done")
|
24
|
+
|
25
|
+
|
26
|
+
class ShutdownTgBotEvent:
|
27
|
+
def __init__(self, *, transmitted_tg_bot_data: TransmittedTgData, **kwargs):
|
28
|
+
self._logger = logging.getLogger()
|
29
|
+
self.transmitted_tg_bot_data = transmitted_tg_bot_data
|
30
|
+
|
31
|
+
async def on_shutdown(self, *args, **kwargs):
|
32
|
+
self._logger.info("on_shutdown start")
|
33
|
+
self._logger.info("on_shutdown was done")
|
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
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from aiogram import Bot
|
2
|
+
|
3
|
+
from arpakitlib.ar_aiogram_util import BaseTransmittedTgBotData
|
4
|
+
from arpakitlib.ar_file_storage_in_dir_util import FileStorageInDir
|
5
|
+
from arpakitlib.ar_sqlalchemy_util import SQLAlchemyDB
|
6
|
+
from src.core.settings import Settings
|
7
|
+
|
8
|
+
|
9
|
+
class TransmittedTgData(BaseTransmittedTgBotData):
|
10
|
+
settings: Settings
|
11
|
+
sqlalchemy_db: SQLAlchemyDB | None = None
|
12
|
+
media_file_storage_in_dir: FileStorageInDir | None = None
|
13
|
+
cache_file_storage_in_dir: FileStorageInDir | None = None
|
14
|
+
dump_file_storage_in_dir: FileStorageInDir | None = None
|
15
|
+
tg_bot: Bot
|
16
|
+
|
17
|
+
# ...
|
arpakitlib/ar_aiogram_util.py
CHANGED
@@ -112,10 +112,6 @@ class WithFromCD(BaseCD, prefix="WithFromCD"):
|
|
112
112
|
from_: Optional[str] = None
|
113
113
|
|
114
114
|
|
115
|
-
class RemoveMessageCD(WithFromCD, prefix=generate_cd_prefix("RemoveMessageCD")):
|
116
|
-
pass
|
117
|
-
|
118
|
-
|
119
115
|
class BadTgCommandFormat(BadCommandFormat):
|
120
116
|
pass
|
121
117
|
|
@@ -326,11 +322,11 @@ class BaseTransmittedTgBotData(BaseModel):
|
|
326
322
|
model_config = ConfigDict(extra="ignore", arbitrary_types_allowed=True, from_attributes=True)
|
327
323
|
|
328
324
|
|
329
|
-
def create_aiogram_tg_bot(*,
|
330
|
-
kwargs["token"] =
|
325
|
+
def create_aiogram_tg_bot(*, token: str, proxy_url_: str | None = None, **kwargs) -> Bot:
|
326
|
+
kwargs["token"] = token
|
331
327
|
|
332
|
-
if
|
333
|
-
kwargs["session"] = AiohttpSession(proxy=
|
328
|
+
if proxy_url_:
|
329
|
+
kwargs["session"] = AiohttpSession(proxy=proxy_url_)
|
334
330
|
|
335
331
|
if kwargs.get("default") is None:
|
336
332
|
kwargs["default"] = DefaultBotProperties(
|
@@ -344,6 +340,11 @@ def create_aiogram_tg_bot(*, tg_bot_token: str, tg_bot_proxy_url: str | None = N
|
|
344
340
|
return tg_bot
|
345
341
|
|
346
342
|
|
343
|
+
def create_tg_bot_dispatcher():
|
344
|
+
# TODO
|
345
|
+
pass
|
346
|
+
|
347
|
+
|
347
348
|
def __example():
|
348
349
|
pass
|
349
350
|
|
@@ -44,7 +44,7 @@ def execute_arpakitlib_cli(*, full_command: str | None = None):
|
|
44
44
|
allow_none=False
|
45
45
|
)
|
46
46
|
project_name: str = parsed_command.get_value_by_keys(keys=["pm", "project_name"])
|
47
|
-
project_name = project_name.strip() if project_name.strip() else None
|
47
|
+
project_name = project_name.strip() if project_name and project_name.strip() else None
|
48
48
|
sql_db_port: int | None = parse_need_type(
|
49
49
|
value=parsed_command.get_value_by_keys(keys=["sdp", "sql_db_port"]),
|
50
50
|
need_type=NeedTypes.int_,
|
arpakitlib/ar_fastapi_util.py
CHANGED
@@ -421,7 +421,7 @@ def add_needed_api_router_to_app(*, app: FastAPI):
|
|
421
421
|
|
422
422
|
class BaseStartupAPIEvent:
|
423
423
|
def __init__(self, *args, **kwargs):
|
424
|
-
self._logger = logging.getLogger(
|
424
|
+
self._logger = logging.getLogger()
|
425
425
|
|
426
426
|
async def async_on_startup(self, *args, **kwargs):
|
427
427
|
self._logger.info("on_startup starts")
|
@@ -430,7 +430,7 @@ class BaseStartupAPIEvent:
|
|
430
430
|
|
431
431
|
class BaseShutdownAPIEvent:
|
432
432
|
def __init__(self, *args, **kwargs):
|
433
|
-
self._logger = logging.getLogger(
|
433
|
+
self._logger = logging.getLogger()
|
434
434
|
|
435
435
|
async def async_on_shutdown(self, *args, **kwargs):
|
436
436
|
self._logger.info("on_shutdown starts")
|
@@ -70,7 +70,7 @@ arpakitlib/_arpakit_project_template/src/api/asgi.py,sha256=a5UBxOyNC8NG3E0ayhiD
|
|
70
70
|
arpakitlib/_arpakit_project_template/src/api/auth.py,sha256=dcvj5C9E2F2KCsGZPBBncQf_EvVJAC1qQgnyD8P4ZEw,6
|
71
71
|
arpakitlib/_arpakit_project_template/src/api/const.py,sha256=7d4qD5hedqr7QxVzbfsA7E1bNZn2Pm2U8joXGtpANu0,287
|
72
72
|
arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=BeH-GxQyzx7t3vzUQHM9xdKEJTyKJiRjBtd2KR0D_n4,2915
|
73
|
-
arpakitlib/_arpakit_project_template/src/api/event.py,sha256=
|
73
|
+
arpakitlib/_arpakit_project_template/src/api/event.py,sha256=Ld4Ww3QyglvqEDm8LD-VmBB4KwkaXj9vc7JFlbJcEkM,3035
|
74
74
|
arpakitlib/_arpakit_project_template/src/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
arpakitlib/_arpakit_project_template/src/api/router/main_router.py,sha256=Yv699WCJDcdiJMXFg1kPTvolqj-NAGoXfqe-vzbMzIU,228
|
76
76
|
arpakitlib/_arpakit_project_template/src/api/router/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -113,16 +113,30 @@ arpakitlib/_arpakit_project_template/src/test_data/make_test_data_3.py,sha256=t5
|
|
113
113
|
arpakitlib/_arpakit_project_template/src/test_data/make_test_data_4.py,sha256=t1iYFim7v9NNR7Y10rUVRMVyq76Pdc82d5tQKpNlUFI,100
|
114
114
|
arpakitlib/_arpakit_project_template/src/test_data/make_test_data_5.py,sha256=ptptUxpEa7sX7coToAYZHvy8oxXXQExxS1zqng5ET2I,100
|
115
115
|
arpakitlib/_arpakit_project_template/src/tg_bot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/event.py,sha256=YMwoBH8TQhdjoTQBrxoxOvJqHqlw1yYVE5ymDp2D_Ak,1260
|
117
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
118
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/filter/not_prod_mode.py,sha256=uzkYsquQ5UKD68lEqe0478rbKFQYXZhbLIbxW0QhI44,235
|
119
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/filter/prod_mode.py,sha256=8zqDSSm3cqWmdoarZOh0hIjSLFQS9szVXnkibSJev30,228
|
120
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/handler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
121
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/handler/cmd_arpakitlib.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
122
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/handler/cmd_healthcheck.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
123
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/kb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
124
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/kb/inline_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
125
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/kb/inline_/callback.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/kb/inline_/common.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
127
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/kb/static_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
128
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/kb/static_/common.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
129
|
arpakitlib/_arpakit_project_template/src/tg_bot/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
|
-
arpakitlib/_arpakit_project_template/src/tg_bot/start_tg_bot.py,sha256=
|
130
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/start_tg_bot.py,sha256=C-bscqmpBZgUwDbVx7e35sNDfs2f677dlvZ-RwrAa6U,77
|
131
|
+
arpakitlib/_arpakit_project_template/src/tg_bot/transmitted_tg_data.py,sha256=XPNROag9Aq-eSIY7_KxaIxNvAp4orTkpkghRCh3nuz4,585
|
118
132
|
arpakitlib/_arpakit_project_template/src/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
119
133
|
arpakitlib/ar_additional_model_util.py,sha256=GFg-glLCxH9X95R2bhTJsscVwv37FgE1qbaAAyXrnIE,917
|
120
|
-
arpakitlib/ar_aiogram_util.py,sha256=
|
134
|
+
arpakitlib/ar_aiogram_util.py,sha256=lv2aXUmXLm3f2JltT1i683de6MnTTp9b5HihjO4KM5s,12194
|
121
135
|
arpakitlib/ar_api_key_util.py,sha256=E84JlJXiDHtxLQmV8BNHvqNKu_G8-Dox0XxknYJQ37Q,422
|
122
136
|
arpakitlib/ar_arpakit_lib_module_util.py,sha256=UEPU8wk29R_bBP_RENnhXYzNbj_RF9FWjowrj_yxWLA,5931
|
123
137
|
arpakitlib/ar_arpakit_project_template_util.py,sha256=c7yc8w2IvZGH5hH8eOpL7JuD005hUxZ0GVDcSkJF5iI,3705
|
124
138
|
arpakitlib/ar_arpakit_schedule_uust_api_client_util.py,sha256=006JstWvs6JTuxRCg3toSNQvtKO0KM5pqyPJa1PRDNA,14998
|
125
|
-
arpakitlib/ar_arpakitlib_cli_util.py,sha256=
|
139
|
+
arpakitlib/ar_arpakitlib_cli_util.py,sha256=208k_kWc-XHTYqL39k-rYrLcTKFF-3og21PVIsq5b2k,3171
|
126
140
|
arpakitlib/ar_base64_util.py,sha256=aZkg2cZTuAaP2IWeG_LXJ6RO7qhyskVwec-Lks0iM-k,676
|
127
141
|
arpakitlib/ar_base_worker_util.py,sha256=Qm_C7PFH5W-LPu1AGX1zp29zbqZ04i71Su1U-eeQBkA,5674
|
128
142
|
arpakitlib/ar_cache_file_util.py,sha256=Fo2pH-Zqm966KWFBHG_pbiySGZvhIFCYqy7k1weRfJ0,3476
|
@@ -153,7 +167,7 @@ arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css,sha256=jzPZlgJTFwSdSphk9C
|
|
153
167
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css.map,sha256=5wq8eXMLU6Zxb45orZPL1zAsBFJReFw6GjYqGpUX3hg,262650
|
154
168
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js,sha256=ffrLZHHEQ_g84A-ul3yWa10Kk09waOAxHcQXPuZuavg,339292
|
155
169
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js.map,sha256=9UhIW7MqCOZPAz1Sl1IKfZUuhWU0p-LJqrnjjJD9Xhc,1159454
|
156
|
-
arpakitlib/ar_fastapi_util.py,sha256=
|
170
|
+
arpakitlib/ar_fastapi_util.py,sha256=S58jgkIZvIAGXredD-ptSCCe_ak0GSGDdaT1vtDk308,26521
|
157
171
|
arpakitlib/ar_file_storage_in_dir_util.py,sha256=D3e3rGuHoI6xqAA5mVvEpVVpOWY1jyjNsjj2UhyHRbE,3674
|
158
172
|
arpakitlib/ar_file_util.py,sha256=GUdJYm1tUZnYpY-SIPRHAZBHGra8NKy1eYEI0D5AfhY,489
|
159
173
|
arpakitlib/ar_func_util.py,sha256=bCuWbSMoFXBaMNhb89sevj2oaXRk4Jk6Qjot8OXMDT4,1319
|
@@ -184,8 +198,8 @@ arpakitlib/ar_str_util.py,sha256=yU5gOwNXUQaH5b_tM5t6fXUn9oUcv5EQbVnq2wXXIpQ,337
|
|
184
198
|
arpakitlib/ar_type_util.py,sha256=9C3ErtUVs0tAUqtK-foFzjJOykfBOntfCz2IogDOgfA,4134
|
185
199
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
|
186
200
|
arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
|
187
|
-
arpakitlib-1.7.
|
188
|
-
arpakitlib-1.7.
|
189
|
-
arpakitlib-1.7.
|
190
|
-
arpakitlib-1.7.
|
191
|
-
arpakitlib-1.7.
|
201
|
+
arpakitlib-1.7.223.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
202
|
+
arpakitlib-1.7.223.dist-info/METADATA,sha256=_0RcwFAU2HG-zvzv9PML6cjgrbQ8Rb_Eent07EC1GnI,3231
|
203
|
+
arpakitlib-1.7.223.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
204
|
+
arpakitlib-1.7.223.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
205
|
+
arpakitlib-1.7.223.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|