Forum

Author Topic: Progress updates network jobs  (Read 199 times)

danielno

  • Newbie
  • *
  • Posts: 1
    • View Profile
Progress updates network jobs
« on: October 17, 2018, 04:20:01 PM »
I'm trying to show progress indication while running slow and unresponsive network jobs using client.batchList(batch_id).

I'm new to python but can dump the dict.items() (items_total, workitems_waiting, workitems_working, items_done, time_left, progress) - there must be an easier way to use this information in real time in a python loop as below?

   log ("Match & Align starting: " + stat['status'])
   while(stat['status'] == "inprogress" or stat['status'] == "working"):
      melapsed = round(time.time() - mainstarttime)
      pelapsed = round(time.time() - procstarttime)
      batch = client.batchList(batch_id)
      tell=len(batch)-1
      log ("Match & Align ("  + str(pelapsed) + " sec  / " + str(melapsed) + " sec)")
      PhotoScan.app.update()
      time.sleep(60)
      stat = client.batchStatus(batch_id)

This is not working for me:

batch = client.batchList()[0]
print(batch["task"]["progress"])

http://www.agisoft.com/forum/index.php?topic=5519.msg27057#msg27057