def tick(self):
        self.update_rows()
        self.repaint()

        self.debug_mode = fetch_debug_mode()

        if self.manual_mode_time_left and self.manual_mode_time_left.seconds < 10:
            self.display_change_queue_mode_box(extend_time=True)
    def tick(self):
        self.update_rows()
        self.repaint()

        self.debug_mode = fetch_debug_mode()

        if self.manual_mode_time_left and self.manual_mode_time_left.seconds < 10:
            self.display_change_queue_mode_box(extend_time=True)
 def start(self, stdscr):
     os.environ['BIBSCHED_MODE'] = 'manual'
     if self.curses.has_colors():
         self.curses.start_color()
         self.curses.init_pair(1, self.curses.COLOR_WHITE, self.curses.COLOR_RED)
         self.curses.init_pair(2, self.curses.COLOR_GREEN, self.curses.COLOR_BLACK)
         self.curses.init_pair(3, self.curses.COLOR_MAGENTA, self.curses.COLOR_BLACK)
         self.curses.init_pair(4, self.curses.COLOR_RED, self.curses.COLOR_BLACK)
         self.curses.init_pair(5, self.curses.COLOR_BLUE, self.curses.COLOR_BLACK)
         self.curses.init_pair(6, self.curses.COLOR_CYAN, self.curses.COLOR_BLACK)
         self.curses.init_pair(7, self.curses.COLOR_YELLOW, self.curses.COLOR_BLACK)
         self.curses.init_pair(8, self.curses.COLOR_WHITE, self.curses.COLOR_BLACK)
         self.curses.init_pair(9, self.curses.COLOR_BLACK, self.curses.COLOR_WHITE)
     self.stdscr = stdscr
     self.base_panel = self.curses.panel.new_panel(self.stdscr)
     self.base_panel.bottom()
     self.curses.panel.update_panels()
     self.height, self.width = stdscr.getmaxyx()
     self.stdscr.erase()
     self.check_auto_mode()
     self.debug_mode = fetch_debug_mode()
     ring = 4
     if len(self.motd) > 0:
         self._display_message_box(self.motd + "\nPress any key to close")
     while self.running:
         if ring == 4:
             self.read_motd()
             self.tick()
             ring = 0
         ring += 1
         char = -1
         try:
             char = timed_out(self.stdscr.getch, 1)
             if char == 27:  # escaping sequence
                 char = self.stdscr.getch()
                 if char == 79:  # arrow
                     char = self.stdscr.getch()
                     if char == 65:  # arrow up
                         char = self.curses.KEY_UP
                     elif char == 66:  # arrow down
                         char = self.curses.KEY_DOWN
                     elif char == 72:
                         char = self.curses.KEY_PPAGE
                     elif char == 70:
                         char = self.curses.KEY_NPAGE
                 elif char == 91:
                     char = self.stdscr.getch()
                     if char == 53:
                         char = self.stdscr.getch()
                         if char == 126:
                             char = self.curses.KEY_HOME
         except TimedOutExc:
             char = -1
         self.handle_keys(char)
 def start(self, stdscr):
     os.environ['BIBSCHED_MODE'] = 'manual'
     if self.curses.has_colors():
         self.curses.start_color()
         self.curses.init_pair(1, self.curses.COLOR_WHITE,
                               self.curses.COLOR_RED)
         self.curses.init_pair(2, self.curses.COLOR_GREEN,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(3, self.curses.COLOR_MAGENTA,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(4, self.curses.COLOR_RED,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(5, self.curses.COLOR_BLUE,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(6, self.curses.COLOR_CYAN,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(7, self.curses.COLOR_YELLOW,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(8, self.curses.COLOR_WHITE,
                               self.curses.COLOR_BLACK)
         self.curses.init_pair(9, self.curses.COLOR_BLACK,
                               self.curses.COLOR_WHITE)
     self.stdscr = stdscr
     self.base_panel = self.curses.panel.new_panel(self.stdscr)
     self.base_panel.bottom()
     self.curses.panel.update_panels()
     self.height, self.width = stdscr.getmaxyx()
     self.stdscr.erase()
     self.check_auto_mode()
     self.debug_mode = fetch_debug_mode()
     ring = 4
     if len(self.motd) > 0:
         self._display_message_box(self.motd + "\nPress any key to close")
     while self.running:
         if ring == 4:
             self.read_motd()
             self.tick()
             ring = 0
         ring += 1
         char = -1
         try:
             char = timed_out(self.stdscr.getch, 1)
             if char == 27:  # escaping sequence
                 char = self.stdscr.getch()
                 if char == 79:  # arrow
                     char = self.stdscr.getch()
                     if char == 65:  # arrow up
                         char = self.curses.KEY_UP
                     elif char == 66:  # arrow down
                         char = self.curses.KEY_DOWN
                     elif char == 72:
                         char = self.curses.KEY_PPAGE
                     elif char == 70:
                         char = self.curses.KEY_NPAGE
                 elif char == 91:
                     char = self.stdscr.getch()
                     if char == 53:
                         char = self.stdscr.getch()
                         if char == 126:
                             char = self.curses.KEY_HOME
         except TimedOutExc:
             char = -1
         self.handle_keys(char)