From 057c239461c2e84bc8f3b0bd8d27a324f36194fd Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 13 Sep 2023 14:52:08 -0400 Subject: [PATCH] Skip image and binary files in replace_and_rename --- share/replace_and_rename.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/replace_and_rename.py b/share/replace_and_rename.py index 995d745..a773d19 100755 --- a/share/replace_and_rename.py +++ b/share/replace_and_rename.py @@ -21,12 +21,18 @@ # 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