Closed nicholas-hartley closed 2 years ago
Thanks! Indeed the same issue can be seen just by:
from vsdx import VisioFile
with VisioFile('issue32.vsdx') as vis:
page = vis.get_page(0)
shape = page.find_shape_by_text('Start2')
shape2 = page.find_shape_by_text('Start2')
print(shape2 == shape)
The issue is simply that the find_*
methods re-create the list of Shapes internally. As you said, overriding ==
resolves this anomaly.
Hey,
I was playing around with this library (very nice) and I noticed that when I found an object with find_by_text and find_by_data_label they did not show as being equal. I have a million guesses as to why, but figured I would point it out in case if y'all thought it would be a good idea to overwrite the
==
assignment operator.Code that showed the result shown below, I had a single object with 'Start2' as the text on it an a data property with label: 'One', Name: 'Two', Value: 'Three'