added delete all

This commit is contained in:
Manuel Hude
2020-12-06 16:14:51 +01:00
parent 7eb728968a
commit 325f083448
4 changed files with 50 additions and 1 deletions
+27
View File
@@ -126,6 +126,23 @@ else:
# main input loop
command = "dummy"
def delete_all_image():
print("Deleting all images")
baseurl = "http://127.0.0.1:8000"
get_url = "/image/delete/all"
try:
response = requests.delete(baseurl + get_url)
payload = response.json()
print(payload)
except os.error:
print("Error deleting request")
return True
while (command.lower() not in ["exit", "quit", "end"]):
try:
@@ -261,6 +278,16 @@ while (command.lower() not in ["exit", "quit", "end"]):
delete_image(filename[:-4])
index = index + 1
if command.lower() == "deleteall":
if metadata is None:
print("No metadata loaded")
continue
if image_folder is None:
print("No image folder selected")
continue
delete_all_image()
index = index + 1
if command.lower() == "rapid":
if metadata is None:
print("No metadata loaded")