Closed Kranfield closed 11 months ago
Hello
Here is the correction that I made to the beginning of the DataProperty init method :
def __init__(self, *, xml: Element, shape: Shape):
"""Represents a single Data Property item associated with a Shape object"""
name = xml.attrib.get('N')
# get Cell element for each property of DataProperty
label_cell = xml.find(f'{namespace}Cell[@N="Label"]')
value_cell = xml.find(f'{namespace}Cell[@N="Value"]')
value = value_cell.attrib.get('V') if type(value_cell) is Element else None
if type(value_cell) is Element and value_cell.attrib.get('V') != None:
value = value_cell.attrib.get('V')
elif value_cell.text:
value = value_cell.text
else:
value = None
This correction is working fine for me, maybe you can integrate it ?
Regards, Quentin
Thanks for you for feedback and proposal - looks good and I have integrated your changes 👍
Cheers Dave
Hello Dave,
I noticed that the data_properties method does not return everything in the shape properties. I also found why. Sometimes there is no cell.attrib["V"] but there is a cell.text, like this :
This exception is not taken in account in your code :
The else should be replaced by (in my opinion) :
(or maybe something a bit cleaner)
Regards,
Quentin