Added routes to download metadata yaml files

This commit is contained in:
Joel Collins 2019-01-18 15:27:11 +00:00
parent 63ffc0057a
commit 533f5d9857
3 changed files with 84 additions and 4 deletions

View file

@ -146,6 +146,7 @@ class CaptureObject(object):
"""Takes a full file path, and splits it into separated class properties."""
self.filefolder, self.filename = os.path.split(filepath) # Split the full file path into a folder and a filename
self.basename = os.path.splitext(self.filename)[0] # Split the filename out from it's file extension
self.metadataname = "{}.yaml".format(self.basename)
def lock(self):
"""Set locked flag to True."""
@ -208,6 +209,10 @@ class CaptureObject(object):
return d
@property
def yaml(self) -> str:
return yaml.dump(self.metadata, default_flow_style=False)
@property
def exists(self) -> bool:
return self.stream_exists or self.file_exists