From 59943f1d4d9768a56d21657ec6a1238e62753a53 Mon Sep 17 00:00:00 2001 From: Vadym Melnychuk Date: Mon, 24 Jul 2023 18:02:00 +0300 Subject: [PATCH] clean code style --- pyhon/appliance.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pyhon/appliance.py b/pyhon/appliance.py index 0d0064e..ef73cd0 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -281,8 +281,7 @@ class HonAppliance: 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: @@ -294,13 +293,11 @@ class HonAppliance: 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: + if to_sync and ( + (isinstance(to_sync, list) and name not in to_sync) + or not target_param.mandatory + ): continue - - if target_parameters and name not in target_parameters: - continue - self.sync_parameter(base_param, target_param) def sync_parameter(self, main: Parameter, target: Parameter) -> None: