Skip to content

Commit

Permalink
[FIX] (settings)(biobb_object) Get back get_working_dir_path() for re…
Browse files Browse the repository at this point in the history
…trocompatibility
  • Loading branch information
PauAndrio committed Sep 18, 2024
1 parent d3013d7 commit d3114ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion biobb_common/configuration/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion biobb_common/generic/biobb_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()])

Expand Down

0 comments on commit d3114ba

Please sign in to comment.