2 def __init__(self, context):
8 self.window_manager = context.window_manager
9 self.window_manager.progress_begin(0.0, 1.0)
11 def push_task(self, task, low, high):
12 self.stack.append((task, low, high-low))
13 self.set_task("init", 0.0, 0.0)
16 self.set_task("finish", 1.0, 1.0)
19 def set_task(self, task, low, high):
21 task = self.stack[-1][0]+": "+task
22 low = self.stack[-1][1]+self.stack[-1][2]*low
23 high = self.stack[-1][1]+self.stack[-1][2]*high
31 def set_progress(self, value):
32 value = self.start+self.delta*value
33 if value>self.last+0.01:
34 self.window_manager.progress_update(value)