(self, highlight, groups, cur_win, offset, changed, parent)
Just print all groups in a column
Just print all groups in a column
Just print all groups in a column
def show_groups(self, highlight, groups, cur_win, offset, changed, parent):
        '''Just print all groups in a column'''

        self.draw_text(changed)
        self.group_win.clear()
            
        if parent is self.db.root_group:
            root_title = 'Parent: _ROOT_'
        else:
            root_title = 'Parent: ' + parent.title
        if cur_win == 0:
            h_color = 5
            n_color = 4
        else:
            h_color = 6
            n_color = 1

        try:
            ysize = self.group_win.getmaxyx()[0]
            self.group_win.addstr(0, 0, root_title,
                                  cur.color_pair(n_color))
            if groups:
                if len(groups) <= ysize - 3:
                    num = len(groups)
                else:
                    num = ysize - 3

                for i in range(num):
                    if highlight == i + offset:
                        if groups[i + offset].children:
                            title = '+' + groups[i + offset].title
                        else:
                            title = ' ' + groups[i + offset].title
                        self.group_win.addstr(i + 1, 0, title,
                                              cur.color_pair(h_color))
                    else:
                        if groups[i + offset].children:
                            title = '+' + groups[i + offset].title
                        else:
                            title = ' ' + groups[i + offset].title
                        self.group_win.addstr(i + 1, 0, title,
                                              cur.color_pair(n_color))
                x_of_n = str(highlight + 1) + ' of ' + str(len(groups))
                self.group_win.addstr(ysize - 2, 0, x_of_n)
        except:
            pass
        finally:
            self.group_win.refresh()
def show_groups ( self , highlight , groups , cur_win , offset , changed , parent ) : self . draw_text ( changed ) self . group_win . clear ( ) if parent is self . db . root_group : root_title = 'Parent: _ROOT_' else : root_title = 'Parent: ' + parent . title if cur_win == 0 : h_color = 5 n_color = 4 else : h_color = 6 n_color = 1 try : ysize = self . group_win . getmaxyx ( ) [ 0 ] self . group_win . addstr ( 0 , 0 , root_title , cur . color_pair ( n_color ) ) if groups : if len ( groups ) <= ysize - 3 : num = len ( groups ) else : num = ysize - 3 for i in range ( num ) : if highlight == i + offset : if groups [ i + offset ] . children : title = '+' + groups [ i + offset ] . title else : title = ' ' + groups [ i + offset ] . title self . group_win . addstr ( i + 1 , 0 , title , cur . color_pair ( h_color ) ) else : if groups [ i + offset ] . children : title = '+' + groups [ i + offset ] . title else : title = ' ' + groups [ i + offset ] . title self . group_win . addstr ( i + 1 , 0 , title , cur . color_pair ( n_color ) ) x_of_n = str ( highlight + 1 ) + ' of ' + str ( len ( groups ) ) self . group_win . addstr ( ysize - 2 , 0 , x_of_n ) except : pass finally : self . group_win . refresh ( )