Make wmltools Forest avoid version control subdirectories (#6236)
This also makes wmltools Forest avoid .DS_Store and Thumbs.db files.
This commit is contained in:
parent
ee233cead6
commit
cc608a1cd2
1 changed files with 9 additions and 7 deletions
|
@ -14,6 +14,7 @@ map_extensions = ("map", "mask")
|
|||
image_extensions = ("png", "jpg", "jpeg")
|
||||
sound_extensions = ("ogg", "wav")
|
||||
vc_directories = (".git", ".svn")
|
||||
misc_files_extensions = ("-bak", ".DS_Store", "Thumbs.db") # These files and extensions should be included in the `default_blacklist` in filesystem.hpp.
|
||||
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)(?=(~.*)?)"
|
||||
|
@ -224,15 +225,16 @@ class Forest:
|
|||
rest = [elem for elem in subtree if not elem.endswith("_main.cfg")]
|
||||
subtree = sorted(maincfgs) + sorted(rest)
|
||||
self.forest.append(subtree)
|
||||
for i in self.forest:
|
||||
# Ignore version-control subdirectories and Emacs tempfiles
|
||||
for i in range(len(self.forest)):
|
||||
# Ignore version-control subdirectories, Emacs tempfiles, and other files and extensions
|
||||
for dirkind in vc_directories + l10n_directories:
|
||||
i = [x for x in i if dirkind not in x]
|
||||
i = [x for x in i if '.#' not in x]
|
||||
i = [x for x in i if not os.path.isdir(x)]
|
||||
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:
|
||||
i = [x for x in i if not re.search(exclude, x)]
|
||||
i = [x for x in i if not x.endswith("-bak")]
|
||||
self.forest[i] = [x for x in self.forest[i] if not re.search(exclude, x)]
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue