From f7b050c04cb8b2592d2ea7af27c295bb7a9b6312 Mon Sep 17 00:00:00 2001 From: Drew Heles Date: Tue, 9 Jul 2019 18:57:28 -0400 Subject: [PATCH] Adjust helper.py to better parse illustrator-generated svg files (#1465) Fixes #1464 --- helper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper.py b/helper.py index 686ad2ac..6c95cfc5 100755 --- a/helper.py +++ b/helper.py @@ -259,6 +259,8 @@ def panel_to_components(tree): # Get components layer root = tree.getroot() groups = root.findall(".//svg:g[@inkscape:label='components']", ns) + if len(groups) < 1: + groups = root.findall(".//svg:g[@id='components']", ns) if len(groups) < 1: raise UserException("Could not find \"components\" layer on panel") @@ -286,7 +288,7 @@ def panel_to_components(tree): # Get color style = el.get('style') color_match = re.search(r'fill:\S*#(.{6});', style) - color = color_match.group(1) + color = color_match.group(1).lower() c['color'] = color # Get position