Skip to content
Snippets Groups Projects
Commit 760b59a4 authored by Henrik tom Wörden's avatar Henrik tom Wörden Committed by Henrik tom Wörden
Browse files

ENH: allow setting of prop

parent 6ef0d68f
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,17 @@ class AbstractCFood(object):
for n in names:
entity.add_parent(get_entity(n))
@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):
......@@ -97,7 +108,6 @@ class AbstractCFood(object):
return r
def get_parser():
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=RawTextHelpFormatter)
......
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