From ceaae6521ee7b4f20e1b7911bd4f761e094b7f5d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 10 Jun 2021 22:17:53 +0100 Subject: [PATCH] dont make image if no svgwrite module --- src/spec/ifaceprint.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/spec/ifaceprint.py b/src/spec/ifaceprint.py index 4a4104f..657d962 100644 --- a/src/spec/ifaceprint.py +++ b/src/spec/ifaceprint.py @@ -2,7 +2,6 @@ from copy import deepcopy from collections import OrderedDict -import svgwrite from math import pi @@ -10,6 +9,12 @@ def create_sv(fname, pins): """unsophisticated drawer of an SVG """ + try: + import svgwrite + except ImportError: + print ("WARNING, no SVG image, not producing image %s" % fname) + return + scale = 15 width = len(pins['pads.north']) * scale height = len(pins['pads.east']) * scale -- 2.30.2