From eed3cc82466b8b5cfa92eed4ad64474568ad69ad Mon Sep 17 00:00:00 2001 From: Brandon Stafford Date: Fri, 4 Aug 2023 14:16:10 -0400 Subject: [PATCH] Accept px as units --- parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.py b/parser.py index dcd9167..82dbfb3 100644 --- a/parser.py +++ b/parser.py @@ -1028,12 +1028,16 @@ def parse(fzpz, circuitpydef, pinoutcsv, arduinovariantfolder, substitute): svg_width = 25.4 * float(svg_width[:-2]) * MM_TO_PX elif "mm" in svg_width: svg_width = float(svg_width[:-2]) * MM_TO_PX + elif "px" in svg_width: + svg_width = float(svg_width[:-2]) else: raise RuntimeError("Dont know units of width!", svg_width) if "in" in svg_height: svg_height = 25.4 * float(svg_height[:-2]) * MM_TO_PX elif "mm" in svg_height: svg_height = float(svg_height[:-2]) * MM_TO_PX + elif "px" in svg_height: + svg_height = float(svg_height[:-2]) else: raise RuntimeError("Dont know units of width!", svg_height)