Add support for connecting/disconnecting paths in API

This commit is contained in:
Dion Moult
2022-09-15 10:31:44 +10:00
parent 8fe9ddd599
commit 171db4b241
5 changed files with 206 additions and 2 deletions
@@ -398,8 +398,7 @@ def get_parts(element):
def replace_attribute(element, old, new):
for i, attribute in enumerate(element):
if has_element_reference(attribute, old):
new_attribute = element.walk(lambda v: v == old, lambda v: new, attribute)
element[i] = new_attribute
element[i] = element.walk(lambda v: v == old, lambda v: new, attribute)
def has_element_reference(value, element):