Skip to content

Commit

Permalink
Update wmltools3.py
Browse files Browse the repository at this point in the history
  • Loading branch information
max-torch committed Oct 31, 2021
1 parent e2a3a7d commit 05e4de3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions data/tools/wesnoth/wmltools3.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
image_extensions = ("png", "jpg", "jpeg")
sound_extensions = ("ogg", "wav")
vc_directories = (".git", ".svn")
misc_files_extensions = ("-bak", ".DS_Store", "Thumbs.db")
l10n_directories = ("l10n",)
resource_extensions = map_extensions + image_extensions + sound_extensions
image_reference = r"[A-Za-z0-9{}.][A-Za-z0-9_/+{}.\-\[\]~\*,]*\.(png|jpe?g)(?=(~.*)?)"
Expand Down Expand Up @@ -225,15 +226,15 @@ def __init__(self, dirpath, exclude=None):
subtree = sorted(maincfgs) + sorted(rest)
self.forest.append(subtree)
for i in range(len(self.forest)):
# Ignore version-control subdirectories, Emacs tempfiles, and Apple Store files
# Ignore version-control subdirectories, Emacs tempfiles, and other files and extensions
for dirkind in vc_directories + l10n_directories:
self.forest[i] = [x for x in self.forest[i] if dirkind not in x]
self.forest[i] = [x for x in self.forest[i] if '.#' not in x]
self.forest[i] = [x for x in self.forest[i] if not os.path.isdir(x)]
if exclude:
self.forest[i] = [x for x in self.forest[i] if not re.search(exclude, x)]
self.forest[i] = [x for x in self.forest[i] if not x.endswith("-bak")]
self.forest[i] = [x for x in self.forest[i] if not x.endswith(".DS_Store")]
for each in misc_files_extensions:
self.forest[i] = [x for x in self.forest[i] if not x.endswith(each)]
# Compute cliques (will be used later for visibility checks)
self.clique = {}
counter = 0
Expand Down

0 comments on commit 05e4de3

Please sign in to comment.