mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Minor fix. See #1475.
This commit is contained in:
@@ -118,8 +118,6 @@ class entity_instance(object):
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
index = self.wrapped_data.get_argument_index(key)
|
||||
if self.wrapped_data.file.transaction:
|
||||
self.wrapped_data.file.transaction.store_edit(self, index, value)
|
||||
self[index] = value
|
||||
|
||||
def __getitem__(self, key):
|
||||
@@ -128,6 +126,9 @@ class entity_instance(object):
|
||||
return entity_instance.wrap_value(self.wrapped_data.get_argument(key), self.wrapped_data.file)
|
||||
|
||||
def __setitem__(self, idx, value):
|
||||
if self.wrapped_data.file.transaction:
|
||||
self.wrapped_data.file.transaction.store_edit(self, idx, value)
|
||||
|
||||
attr_type = real_attr_type = self.attribute_type(idx).title().replace(" ", "")
|
||||
real_attr_type = real_attr_type.replace("Derived", "None")
|
||||
attr_type = attr_type.replace("Binary", "String")
|
||||
|
||||
@@ -93,9 +93,6 @@ 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)
|
||||
# TODO: make this unnecessary
|
||||
if element.wrapped_data.file.transaction:
|
||||
element.wrapped_data.file.transaction.store_edit(element, i, new_attribute)
|
||||
element[i] = new_attribute
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user