2bit/test/run.py

27 lines
811 B
Python
Raw Normal View History

2016-07-08 20:57:10 +02:00
import glob, subprocess, os
try:
import shutil
shutil.rmtree("out")
except:
pass
files = glob.glob("*")
del files[files.index("run.py")]
if not os.path.isdir("out"): os.mkdir("out")
i = 0
max_i = len(files) * (8+8)
2016-07-08 20:57:10 +02:00
for f in files:
if (os.path.isdir(f)): continue
for bits in range(8+8):
2016-07-08 20:57:10 +02:00
bits += 1
percolor = []
pc = ""
if bits > 8:
percolor = ["--per-color"]
pc = "-per-color"
2016-07-08 20:57:10 +02:00
print(str(int(float(1000*i)/max_i)/10) + "% done")
bits_formatted = str((bits-1)%8+1)
outfilename = "out/" + ".".join(f.split(".")[:-1]) + "-output" + pc + "-" + bits_formatted + "bits.png"
2016-07-08 20:57:10 +02:00
print("On " + outfilename)
subprocess.call(["python3", "../2bit.py", f, outfilename, bits_formatted, *percolor])
2016-07-08 20:57:10 +02:00
i += 1