Skip to content

Commit

Permalink
feat: FileSysCollection.with_relative_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Oct 31, 2023
1 parent e3acfa9 commit 47182ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dol/filesys.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ def is_valid_key(self, k):
return bool(self._key_pattern.match(k))

def validate_key(
self, k, err_msg_format=_dflt_not_valid_error_msg, err_type=KeyValidationError,
self,
k,
err_msg_format=_dflt_not_valid_error_msg,
err_type=KeyValidationError,
):
if not self.is_valid_key(k):
raise err_type(err_msg_format.format(k))
Expand All @@ -234,6 +237,10 @@ def __repr__(self):
)
return f'{type(self).__name__}({input_str})'

def with_relative_paths(self):
"""Return a copy of self with relative paths"""
return with_relative_paths(self)


class DirCollection(FileSysCollection):
def __iter__(self):
Expand Down

0 comments on commit 47182ee

Please sign in to comment.