Esempio n. 1
0
    def _build_widget(self, nodes, **kwargs):
        unit_info = []
        for node in nodes:
            node_pile = []
            node_cols = []
            charm_class, service = node
            if len(service.units) > 0:
                for u in sorted(service.units, key=attrgetter("unit_name")):
                    node_cols = self._build_node_columns(u, charm_class)
                    node_pile.append(node_cols)

                unit_info.append(
                    Padding.center_96(
                        LineBox(
                            Pile(node_pile),
                            title=charm_class.display_name,
                            lline=" ",
                            blcorner=" ",
                            rline=" ",
                            bline=" ",
                            brcorner=" ",
                        )
                    )
                )

        return ScrollableListBox(unit_info)
Esempio n. 2
0
    def _build_widget(self, nodes, **kwargs):
        unit_info = []
        for node in nodes:
            node_pile = []
            node_cols = []
            charm_class, service = node
            if len(service.units) > 0:
                for u in sorted(service.units, key=attrgetter('unit_name')):
                    node_cols = self._build_node_columns(u, charm_class)
                    node_pile.append(node_cols)

                unit_info.append(
                    Padding.center_96(
                        LineBox(Pile(node_pile),
                                title=charm_class.display_name,
                                lline=' ',
                                blcorner=' ',
                                rline=' ',
                                bline=' ',
                                brcorner=' ')))

        return ScrollableListBox(unit_info)
Esempio n. 3
0
 def __init__(self):
     self.title_widget = Color.frame_header(
         Padding.center_96(Text(TITLE_TEXT)))
     self.pile = Pile([self.title_widget, Text("")])
     self.set_show_add_units_hotkey(False)
     super().__init__(self.pile)