fix issue with path2pathd not working for minidom elements

preserve-order
Andrew Port 2022-02-03 18:50:48 -08:00
parent 822c0e8635
commit 35f3acc9fd
1 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,7 @@ COORD_PAIR_TMPLT = re.compile(
def path2pathd(path): def path2pathd(path):
return path['d'] return path.get('d')
def ellipse2pathd(ellipse): def ellipse2pathd(ellipse):
@ -167,7 +167,8 @@ def svg2paths(
keys = list(element.attributes.keys()) keys = list(element.attributes.keys())
values = [val.value for val in list(element.attributes.values())] values = [val.value for val in list(element.attributes.values())]
d = dict(list(zip(keys, values))) d = dict(list(zip(keys, values)))
assert dict(element.attributes) == d # if not dict((k, v) for k, v in element.attributes.items()) == d:
# from IPython import embed; embed() ### DEBUG
return d return d
included_elements = { included_elements = {