Skip to content

Commit

Permalink
remember file path
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Oct 9, 2024
1 parent 31744b5 commit 29f022c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yacman/yacman_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,13 @@ def from_yaml_file(cls, filepath: str, create_file: bool = False, **kwargs):
entries = yaml.load(file_contents, yaml.SafeLoader)
ref = cls(entries, **kwargs)
ref.locker = ThreeLocker(filepath)
ref.filepath = filepath
return ref

def update_from_yaml_file(self, filepath=None):
if filepath is not None: # set filepath to update filepath if uninitialized
if self.filepath is not None:
self.filepath = filepath
self.data.update(load_yaml(filepath))
return

Expand Down

0 comments on commit 29f022c

Please sign in to comment.