
EXCEPTIONS = ['arrow.png', 'cat.png', 'failed.png', 'logo.png', 'passed.png', 'sprites.png', 'sprites0.png',
              '01w.png','01l.png', '02w.png', '02l.png', '03w.png','03l.png', '04w.png', '04l.png', '05w.png','05l.png', '06w.png', '06l.png', '07w.png', '07l.png', ]

JSON = '{{"frames":{{"{0}":{{"frame":{{"x":0,"y":0,"w":16,"h":16}},"rotated":false,"trimmed":false,"spriteSourceSize":{{"x":0,"y":0,"w":16,"h":16}},"sourceSize":{{"w":16,"h":16}}}}}},"meta":{{"image":"{0}.png","size":{{"w":16,"h":16}},"scale":1}} }}'

import os
import glob

fnames = [fname for fname in glob.glob('*.png') if fname not in EXCEPTIONS]

for fname in fnames:
    name = fname[:-4]
    with open(name+'.json', 'w') as outputf:
      outputf.write(JSON.format(name))
    

