Ejemplo n.º 1
0
    def __init__(self, stdscr):
        self.stdscr = stdscr
        self.stdscr.box()
        # topic
        self.META_DATA_FILE = os.path.join(os.path.dirname(__file__),
                                           'meta.data')
        self.messages = []

        curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
        curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK)
        curses.init_pair(3, curses.COLOR_RED, curses.COLOR_WHITE)
        curses.curs_set(0)

        self.moduleconf = []

        with open(self.META_DATA_FILE) as f:
            for line in f:
                module_name, proto_file, proto_class, conf_file = line.strip(
                ).split(' ')
                if module_name == 'MODULE' or proto_file == '#' or\
                        proto_class == "#" or conf_file == '#':
                    pass
                else:
                    moduleconf = ModuleConf(module_name, proto_file,
                                            proto_class, conf_file,
                                            self.stdscr)
                    moduleconf.parse_from_file()
                    self.moduleconf.append(moduleconf)

        self.select = 0
        self.winy, _ = stdscr.getmaxyx()
    def __init__(self, stdscr):
        self.stdscr = stdscr
        self.stdscr.box()
        # topic
        self.META_DATA_FILE = os.path.join(
            os.path.dirname(__file__), 'meta.data')
        self.messages = []

        curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
        curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK)
        curses.init_pair(3, curses.COLOR_RED, curses.COLOR_WHITE)
        curses.curs_set(0)

        self.moduleconf = []

        with open(self.META_DATA_FILE) as f:
            for line in f:
                module_name, proto_file, proto_class, conf_file = line.strip(
                ).split(' ')
                if module_name == 'MODULE' or proto_file == '#' or\
                    proto_class == "#" or conf_file == '#':
                    pass
                else:
                    moduleconf = ModuleConf(module_name, proto_file,
                                            proto_class, conf_file, self.stdscr)
                    moduleconf.parse_from_file()
                    self.moduleconf.append(moduleconf)

        self.select = 0
        self.winy, _ = stdscr.getmaxyx()