From d3114ba9251eb02ff6a6167f5a600c2a86de7e2f Mon Sep 17 00:00:00 2001 From: Pau Andrio Date: Wed, 18 Sep 2024 11:23:12 +0200 Subject: [PATCH] [FIX] (settings)(biobb_object) Get back get_working_dir_path() for retrocompatibility --- biobb_common/configuration/settings.py | 10 +++++++++- biobb_common/generic/biobb_object.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/biobb_common/configuration/settings.py b/biobb_common/configuration/settings.py index b41430b..4e1a5b1 100644 --- a/biobb_common/configuration/settings.py +++ b/biobb_common/configuration/settings.py @@ -52,11 +52,19 @@ class ConfReader: system (str): System name from the systems section in the configuration file. """ - def __init__(self, config: Optional[str] = None, **kwargs): + def __init__(self, config: Optional[str] = None, *args, **kwargs): self.properties = self._read_config(config) self.global_properties = self._get_global_properties() self.working_dir_path = fu.get_working_dir_path(working_dir_path=self.global_properties.get("working_dir_path", None), restart=self.global_properties.get("restart", False)) + def get_working_dir_path(self) -> str: + """get_working_dir_path() returns the working directory path. + + Returns: + str: Working directory path. + """ + return self.working_dir_path + def _read_config(self, config: Optional[str] = None) -> Dict[str, Any]: """_read_config() reads the configuration file and returns a dictionary. """ diff --git a/biobb_common/generic/biobb_object.py b/biobb_common/generic/biobb_object.py index 3791955..376c263 100644 --- a/biobb_common/generic/biobb_object.py +++ b/biobb_common/generic/biobb_object.py @@ -146,7 +146,7 @@ def check_properties( ): if not reserved_properties: reserved_properties = set() - reserved_properties = {"system", "working_dir_path"}.union(reserved_properties) + reserved_properties = {"system", "working_dir_path", "tool"}.union(reserved_properties) reserved_properties = reserved_properties.union(set(self.global_properties_list)) error_properties = set([prop for prop in properties.keys() if prop not in self.__dict__.keys()])