mirror of
https://github.com/triqs/dft_tools
synced 2025-01-03 01:55:56 +01:00
Skip image and binary files in replace_and_rename
This commit is contained in:
parent
a5ab612302
commit
057c239461
@ -21,12 +21,18 @@ ignore_lst = [".git/", "replace_and_rename.py", "squash_history.sh"]
|
||||
# Find the root directory of app4triqs
|
||||
app4triqs_root = os.path.abspath(os.path.dirname(__file__) + "/..")
|
||||
|
||||
# Blacklisted file-formats
|
||||
fmt_blacklist = ['.png', '.h5', '.jpg', '.ico']
|
||||
|
||||
# Recurse over all subdirectories and files
|
||||
for root, dirs, files in os.walk(app4triqs_root):
|
||||
|
||||
for fname in files:
|
||||
fpath = os.path.join(root, fname)
|
||||
|
||||
if os.path.splitext(fname)[1] in fmt_blacklist:
|
||||
continue
|
||||
|
||||
# Ignore certain files / directories
|
||||
if any(it in fpath for it in ignore_lst): continue
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user