diff --git a/iwf/registry.py b/iwf/registry.py index b5e0da9..7317f20 100644 --- a/iwf/registry.py +++ b/iwf/registry.py @@ -86,11 +86,15 @@ def _register_internal_channels(self, wf: ObjectWorkflow): wf_type = get_workflow_type(wf) if self._internal_channel_type_store[wf_type] is None: - self._internal_channel_type_store[wf_type] = TypeStore(Type.INTERNAL_CHANNEL) + self._internal_channel_type_store[wf_type] = TypeStore( + Type.INTERNAL_CHANNEL + ) for method in wf.get_communication_schema().communication_methods: if method.method_type == CommunicationMethodType.InternalChannel: - self._internal_channel_type_store[wf_type].add_internal_channel_def(method) + self._internal_channel_type_store[wf_type].add_internal_channel_def( + method + ) def _register_signal_channels(self, wf: ObjectWorkflow): wf_type = get_workflow_type(wf) diff --git a/iwf/type_store.py b/iwf/type_store.py index 639c8d2..f329303 100644 --- a/iwf/type_store.py +++ b/iwf/type_store.py @@ -11,6 +11,7 @@ class Type(Enum): # DATA_ATTRIBUTE = 2 # SIGNAL_CHANNEL = 3 + class TypeStore: _class_type: Type _name_to_type_store: dict[str, Optional[type]] @@ -40,7 +41,6 @@ def add_internal_channel_def(self, obj: CommunicationMethod): ) self._do_add_to_store(obj.is_prefix, obj.name, obj.value_type) - def _do_get_type(self, name: str) -> Optional[type]: if name in self._name_to_type_store: return self._name_to_type_store[name] @@ -62,7 +62,7 @@ def _do_add_to_store(self, is_prefix: bool, name: str, t: Optional[type]): if name in store: raise WorkflowDefinitionError( - f"{self._class_type} name/prefix {name} already exists") + f"{self._class_type} name/prefix {name} already exists" + ) store[name] = t -