""" report_mod.py Copyright 2015 Adam Greig Licensed under the MIT licence, see LICENSE file for details. Generate a report of all available footprints. """ from __future__ import print_function, division import sys import os import glob import moddraw def main(prettypath, outpath): imgpath = os.path.join(outpath, "img") os.makedirs(imgpath, exist_ok=True) mods = [] for f in glob.glob(os.path.join(prettypath, "*.kicad_mod")): modname = os.path.splitext(os.path.basename(f))[0] print("Processing", modname) moddraw.main(f, os.path.join(imgpath, modname + ".png")) mods.append(modname) with open(os.path.join(outpath, "index.html"), "w") as f: f.write("\n") f.write("
".format(mod))
f.write("![]() | {} |