diff --git a/spine_engine/server/util/event_data_converter.py b/spine_engine/server/util/event_data_converter.py index 3fe76b9..f9c8f28 100644 --- a/spine_engine/server/util/event_data_converter.py +++ b/spine_engine/server/util/event_data_converter.py @@ -132,13 +132,14 @@ def convert_execution_finish_state(state): Returns: ItemExecutionFinishState: Enum if given str is valid, None otherwise. """ - states = dict() - states["SUCCESS"] = ItemExecutionFinishState.SUCCESS - states["FAILURE"] = ItemExecutionFinishState.FAILURE - states["SKIPPED"] = ItemExecutionFinishState.SKIPPED - states["EXCLUDED"] = ItemExecutionFinishState.EXCLUDED - states["STOPPED"] = ItemExecutionFinishState.STOPPED - states["NEVER_FINISHED"] = ItemExecutionFinishState.NEVER_FINISHED + states = { + "SUCCESS": ItemExecutionFinishState.SUCCESS, + "FAILURE": ItemExecutionFinishState.FAILURE, + "SKIPPED": ItemExecutionFinishState.SKIPPED, + "EXCLUDED": ItemExecutionFinishState.EXCLUDED, + "STOPPED": ItemExecutionFinishState.STOPPED, + "NEVER_FINISHED": ItemExecutionFinishState.NEVER_FINISHED, + } return states.get(state, None) @@ -151,8 +152,9 @@ def convert_execution_direction(direction): Returns: ExecutionDirection: Enum if given str is valid, None otherwise. """ - directions = dict() - directions["FORWARD"] = ExecutionDirection.FORWARD - directions["BACKWARD"] = ExecutionDirection.BACKWARD - directions["NONE"] = ExecutionDirection.NONE + directions = { + "FORWARD": ExecutionDirection.FORWARD, + "BACKWARD": ExecutionDirection.BACKWARD, + "NONE": ExecutionDirection.NONE, + } return directions.get(direction, None) diff --git a/spine_engine/spine_engine.py b/spine_engine/spine_engine.py index f70a32a..1390cea 100644 --- a/spine_engine/spine_engine.py +++ b/spine_engine/spine_engine.py @@ -358,7 +358,7 @@ def _stop_item(self, item): "exec_finished", { "item_name": item.name, - "direction": str(ED.FORWARD), + "direction": ED.FORWARD, "state": str(self._state), "item_state": ItemExecutionFinishState.STOPPED, },