diff --git a/scripts/gen-attribution.py b/scripts/gen-attribution.py new file mode 100644 index 00000000..e946afd4 --- /dev/null +++ b/scripts/gen-attribution.py @@ -0,0 +1,15 @@ +import os +import sys + +TEMPLATE = """{{ name: "{0}", source: "{1}", nsfw: "false" }},\n""" + +if len(sys.argv) < 1: + print("Usage: {0} [dir]".format(sys.argv[0])) + sys.exit(64) + +result = "" + +for file in os.listdir(sys.argv[1]): + result += TEMPLATE.format(file, sys.argv[2]) + +print(result) \ No newline at end of file diff --git a/scripts/gen-views.py b/scripts/gen-views.py new file mode 100644 index 00000000..7c7382d1 --- /dev/null +++ b/scripts/gen-views.py @@ -0,0 +1,27 @@ +import os +import sys + +TEMPLATE = """ {0}: {{ + height: math.unit(6, "feet"), + weight: math.unit(150, "lb"), + name: "{1}", + image: {{ + source: "./media/characters/{2}/{3}" + }} + }}, +""" + +if len(sys.argv) < 1: + print("Usage: {0} [dir]".format(sys.argv[0])) + sys.exit(64) + +result = "" + +for file in os.listdir(sys.argv[1]): + name = " ".join(map(lambda x: x.capitalize(), file[:-4].split("-"))) + key = "".join(map(lambda x: x.capitalize(), file[:-4].split("-"))) + key = key[0].lower() + key[1:] + + result += TEMPLATE.format(key, name, sys.argv[1].split("\\")[-1], file) + +print(result) \ No newline at end of file