def start_stage(self): self.log('debug', 'Step stage, starting stage') self.clear() for child in self.stages[:]: child.clear() self.apply_restore_properties() self.start_time = time.clock() max_duration = self.max_duration if not self.paused and max_duration > 0.: Clock.schedule_once_free( self._do_stage_timeout, max_duration) self.started = True self.dispatch('on_stage_start') return True
def unpause(self, recurse=True): paused = self.paused self.paused = False if self.disabled or not self.started or self.finished or not paused: self.log('debug', 'Un-pausing ignored') return False self.log('debug', 'Unpausing recurse={}', recurse) self.start_time = time.clock() if self.max_duration > 0.: Clock.schedule_once_free(self._do_stage_timeout, max(0., self.max_duration - self.elapsed_time)) if recurse: for child in self.pause_list: try: if child.paused: child.unpause(True) except ReferenceError: pass self.pause_list = [] return True
def ask_step_stage(self, source=None, **kwargs): return Clock.schedule_once_free( partial(_ask_step_stage, self, source=source, **kwargs), -1)