blackened

This commit is contained in:
Richard 2021-07-19 22:22:58 +01:00
parent 34af06b1d1
commit 7b54abc210
2 changed files with 10 additions and 14 deletions

View file

@ -166,6 +166,7 @@ class ZipBuilderAPIView(ActionView):
class ZipListAPIView(PropertyView): class ZipListAPIView(PropertyView):
"""List all the zip files currently available for download. """List all the zip files currently available for download.
""" """
schema = ZipObjectSchema(many=True) schema = ZipObjectSchema(many=True)
def get(self): def get(self):
@ -175,20 +176,17 @@ class ZipListAPIView(PropertyView):
class ZipGetterAPIView(View): class ZipGetterAPIView(View):
"""Download or delete a particular capture collection ZIP file """Download or delete a particular capture collection ZIP file
""" """
parameters = [ parameters = [
{ {
"name": "session_id", "name": "session_id",
"in": "path", "in": "path",
"description": "The unique ID of the zip builder session", "description": "The unique ID of the zip builder session",
"required": True, "required": True,
"schema": { "type": "string" }, "schema": {"type": "string"},
} }
] ]
responses = { responses = {404: {"description": "The session ID could not be found"}}
404: {
"description": "The session ID could not be found",
}
}
def get(self, session_id): def get(self, session_id):
""" """
@ -205,11 +203,12 @@ class ZipGetterAPIView(View):
as_attachment=True, as_attachment=True,
attachment_filename=f"{session_id}.zip", attachment_filename=f"{session_id}.zip",
) )
get.responses = { get.responses = {
200: { 200: {
"content": {"application/zip": {}}, "content": {"application/zip": {}},
"description": "A zip archive containing the selected captures", "description": "A zip archive containing the selected captures",
}, }
} }
def delete(self, session_id): def delete(self, session_id):
@ -225,8 +224,5 @@ class ZipGetterAPIView(View):
del self.extension.manager.session_zips[session_id] del self.extension.manager.session_zips[session_id]
return {"return": session_id} return {"return": session_id}
delete.responses = {
200: { delete.responses = {200: {"description": "The zip file was deleted"}}
"description": "The zip file was deleted",
},
}

View file

@ -207,7 +207,7 @@ class CaptureDownload(View):
"required": False, "required": False,
"schema": {"type": "string"}, "schema": {"type": "string"},
"example": "myimage.jpeg", "example": "myimage.jpeg",
} },
] ]
def get(self, id_, filename: Optional[str]): def get(self, id_, filename: Optional[str]):