don't ouput twice the same name

warning: block should be put before
This commit is contained in:
Hg 2020-10-07 23:57:32 +02:00
parent bf4c157eb0
commit c396dde854

View File

@ -89,6 +89,7 @@ def main():
objects={} objects={}
) )
seen = set()
for svg_file in args.svg_file: for svg_file in args.svg_file:
svg_file = Path(svg_file) svg_file = Path(svg_file)
@ -98,6 +99,10 @@ def main():
shape_path = pshapes.joinpath(f"{svg_file.stem}.shape") shape_path = pshapes.joinpath(f"{svg_file.stem}.shape")
shape_path.write_text(tshape) shape_path.write_text(tshape)
print(f"wrote {shape_path}") print(f"wrote {shape_path}")
if svg_file.stem in seen:
print(f"ignoring duplicate {svg_file.stem}")
continue
seen.add(svg_file.stem)
png_file = f'{pshapes}/{svg_file.stem}.png' png_file = f'{pshapes}/{svg_file.stem}.png'
subprocess.check_call([ subprocess.check_call([