rats-apps 0.1.2.dev6__py3-none-any.whl → 0.1.2.dev9__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.
- rats/apps/_annotations.py +2 -2
- rats/apps/_composite_container.py +2 -2
- rats/apps/_container.py +6 -6
- rats/apps/_plugin_container.py +2 -2
- {rats_apps-0.1.2.dev6.dist-info → rats_apps-0.1.2.dev9.dist-info}/METADATA +1 -1
- rats_apps-0.1.2.dev9.dist-info/RECORD +13 -0
- rats_apps-0.1.2.dev6.dist-info/RECORD +0 -13
- {rats_apps-0.1.2.dev6.dist-info → rats_apps-0.1.2.dev9.dist-info}/WHEEL +0 -0
- {rats_apps-0.1.2.dev6.dist-info → rats_apps-0.1.2.dev9.dist-info}/entry_points.txt +0 -0
rats/apps/_annotations.py
CHANGED
@@ -66,7 +66,7 @@ class FunctionAnnotationsBuilder:
|
|
66
66
|
|
67
67
|
class AnnotatedContainer(Container):
|
68
68
|
|
69
|
-
def
|
69
|
+
def get_namespaced_group(
|
70
70
|
self,
|
71
71
|
namespace: str,
|
72
72
|
group_id: ServiceId[T_ServiceType],
|
@@ -80,7 +80,7 @@ class AnnotatedContainer(Container):
|
|
80
80
|
|
81
81
|
for container in containers:
|
82
82
|
c = getattr(self, container.name)()
|
83
|
-
yield from c.
|
83
|
+
yield from c.get_namespaced_group(namespace, group_id)
|
84
84
|
|
85
85
|
|
86
86
|
def service(
|
@@ -10,10 +10,10 @@ class CompositeContainer(Container):
|
|
10
10
|
def __init__(self, *containers: Container) -> None:
|
11
11
|
self._containers = containers
|
12
12
|
|
13
|
-
def
|
13
|
+
def get_namespaced_group(
|
14
14
|
self,
|
15
15
|
namespace: str,
|
16
16
|
group_id: ServiceId[T_ServiceType],
|
17
17
|
) -> Iterator[T_ServiceType]:
|
18
18
|
for container in self._containers:
|
19
|
-
yield from container.
|
19
|
+
yield from container.get_namespaced_group(namespace, group_id)
|
rats/apps/_container.py
CHANGED
@@ -37,16 +37,16 @@ class Container(Protocol):
|
|
37
37
|
|
38
38
|
def has_namespace(self, namespace: str, group_id: ServiceId[T_ServiceType]) -> bool:
|
39
39
|
try:
|
40
|
-
return next(self.
|
40
|
+
return next(self.get_namespaced_group(namespace, group_id)) is not None
|
41
41
|
except StopIteration:
|
42
42
|
return False
|
43
43
|
|
44
44
|
def get(self, service_id: ServiceId[T_ServiceType]) -> T_ServiceType:
|
45
45
|
"""Retrieve a service instance by its id."""
|
46
|
-
services = list(self.
|
46
|
+
services = list(self.get_namespaced_group(ProviderNamespaces.SERVICES, service_id))
|
47
47
|
if len(services) == 0:
|
48
48
|
services.extend(
|
49
|
-
list(self.
|
49
|
+
list(self.get_namespaced_group(ProviderNamespaces.FALLBACK_SERVICES, service_id)),
|
50
50
|
)
|
51
51
|
|
52
52
|
if len(services) > 1:
|
@@ -62,12 +62,12 @@ class Container(Protocol):
|
|
62
62
|
) -> Iterator[T_ServiceType]:
|
63
63
|
"""Retrieve a service group by its id."""
|
64
64
|
if not self.has_namespace(ProviderNamespaces.GROUPS, group_id):
|
65
|
-
yield from self.
|
65
|
+
yield from self.get_namespaced_group(ProviderNamespaces.FALLBACK_GROUPS, group_id)
|
66
66
|
|
67
|
-
yield from self.
|
67
|
+
yield from self.get_namespaced_group(ProviderNamespaces.GROUPS, group_id)
|
68
68
|
|
69
69
|
@abstractmethod
|
70
|
-
def
|
70
|
+
def get_namespaced_group(
|
71
71
|
self,
|
72
72
|
namespace: str,
|
73
73
|
group_id: ServiceId[T_ServiceType],
|
rats/apps/_plugin_container.py
CHANGED
@@ -14,13 +14,13 @@ class PluginContainers(Container):
|
|
14
14
|
self._app = app
|
15
15
|
self._group = group
|
16
16
|
|
17
|
-
def
|
17
|
+
def get_namespaced_group(
|
18
18
|
self,
|
19
19
|
namespace: str,
|
20
20
|
group_id: ServiceId[T_ServiceType],
|
21
21
|
) -> Iterator[T_ServiceType]:
|
22
22
|
for container in self._load_containers():
|
23
|
-
yield from container.
|
23
|
+
yield from container.get_namespaced_group(namespace, group_id)
|
24
24
|
|
25
25
|
@cache # noqa: B019
|
26
26
|
def _load_containers(self) -> Iterable[Container]:
|
@@ -0,0 +1,13 @@
|
|
1
|
+
rats/apps/__init__.py,sha256=EHza57K66uM7w8pFBJBqMWaJ7Xn_7E4hn0xA7k8Ag5U,857
|
2
|
+
rats/apps/_annotations.py,sha256=V6sNsvh66VGB6ciog0AwPgXwTjBrtlIZXT-ZZx_LpdY,5124
|
3
|
+
rats/apps/_composite_container.py,sha256=wSWVQWPin2xxIlEoSgk_D1rlc3N2gpTxQ2y9UFdqXy0,553
|
4
|
+
rats/apps/_container.py,sha256=JSmO4x0JcnM9gQP0ki9JcGzYqbjmgAj79lZw5YfBrqI,3131
|
5
|
+
rats/apps/_ids.py,sha256=dxWCPMpMA_vpaTDJEKNByIBJaX97Db203XqWLhaOezo,457
|
6
|
+
rats/apps/_namespaces.py,sha256=THUV_Xj5PtweC23Ob-zsSpk8exC4fT-qRwjpQ6IDm0U,188
|
7
|
+
rats/apps/_plugin_container.py,sha256=W_xQD2btc0N2dEb3c5tXM-ZZ4A4diMpkCjbOZdlXYuI,853
|
8
|
+
rats/apps/_scoping.py,sha256=-5hl0RoOdQGkxWLIn42hthMUyX8_84sV8H3u40y-gIU,1304
|
9
|
+
rats/apps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
rats_apps-0.1.2.dev9.dist-info/METADATA,sha256=-WiawuBlYmLlPdFLoWa8DvkM1-9Dcn57jNmoJRZIX_4,716
|
11
|
+
rats_apps-0.1.2.dev9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
+
rats_apps-0.1.2.dev9.dist-info/entry_points.txt,sha256=Vu1IgAPQvL4xMJzW_OG2JSPFac7HalCHyXiRr0-OfCI,86
|
13
|
+
rats_apps-0.1.2.dev9.dist-info/RECORD,,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
rats/apps/__init__.py,sha256=EHza57K66uM7w8pFBJBqMWaJ7Xn_7E4hn0xA7k8Ag5U,857
|
2
|
-
rats/apps/_annotations.py,sha256=QXx78Qbiikn_4uV09J9N0c2aNK6bj-RtUcbgCy3Q718,5110
|
3
|
-
rats/apps/_composite_container.py,sha256=-o942CbRgczz2GXDN1gABF8vLTKDOXGddOpob1tZaNw,539
|
4
|
-
rats/apps/_container.py,sha256=dm1wRAuPWM0hV2BtNyBmfZ-cybId55w7oua4rvKuiis,3089
|
5
|
-
rats/apps/_ids.py,sha256=dxWCPMpMA_vpaTDJEKNByIBJaX97Db203XqWLhaOezo,457
|
6
|
-
rats/apps/_namespaces.py,sha256=THUV_Xj5PtweC23Ob-zsSpk8exC4fT-qRwjpQ6IDm0U,188
|
7
|
-
rats/apps/_plugin_container.py,sha256=jKD1ft5Ph-DJU7fw2NKC7_FKwSqhWTvZoJTd7lHt6_s,839
|
8
|
-
rats/apps/_scoping.py,sha256=-5hl0RoOdQGkxWLIn42hthMUyX8_84sV8H3u40y-gIU,1304
|
9
|
-
rats/apps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
rats_apps-0.1.2.dev6.dist-info/METADATA,sha256=N7hlG8xu1DhseCv2Krrt2-g5-5QoQw_8T4XDEY03OzA,716
|
11
|
-
rats_apps-0.1.2.dev6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
-
rats_apps-0.1.2.dev6.dist-info/entry_points.txt,sha256=Vu1IgAPQvL4xMJzW_OG2JSPFac7HalCHyXiRr0-OfCI,86
|
13
|
-
rats_apps-0.1.2.dev6.dist-info/RECORD,,
|
File without changes
|
File without changes
|