I would like to combine odm features with other features so I build a GUI with tkinter python. How can I get the progress value of each process? thank you
You have one example in WebODM :
while True:
time.sleep(3)
res = requests.get('http://localhost:8000/api/projects/{}/tasks/{}/'.format(project_id, task_id),
headers={'Authorization': 'JWT {}'.format(token)}).json()
if res['status'] == status_codes.COMPLETED:
print("Task has completed!")
break
elif res['status'] == status_codes.FAILED:
print("Task failed: {}".format(res))
print("Cleaning up...")
requests.delete("http://localhost:8000/api/projects/{}/".format(project_id),
headers={'Authorization': 'JWT {}'.format(token)})
sys.exit(1)
else:
seconds = res['processing_time'] / 1000
if seconds < 0:
seconds = 0
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
This file has been truncated. show original
You could adapt it to PyODM
1 Like