def ReportProgress(): """Communicates with the prman process, printing progress""" previous = progress = 0 while progress < 100: prman.RicProcessCallbacks() progress = prman.RicGetProgress() if progress == 100 or progress < previous: break if progress != previous: print "\r%04d - %s%%" % (ReportProgress.counter, progress), previous = progress time.sleep(0.1) print "\r%04d - 100%%" % ReportProgress.counter ReportProgress.counter += 1
def is_prman_running(self): return prman.RicGetProgress() < 100