Process all initial tags in one call

This commit is contained in:
Joel Collins 2019-02-18 11:30:38 +00:00
parent 340b3dda89
commit 05f52bbdeb
2 changed files with 8 additions and 8 deletions

View file

@ -128,9 +128,7 @@ class ListAPI(MicroscopeView):
bayer=bayer)
output.put_metadata(metadata)
for tag in tags:
output.put_tag(str(tag))
output.put_tags(tags)
return jsonify(output.state)

View file

@ -264,16 +264,18 @@ class CaptureObject(object):
return False
# HANDLE TAGS
def put_tag(self, tag: str):
def put_tags(self, tags: list):
"""
Add a new tag to the ``tags`` list attribute.
Args:
tag (str): Tag to be added
tag (list): List of tags to be added
"""
if not tag in self.tags:
self.tags.append(tag)
self.save_metadata()
for tag in tags:
if not tag in self.tags:
self.tags.append(tag)
self.save_metadata()
def delete_tag(self, tag: str):
"""