Skip to content
Snippets Groups Projects
Commit 546e8c6d authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH: set prop

parent 345d1671
No related branches found
No related tags found
No related merge requests found
...@@ -77,21 +77,11 @@ class AbstractCFood(object): ...@@ -77,21 +77,11 @@ class AbstractCFood(object):
@staticmethod @staticmethod
# move to api? # move to api?
def set_property(entity, prop, value): def set_property(entity, prop, value):
if entity.get_property(prop) is None: # TODO only do something when it is necessary?
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)
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 @staticmethod
def find_existing(entity): def find_existing(entity):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment