Skip to content

Commit

Permalink
refactor(commands): change the signature of _to_single_command
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Apr 8, 2024
1 parent eccf738 commit 4a9c0e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions antarest/study/storage/variantstudy/command_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(
patch_service=patch_service,
)

def _to_single_command(self, command_id: t.Optional[str], action: str, args: JSON, version: int) -> ICommand:
def _to_single_command(self, action: str, args: JSON, version: int, command_id: t.Optional[str]) -> ICommand:
"""Convert a single CommandDTO to ICommand."""
if action in COMMAND_MAPPING:
command_class = COMMAND_MAPPING[action]
Expand All @@ -101,10 +101,10 @@ def to_command(self, command_dto: CommandDTO) -> t.List[ICommand]:
"""
args = command_dto.args
if isinstance(args, dict):
return [self._to_single_command(command_dto.id, command_dto.action, args, command_dto.version)]
return [self._to_single_command(command_dto.action, args, command_dto.version, command_dto.id)]
elif isinstance(args, list):
return [
self._to_single_command(command_dto.id, command_dto.action, argument, command_dto.version)
self._to_single_command(command_dto.action, argument, command_dto.version, command_dto.id)
for argument in args
]
raise NotImplementedError()
Expand Down

0 comments on commit 4a9c0e2

Please sign in to comment.