def __init__(self, stdscr): self.stdscr = stdscr self.dlog = DebugLog() try: self.windowList = [] self.compad = CommandPad(stdscr) self.windowList.append(self.compad) self.set_active_window(0) self.compad.draw() # board = "int" # threadno = "50294416" self.nickname = "asdfasd" # self.bp = BoardPad(stdscr) # self.bp.join(board, threadno, self.nickname) # self.windowList.append(self.bp) # self.set_active_window(1) Thread.__init__(self) self._stop = threading.Event() except: raise
class WindowLogic(threading.Thread): ''' classdocs ''' def __init__(self, stdscr): self.stdscr = stdscr self.dlog = DebugLog() try: self.windowList = [] self.compad = CommandPad(stdscr) self.windowList.append(self.compad) self.set_active_window(0) self.compad.draw() # board = "int" # threadno = "50294416" self.nickname = "asdfasd" # self.bp = BoardPad(stdscr) # self.bp.join(board, threadno, self.nickname) # self.windowList.append(self.bp) # self.set_active_window(1) Thread.__init__(self) self._stop = threading.Event() except: raise def join_thread(self, board, thread): try: self.dlog.msg("Creating new boardpad for " + thread + " on /" + board + "/\n") boardpad = BoardPad(self.stdscr) boardpad.join(board, thread, self.nickname) self.windowList.append(boardpad) self.set_active_window(1) except Exception, err: self.dlog.excpt(err)
def __init__(self, stdscr): self.curses = curses self.stdscr = stdscr curses.use_default_colors() # @UndefinedVariable # assign color to post number, pairs 1-10 are reserved for i in range(0, curses.COLORS): # @UndefinedVariable curses.init_pair(i + 10, i, -1) # @UndefinedVariable # reserved color pairs curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_GREEN) # @UndefinedVariable curses.init_pair(2, curses.COLOR_YELLOW, curses.COLOR_GREEN) # @UndefinedVariable curses.init_pair(3, curses.COLOR_RED, curses.COLOR_GREEN) # @UndefinedVariable curses.init_pair(4, curses.COLOR_RED, -1) # @UndefinedVariable self.dlog = DebugLog(self) try: self.cfg = Config() self.cfg.register(self) self.sb = None self.tw = None self.db = Database(self) self.tw = ThreadWatcher(self) self.windowList = [] # Array of all window objects (i.e. Pads) self.windowListProperties = { } # Associating a window object with its properties self.ci = None # Set by CommandInterpreter.__init__() self.compad = CommandPad(stdscr, self) self.msgpad = MessagePad(stdscr, self) self.append_pad(self.compad) self.append_pad(self.msgpad) self.set_active_window(0) self.nickname = "" # Thread.__init__(self) # self._stop = threading.Event() except Exception as err: self.dlog.excpt(err, msg=">>>in WindowLogic.__init__()", cn=self.__class__.__name__) raise