From: Luke Kenneth Casson Leighton Date: Thu, 10 Jun 2021 21:17:53 +0000 (+0100) Subject: dont make image if no svgwrite module X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ceaae6521ee7b4f20e1b7911bd4f761e094b7f5d;p=pinmux.git dont make image if no svgwrite module --- 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