Sanitizing of object names & not filtering potentially important dirs

This commit is contained in:
Robert MacGregor 2015-11-30 23:17:51 -05:00
parent 05181fadd7
commit 3151105f93

View file

@ -2,7 +2,7 @@ import os
import sys
class Application(object):
ignored_directories = ["textures", "commander", "gui", "details", "special"]
ignored_directories = ["textures", "commander", "gui"]
material_template = """
singleton Material({name})
@ -33,9 +33,11 @@ singleton Material({name})
if (path == "."):
for exclusion in self.ignored_directories:
try:
directories.remove("exclusion")
directories.remove(exclusion)
except ValueError: pass
continue
for file in files:
if (os.path.isfile(file) is not True):
continue
@ -44,6 +46,7 @@ singleton Material({name})
material_name = os.path.basename(full_path)
material_name = os.path.splitext(material_name)[0].upper()
material_name = material_name.replace(".", "")
material = { "name": material_name, "path": full_path, "opening": "{", "closing": "}" }
materials.append(material)