(self, visible_graph_list=None)
Show a column of the graph selected for display
Show a column of the graph selected for display
Show a column of the graph selected for display
def set_visible_graphs(self, visible_graph_list=None):
        """Show a column of the graph selected for display"""
        if visible_graph_list is None:
            visible_graph_list = self.visible_graph_list

        vline = urwid.AttrWrap(urwid.SolidFill(u'|'), 'line')

        graph_vector_column_list = []
        for state, graph, sub_title in zip(visible_graph_list,
                                           self.bar_graph_vector,
                                           self.sub_title_list):
            if state:
                text_w = urwid.Text(sub_title, align='center')
                sub_title_widget = urwid.ListBox([text_w])
                graph_a = [('fixed', 1, sub_title_widget),
                           ('weight', 1, graph)]
                graph_and_title = urwid.Pile(graph_a)
                graph_vector_column_list.append(('weight', 1, graph_and_title))
                graph_vector_column_list.append(('fixed', 1, vline))

        # if all sub graph are disabled
        if not graph_vector_column_list:
            self.visible_graph_list = visible_graph_list
            self.original_widget = urwid.Pile([])
            return

        # remove the last vertical line separator
        graph_vector_column_list.pop()

        y_label_a = ('weight', 1, urwid.Columns(graph_vector_column_list))
        y_label_and_graphs = [self.y_label,
                              y_label_a]
        column_w = urwid.Columns(y_label_and_graphs, dividechars=1)
        y_label_and_graphs_widget = urwid.WidgetPlaceholder(column_w)

        init_widget = urwid.Pile([('fixed', 1, self.title),
                                  ('weight', 1, y_label_and_graphs_widget)])

        self.visible_graph_list = visible_graph_list
        self.original_widget = init_widget
def set_visible_graphs ( self , visible_graph_list = None ) : if visible_graph_list is None : visible_graph_list = self . visible_graph_list vline = urwid . AttrWrap ( urwid . SolidFill ( u'|' ) , 'line' ) graph_vector_column_list = [ ] for state , graph , sub_title in zip ( visible_graph_list , self . bar_graph_vector , self . sub_title_list ) : if state : text_w = urwid . Text ( sub_title , align = 'center' ) sub_title_widget = urwid . ListBox ( [ text_w ] ) graph_a = [ ( 'fixed' , 1 , sub_title_widget ) , ( 'weight' , 1 , graph ) ] graph_and_title = urwid . Pile ( graph_a ) graph_vector_column_list . append ( ( 'weight' , 1 , graph_and_title ) ) graph_vector_column_list . append ( ( 'fixed' , 1 , vline ) ) # if all sub graph are disabled if not graph_vector_column_list : self . visible_graph_list = visible_graph_list self . original_widget = urwid . Pile ( [ ] ) return # remove the last vertical line separator graph_vector_column_list . pop ( ) y_label_a = ( 'weight' , 1 , urwid . Columns ( graph_vector_column_list ) ) y_label_and_graphs = [ self . y_label , y_label_a ] column_w = urwid . Columns ( y_label_and_graphs , dividechars = 1 ) y_label_and_graphs_widget = urwid . WidgetPlaceholder ( column_w ) init_widget = urwid . Pile ( [ ( 'fixed' , 1 , self . title ) , ( 'weight' , 1 , y_label_and_graphs_widget ) ] ) self . visible_graph_list = visible_graph_list self . original_widget = init_widget