The change implemented in https://github.com/dave-howard/vsdx/issues/55 added a new bug in my case. In the .csv file, I have a case where the value_cell = None. This raises an error in DataProperty.__init__(...) due to it checking value_cell.text in an if statement.
I suggest adding the following or something similar:
elif value_cell is None:
value = None
So the start of __init__ becomes:
def __init__(self, *, xml: Element, shape: Shape):
"""init a DataProperty from a property xml element in 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 = None
if isinstance(value_cell, Element) and value_cell.attrib.get('V') is not None:
value = value_cell.attrib.get('V') # populate value from V attribute
elif value_cell is None:
value = None
elif value_cell.text:
value = value_cell.text # populate value from element inner text
This might, however introduce new errors I haven't tough of.
Hi Dave,
The change implemented in https://github.com/dave-howard/vsdx/issues/55 added a new bug in my case. In the .csv file, I have a case where the
value_cell = None
. This raises an error inDataProperty.__init__(...)
due to it checkingvalue_cell.text
in an if statement.I suggest adding the following or something similar:
So the start of
__init__
becomes:This might, however introduce new errors I haven't tough of.
Best regards, Johan Christian Jenssen