def _create_text(self): self.text = [] for line in self.BANNER: self._insert_line(line) self.text.append(self.flash_text) return ScrollableListBox(self.text)
def _build_node_waiting(self): """ creates a loading screen if nodes do not exist yet """ text = [ Text("\n\n\n"), Text(self.message, align="center"), Text("\n\n\n") ] load_box = [ AttrWrap(Text("\u2582", align="center"), "pending_icon_on"), AttrWrap(Text("\u2581", align="center"), "pending_icon_on"), AttrWrap(Text("\u2583", align="center"), "pending_icon_on"), AttrWrap(Text("\u2584", align="center"), "pending_icon_on"), AttrWrap(Text("\u2585", align="center"), "pending_icon_on"), AttrWrap(Text("\u2586", align="center"), "pending_icon_on"), AttrWrap(Text("\u2587", align="center"), "pending_icon_on"), AttrWrap(Text("\u2588", align="center"), "pending_icon_on") ] # Add loading boxes random.shuffle(load_box) loading_boxes = [] loading_boxes.append(('weight', 1, Text(''))) for i in load_box: loading_boxes.append( ('pack', load_box[random.randrange(len(load_box))])) loading_boxes.append(('weight', 1, Text(''))) loading_boxes = Columns(loading_boxes) return ScrollableListBox(text + [loading_boxes])
def _create_text(self): self.text = [] for line in self.HELP_TEXT: self._insert_line(line) return LineBox(BoxAdapter( ScrollableListBox(self.text), height=20), title='Help \u21C5 Scroll (ESC) Close')
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(LineBox( Pile(node_pile), title=charm_class.display_name, lline=' ', blcorner=' ', rline=' ', bline=' ', brcorner=' '))) return ScrollableListBox(unit_info)