def start_version_screen(self, data, table): """"Turn on and populate table 'versions' in screen with data""" pages = True term.hide_cursor() self.turn_on_table(table) self.data = data if not pages: self.draw('app_versions') term.reset_terminal() else: # Timeout at 19 minutes of inactivity since API's NextToken disappears at 20 self.idle_time = datetime.now() timediff = timedelta(minutes=19) while (datetime.now() - self.idle_time) < timediff: try: self.draw('app_versions') term.reset_terminal() should_exit = self.handle_input() if should_exit: return except IOError as e: if e.errno == errno.EINTR: # Sometimes thrown while sleeping continue else: raise
def start_screen(self, poller, env_data, refresh, mono=False, default_table='split'): self.mono = mono self.env_data = env_data self.refresh = refresh term.hide_cursor() self.turn_on_table(default_table) # Timeout at 2 hours of inactivity self.idle_time = datetime.now() timediff = timedelta(hours=2) while (datetime.now() - self.idle_time) < timediff: try: self.get_data(poller) if not self.data: return self.draw('instances') term.reset_terminal() if not refresh: return should_exit = self.handle_input() if should_exit: return except IOError as e: if e.errno == errno.EINTR: # Sometimes thrown while sleeping continue else: raise
def start_version_screen(self, data, table): """"Turn on and populate table 'environments' in screen with data""" pages = True term.hide_cursor() self.turn_on_table(table) self.data = data if not pages: self.draw(TABLE_DATA_KEY) term.reset_terminal() else: # Timeout at 19 minutes of inactivity since API's NextToken disappears at 20 self.idle_time = datetime.now() timediff = timedelta(minutes=19) while (datetime.now() - self.idle_time) < timediff: try: self.draw(TABLE_DATA_KEY) term.reset_terminal() should_exit = self.handle_input() if should_exit: return except IOError as e: if e.errno == errno.EINTR: # Sometimes thrown while sleeping continue else: raise