def run(self): """Execute the main loop of the thread.""" while not self.quit: now = time() full_mode = ( self.prev_full_update is None or now >= self.prev_full_update + self.interval_full) if (full_mode or self.prev_norm_update is None or now >= self.prev_norm_update + self.interval_part): title = self.window.get_title() if full_mode and self.hosts: active_title = "%s (scanning + updating)" % title elif full_mode: active_title = "%s (listing + updating)" % title else: active_title = "%s (updating)" % title gobject.idle_add(self.window.set_title, active_title) self.suite_info_map = update_suites_info(self, full_mode) self.prev_norm_update = time() if full_mode: self.prev_full_update = self.prev_norm_update gobject.idle_add(self.window.set_title, title) gobject.idle_add(self.update) sleep(1)
def run(self): """Extract running suite information at particular intervals.""" if self.quit: return False now = time.time() if (self._last_running_time is not None and self.IDLE_STOPPED_TIME is not None and now > self._last_running_time + self.IDLE_STOPPED_TIME): self.stop() return True if (not self._should_force_update and self.last_update_time is not None and now < self.last_update_time + self.poll_interval): return True if self._should_force_update: self._should_force_update = False # Get new information. self.suite_info_map = update_suites_info( self.hosts, owner_pattern=self.owner_pattern, prev_results=self.suite_info_map) self.last_update_time = time.time() if self.suite_info_map: self._last_running_time = None else: self._last_running_time = self.last_update_time gobject.idle_add(self.update) return True
def run(self): """Execute the main loop of the thread.""" while not self.quit: time_for_update = ( self.last_update_time is None or time() >= self.last_update_time + self.poll_interval ) if not self._should_force_update and not time_for_update: sleep(1) continue if self._should_force_update: self._should_force_update = False title = self.window.get_title() gobject.idle_add(self.window.set_title, title + " (updating)") self.suite_info_map = update_suites_info(self) self.last_update_time = time() gobject.idle_add(self.window.set_title, title) gobject.idle_add(self.update) sleep(1)
def run(self): """Extract running suite information at particular intervals.""" if self.quit: return False now = time() if (self.prev_norm_update is not None and self.IDLE_STOPPED_TIME is not None and now > self.prev_norm_update + self.IDLE_STOPPED_TIME): self.stop() return True full_mode = (self.prev_full_update is None or now >= self.prev_full_update + self.interval_full) if (full_mode or self.prev_norm_update is None or now >= self.prev_norm_update + self.interval_part): # Get new information. self.suite_info_map = update_suites_info(self, full_mode=True) self.prev_norm_update = time() if full_mode: self.prev_full_update = self.prev_norm_update gobject.idle_add(self.update) return True
def run(self): """Execute the main loop of the thread.""" while not self.quit: time_for_update = ( self.last_update_time is None or time.time() >= self.last_update_time + self.poll_interval ) if not self._should_force_update and not time_for_update: time.sleep(1) continue if self._should_force_update: self._should_force_update = False title = self.window.get_title() gobject.idle_add(self.window.set_title, title + " (updating)") self.suite_info_map = update_suites_info( self.hosts, self.comms_timeout, self.owner_pattern, self.name_pattern, self.suite_info_map) self.last_update_time = time.time() gobject.idle_add(self.window.set_title, title) gobject.idle_add(self.update) time.sleep(1)
def run(self): """Extract running suite information at particular intervals.""" if self.quit: return False now = time() if (self.prev_norm_update is not None and self.IDLE_STOPPED_TIME is not None and now > self.prev_norm_update + self.IDLE_STOPPED_TIME): self.stop() return True full_mode = ( self.prev_full_update is None or now >= self.prev_full_update + self.interval_full) if (full_mode or self.prev_norm_update is None or now >= self.prev_norm_update + self.interval_part): # Get new information. self.suite_info_map = update_suites_info(self, full_mode=True) self.prev_norm_update = time() if full_mode: self.prev_full_update = self.prev_norm_update gobject.idle_add(self.update) return True