Skip to content

Commit

Permalink
rename Filter arg match -> match_patterns to reflect Dirhash Standard
Browse files Browse the repository at this point in the history
  • Loading branch information
andhus committed Apr 20, 2020
1 parent 1f2643b commit aa4cd7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/dirhash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def dirhash(
description of how the returned hash value is computed.
"""
filter_ = Filter(
match=get_match_patterns(match=match, ignore=ignore),
match_patterns=get_match_patterns(match=match, ignore=ignore),
linked_dirs=linked_dirs,
linked_files=linked_files,
empty_dirs=empty_dirs
Expand Down Expand Up @@ -320,7 +320,7 @@ def included_paths(
the hash of the `directory` using `dirhash.dirhash` and the same arguments.
"""
filter_ = Filter(
match=get_match_patterns(match=match, ignore=ignore),
match_patterns=get_match_patterns(match=match, ignore=ignore),
linked_dirs=linked_dirs,
linked_files=linked_files,
empty_dirs=empty_dirs
Expand Down Expand Up @@ -365,15 +365,15 @@ class Filter(RecursionFilter):
"""
def __init__(
self,
match=None,
match_patterns=None,
linked_dirs=True,
linked_files=True,
empty_dirs=False
):
super(Filter, self).__init__(
linked_dirs=linked_dirs,
linked_files=linked_files,
match=match
match=match_patterns
)
self.empty_dirs = empty_dirs

Expand Down
6 changes: 5 additions & 1 deletion tests/test_dirhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
dirhash,
algorithms_available,
algorithms_guaranteed,
Protocol, _parmap, Filter, dirhash_impl)
Protocol,
_parmap,
Filter,
dirhash_impl
)
from scantree import SymlinkRecursionError


Expand Down

0 comments on commit aa4cd7f

Please sign in to comment.