fix issue with plural names in include_dict

preserve-order
Andrew Port 2022-02-03 18:59:37 -08:00
parent 35f3acc9fd
commit e30481de90
1 changed files with 5 additions and 4 deletions

View File

@ -171,14 +171,15 @@ def svg2paths(
# from IPython import embed; embed() ### DEBUG # from IPython import embed; embed() ### DEBUG
return d return d
included_elements = { include_dict = {
'circles': convert_circles_to_paths, 'circle': convert_circles_to_paths,
'ellipses': convert_ellipses_to_paths, 'ellipse': convert_ellipses_to_paths,
'lines': convert_lines_to_paths, 'line': convert_lines_to_paths,
'polyline': convert_polylines_to_paths, 'polyline': convert_polylines_to_paths,
'polygon': convert_polygons_to_paths, 'polygon': convert_polygons_to_paths,
'rect': convert_rectangles_to_paths, 'rect': convert_rectangles_to_paths,
} }
included_elements = set(name for name, is_included in include_dict.items() if is_included)
attribute_dictionaries = [ attribute_dictionaries = [
(node.localName, dom2dict(node)) for node in doc.documentElement.childNodes (node.localName, dom2dict(node)) for node in doc.documentElement.childNodes