projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1389214
)
Avoid directory writes when files are already there.
author
Scott Gasch
<scott@gasch.org>
Sat, 24 Apr 2021 00:15:28 +0000
(17:15 -0700)
committer
Scott Gasch
<scott@gasch.org>
Sat, 24 Apr 2021 00:15:28 +0000
(17:15 -0700)
directory_filter.py
patch
|
blob
|
history
diff --git
a/directory_filter.py
b/directory_filter.py
index 9fa13c2c1169c9895af5de7c4494627cd972d735..8bced6008cfe6a24e410063a92212e77996c2b10 100644
(file)
--- a/
directory_filter.py
+++ b/
directory_filter.py
@@
-4,11
+4,10
@@
import hashlib
import os
from typing import Any, Optional
-import predicate
import file_utils
-class DirectoryFileFilter(
predicate.Predicate
):
+class DirectoryFileFilter(
object
):
"""A predicate that will return False if when a proposed file's
content to-be-written is identical to the contents of the file;
skip the write.
@@
-75,4
+74,3
@@
class DirectoryAllFilesFilter(DirectoryFileFilter):
mem_hash.update(item)
md5 = mem_hash.hexdigest()
return md5 not in self.all_md5s
-