def _display_components(self): rows = [] for group in self.node_groups: group_column = chain([group.id], repeat('')) rows.extend( no_nulls((grp, comp['name'])) for grp, comp in six.moves.zip(group_column, group.components)) print_table(rows, ('Node Group', 'Name'), title='Components')
def _display_components(self): rows = [] for group in self.node_groups: group_column = chain([group.id], repeat('')) rows.extend( no_nulls((grp, comp['name'])) for grp, comp in six.moves.zip(group_column, group.components) ) print_table(rows, ('Node Group', 'Name'), title='Components')
def display_nodes(cls, nodes): display_result(nodes, Node, title='Nodes') rows = [] for node in nodes: node_column = chain([node.name], repeat('')) rows.extend( no_nulls([name, comp['name'], comp['nice_name'], comp.get('uri')]) for name, comp in six.moves.zip(node_column, node.components)) print_table(rows, ('Node', 'ID', 'Name', 'URI'), title='Components')
def display_nodes(cls, nodes): sorted_nodes = sorted(nodes, key=lambda node: node.name) display_result(sorted_nodes, Node, title='Nodes') six.print_() rows = [] for node in sorted_nodes: node_column = chain([node.name], repeat('')) rows.extend( no_nulls( [name, comp['name'], comp['nice_name'], comp.get('uri')]) for name, comp in six.moves.zip(node_column, node.components)) print_table(rows, ('Node', 'ID', 'Name', 'URI'), title='Components')