explicit-python 2.2.1__py3-none-any.whl → 2.3.0__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.
- explicit/messagebus/dependency_injection.py +12 -0
- {explicit_python-2.2.1.dist-info → explicit_python-2.3.0.dist-info}/METADATA +12 -4
- {explicit_python-2.2.1.dist-info → explicit_python-2.3.0.dist-info}/RECORD +6 -6
- {explicit_python-2.2.1.dist-info → explicit_python-2.3.0.dist-info}/WHEEL +1 -1
- {explicit_python-2.2.1.dist-info → explicit_python-2.3.0.dist-info}/dependency_links.txt +0 -0
- {explicit_python-2.2.1.dist-info → explicit_python-2.3.0.dist-info}/top_level.txt +0 -0
|
@@ -16,12 +16,24 @@ class UnknownDependencyError(Exception):
|
|
|
16
16
|
"""Ожидаемая обработчиком зависимость не зарегистрирована."""
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
class AlreadyRegisteredDependencyError(Exception):
|
|
20
|
+
"""Зависимость с таким именем уже зарегистрирована."""
|
|
21
|
+
|
|
22
|
+
|
|
19
23
|
class DependencyInjectionMixin:
|
|
20
24
|
|
|
21
25
|
"""Примесь к шине сообщений, реализует управление зависимостями и их внедрение."""
|
|
22
26
|
|
|
23
27
|
_dependencies: Dict[str, Callable]
|
|
24
28
|
|
|
29
|
+
def register_dependency(self, alias: str, dependency: Callable):
|
|
30
|
+
"""Зарегистрировать зависимость."""
|
|
31
|
+
if alias in self._dependencies:
|
|
32
|
+
raise AlreadyRegisteredDependencyError(f'Зависимость с именем {alias} именем уже зарегистрирована')
|
|
33
|
+
|
|
34
|
+
self._dependencies[alias] = dependency
|
|
35
|
+
logger.debug('Зарегистрирована зависимость %s', alias)
|
|
36
|
+
|
|
25
37
|
def _set_dependencies(self, **dependencies: Any):
|
|
26
38
|
"""Заменяет внутреннее сопоставление зависимостей."""
|
|
27
39
|
self._dependencies = dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: explicit-python
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Набор компонентов для построения многослойной архитектуры
|
|
5
5
|
Author: BARS Group
|
|
6
6
|
Author-email: education_dev@bars-open.ru
|
|
@@ -16,8 +16,16 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Development Status :: 5 - Production/Stable
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
|
-
Requires-Dist: pydantic
|
|
20
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: pydantic<2.0
|
|
20
|
+
Requires-Dist: more_itertools
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
21
29
|
|
|
22
30
|
# Explicit
|
|
23
31
|
## Набор компонентов для построения явной (Explicit) многослойной архитектуры
|
|
@@ -19,12 +19,12 @@ explicit/domain/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
19
19
|
explicit/domain/validation/exceptions.py,sha256=qHmLuFnsrweNDXGTkG2baPmMYcjkDdgQefANrq1xwx8,5055
|
|
20
20
|
explicit/messagebus/__init__.py,sha256=u5D-bx-IqhG1LFv-78RGK9Tgbv-uPQL_bQgDr586GsM,126
|
|
21
21
|
explicit/messagebus/commands.py,sha256=5kEoL23ZaYLRuUdwrurNBmwZL7Ss5TgQaulbn0he8Mc,3147
|
|
22
|
-
explicit/messagebus/dependency_injection.py,sha256=
|
|
22
|
+
explicit/messagebus/dependency_injection.py,sha256=wOYcixyW-8bn4Bd0IZfdahPWUkF8UACG0wm3PN9S95o,2578
|
|
23
23
|
explicit/messagebus/events.py,sha256=BKAqEqIC_V6sYMeHZQpAZBsigf9NanSgGZVTJlKX3-I,3487
|
|
24
24
|
explicit/messagebus/messagebus.py,sha256=Yc55SCvCQjS1F5fZtLpjjDOFes7P6gXb5uFo7xeXRw4,3071
|
|
25
25
|
explicit/messagebus/queries.py,sha256=kMtT8Bm2YeZbrORAIqq0unou1V2XBz8hvLPXmmzHP_4,1616
|
|
26
|
-
explicit_python-2.
|
|
27
|
-
explicit_python-2.
|
|
28
|
-
explicit_python-2.
|
|
29
|
-
explicit_python-2.
|
|
30
|
-
explicit_python-2.
|
|
26
|
+
explicit_python-2.3.0.dist-info/METADATA,sha256=Do8drNf2qwpsYdfkmxP3ziTN2UZ_3IjEEaTk7wQBp1s,13004
|
|
27
|
+
explicit_python-2.3.0.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
28
|
+
explicit_python-2.3.0.dist-info/dependency_links.txt,sha256=z2Fi-sEElLMsunjPT4vpjRUYQ4oGu_tX_9NeLaEKlgo,44
|
|
29
|
+
explicit_python-2.3.0.dist-info/top_level.txt,sha256=tt6T8l4Yji4ww87qZQcD4CbcwTIHy7NAPmU7QAfMcpY,9
|
|
30
|
+
explicit_python-2.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|