Skip to content

Commit

Permalink
clean code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadym Melnychuk committed Jul 24, 2023
1 parent bab8bce commit 59943f1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pyhon/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ def sync_command(
self,
main: str,
target: Optional[List[str] | str] = None,
mandatory_only: bool = False,
target_parameters: Optional[List[str]] = None,
to_sync: Optional[List[str] | bool] = None,
) -> None:
base: Optional[HonCommand] = self.commands.get(main)
if not base:
Expand All @@ -294,13 +293,11 @@ def sync_command(
for name, target_param in data.parameters.items():
if not (base_param := base.parameters.get(name)):
continue

if mandatory_only and not target_param.mandatory:
continue

if target_parameters and name not in target_parameters:
if to_sync and (
(isinstance(to_sync, list) and name not in to_sync)
or not target_param.mandatory
):
continue

self.sync_parameter(base_param, target_param)

def sync_parameter(self, main: Parameter, target: Parameter) -> None:
Expand Down

0 comments on commit 59943f1

Please sign in to comment.