Skip to content

Commit

Permalink
blacklist image source files like xcf and other formats, fix #1
Browse files Browse the repository at this point in the history
fix #1
obsolete #3
  • Loading branch information
illwieckz committed Aug 19, 2019
1 parent 79be17f commit 070394f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sloth.py
Expand Up @@ -49,6 +49,14 @@ class ShaderGenerator(dict):
# basename of the per-set option file # basename of the per-set option file
defaultSlothFile = "options"+slothFileExt defaultSlothFile = "options"+slothFileExt


# common file extensions for image source
extBlackList = \
[
".ora",
".psd",
".xcf",
]



def __init__(self, verbosity = 0): def __init__(self, verbosity = 0):
self.verbosity = verbosity self.verbosity = verbosity
Expand Down Expand Up @@ -563,6 +571,11 @@ def generateSet(self, path, setname = None, cutextension = None):
for filename in filelist: for filename in filelist:
mapname, ext = os.path.splitext(filename) mapname, ext = os.path.splitext(filename)


# check if this file extension is not among known unsupported ones
if ext.lower() in self.extBlackList:
self.verbose(filename + ": Unsupported format")
continue

if ext == self.slothFileExt: if ext == self.slothFileExt:
slothfiles.add(mapname) slothfiles.add(mapname)
else: else:
Expand Down

0 comments on commit 070394f

Please sign in to comment.