-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify atomic_contents_add to accept a filter function #71
Conversation
securetar/__init__.py
Outdated
@@ -385,7 +385,7 @@ def _is_excluded_by_filter(path: PurePath, exclude_list: list[str]) -> bool: | |||
"""Filter to filter excludes.""" | |||
|
|||
for exclude in exclude_list: | |||
if not path.match(exclude): | |||
if not path.full_match(exclude): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That not work as we work with PurePath (without any blocking stats). That is the nice thing on that function to keep it fast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the full_match
method with improved glob support was added in Python 3.13: https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.full_match
98cc471
to
6db9200
Compare
Co-authored-by: Stefan Agner <[email protected]>
Modify
atomic_contents_add
to accept a filter function, for improved flexibilityThe filter function is called once for each item, including the item passed to
atomic_contents_add
.