Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lightflow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ def dag_polling_time(self):

def set_to_default(self):
""" Overwrite the configuration with the default configuration. """
self._config = yaml.safe_load(self.default())
# yaml = YAML(type='safe', pure=True)
y = yaml.YAML(typ='safe', pure=True)
# yaml.default_flow_style = False
# yaml.indent(mapping=2, sequence=4, offset=2)
# yaml.preserve_quotes = True
self._config = y.load(self.default())

def _update_from_file(self, filename):
""" Helper method to update an existing configuration with the values from a file.
Expand All @@ -178,7 +183,8 @@ def _update_from_file(self, filename):
if os.path.exists(filename):
try:
with open(filename, 'r') as config_file:
yaml_dict = yaml.safe_load(config_file.read())
y = yaml.YAML(typ='safe', pure=True)
yaml_dict = y.load(config_file.read())
if yaml_dict is not None:
self._update_dict(self._config, yaml_dict)
except IsADirectoryError:
Expand Down