Пример #1
0
 def mainException(self):
     if isinstance(sys.exc_info()[1], KeyboardInterrupt):
         self.logger.warn("Timer interrupted at user request; program "
             "terminating.\n")
         self.terminate()
     else:
         UIBase.mainException(self)
Пример #2
0
 def mainException(self):
     if isinstance(sys.exc_info()[1], KeyboardInterrupt):
         self.logger.warn("Timer interrupted at user request; program "
                          "terminating.\n")
         self.terminate()
     else:
         UIBase.mainException(self)
Пример #3
0
 def terminate(self, *args, **kwargs):
     curses.nocbreak();
     self.stdscr.keypad(0);
     curses.echo()
     curses.endwin()
     # need to remove the Curses console handler now and replace with
     # basic one, so exceptions and stuff are properly displayed
     self.logger.removeHandler(self._log_con_handler)
     UIBase.setup_consolehandler(self)
     # finally call parent terminate which prints out exceptions etc
     super(Blinkenlights, self).terminate(*args, **kwargs)
Пример #4
0
 def terminate(self, *args, **kwargs):
     curses.nocbreak()
     self.stdscr.keypad(0)
     curses.echo()
     curses.endwin()
     # need to remove the Curses console handler now and replace with
     # basic one, so exceptions and stuff are properly displayed
     self.logger.removeHandler(self._log_con_handler)
     UIBase.setup_consolehandler(self)
     # reset the warning method, we do not have curses anymore
     self.warn = super(Blinkenlights, self).warn
     # finally call parent terminate which prints out exceptions etc
     super(Blinkenlights, self).terminate(*args, **kwargs)
Пример #5
0
    def threadExited(s, thread):
        threadid = thread.threadid
        accountname = s.getthreadaccount(thread)
        s.tflock.acquire()
        try:
            if threadid in s.threadframes[accountname]:
                tf = s.threadframes[accountname][threadid]
                del s.threadframes[accountname][threadid]
                s.availablethreadframes[accountname].append(tf)
                tf.setthread(None)
        finally:
            s.tflock.release()

        UIBase.threadExited(s, thread)
Пример #6
0
    def threadExited(s, thread):
        threadid = thread.threadid
        accountname = s.getthreadaccount(thread)
        s.tflock.acquire()
        try:
            if threadid in s.threadframes[accountname]:
                tf = s.threadframes[accountname][threadid]
                del s.threadframes[accountname][threadid]
                s.availablethreadframes[accountname].append(tf)
                tf.setthread(None)
        finally:
            s.tflock.release()

        UIBase.threadExited(s, thread)
Пример #7
0
 def mainException(self):
     UIBase.mainException(self)
Пример #8
0
 def sleep(s, sleepsecs, siglistener):
     s.gettf().setcolor('red')
     s.getaccountframe().startsleep(sleepsecs)
     return UIBase.sleep(s, sleepsecs, siglistener)
Пример #9
0
 def unregisterthread(s, thread):
     UIBase.unregisterthread(s, thread)
     s._printData(s.logger.info, 'unregisterthread', thread.getName())
Пример #10
0
 def threadExited(s, thread):
     s._printData(s.logger.info, 'threadExited', thread.getName())
     UIBase.threadExited(s, thread)
Пример #11
0
 def unregisterthread(s, thread):
     UIBase.unregisterthread(s, thread)
     s._printData('unregisterthread', thread.getName())
Пример #12
0
 def threadException(self, thread):
     #self._log_con_handler.stop()
     UIBase.threadException(self, thread)
Пример #13
0
 def mainException(self):
     UIBase.mainException(self)
Пример #14
0
 def unregisterthread(s, thread):
     UIBase.unregisterthread(s, thread)
     s._printData('unregisterthread', thread.getName())
Пример #15
0
 def threadExited(s, thread):
     s._printData('threadExited', thread.getName())
     UIBase.threadExited(s, thread)
Пример #16
0
 def sleep(s, sleepsecs, account):
     s.gettf().setcolor('red')
     s.getaccountframe().startsleep(sleepsecs)
     return UIBase.sleep(s, sleepsecs, account)
Пример #17
0
 def threadException(self, thread):
     #self._log_con_handler.stop()
     UIBase.threadException(self, thread)
Пример #18
0
 def threadExited(s, thread):
     s._printData('threadExited', thread.getName())
     UIBase.threadExited(s, thread)