示例#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)