Skip image and binary files in replace_and_rename

This commit is contained in:
Nils Wentzell 2023-09-13 14:52:08 -04:00
parent a5ab612302
commit 057c239461
1 changed files with 6 additions and 0 deletions

View File

@ -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