def check_for_updates(frame, force=False): if (frame.upd_thread is not None): frame.upd_thread.exit_now = True frame.upd_thread.join() frame.upd_thread = UpdateThread(frame, force) frame.upd_thread.start()
def main_loop (self): self.header = HeaderWidget() foot = help_bar() self.listbox = self.select_current_timeline().timeline self.main_frame = urwid.Frame(urwid.AttrWrap(self.listbox, 'body'), header=self.header, footer=foot) key_handle = Keys() urwid.connect_signal(key_handle, 'help_done', self.help_done) self.loop = urwid.MainLoop(self.main_frame, palette, unhandled_input=key_handle.keystroke) update = UpdateThread() update.start() self.loop.run() update._Thread__stop() update.stop()