diff --git a/src/caosadvancedtools/cfood.py b/src/caosadvancedtools/cfood.py index c0998927acc3e9aeee95980b09be7701823162b4..892abc49f168d24b6abbf7933176c88bb023382a 100644 --- a/src/caosadvancedtools/cfood.py +++ b/src/caosadvancedtools/cfood.py @@ -77,21 +77,11 @@ class AbstractCFood(object): @staticmethod # move to api? def set_property(entity, prop, value): - if entity.get_property(prop) is None: - entity.add_property(prop, value) - else: - if entity.get_property(prop).value == value: - return - else: - entity.get_property(prop).value = value - - @staticmethod - # move to api? - def set_property(entity, name, value): - if entity.get_property(name) is not None: - entity.remove_property(name) + # TODO only do something when it is necessary? - entity.add_property(get_entity(name), value=value) + while entity.get_property(prop) is not None: + entity.remove_property(prop) + entity.add_property(prop, value) @staticmethod def find_existing(entity):