added delete all
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user