(self)
return result
Constructs the header part of the summary.
Constructs the header part of the summary.
Constructs the header part of the summary .
def _construct_header(self):
        """Constructs the header part of the summary."""
        graph = self._graph
        params = dict(
            directed="UD"[graph.is_directed()],
            named="-N"[graph.is_named()],
            weighted="-W"[graph.is_weighted()],
            typed="-T"["type" in graph.vertex_attributes()],
            vcount=graph.vcount(),
            ecount=graph.ecount(),
        )
        if "name" in graph.attributes():
            params["name"] = graph["name"]
        else:
            params["name"] = ""
        result = [
            "IGRAPH %(directed)s%(named)s%(weighted)s%(typed)s "
            "%(vcount)d %(ecount)d -- %(name)s" % params
        ]

        attrs = ["%s (g)" % (name,) for name in sorted(graph.attributes())]
        attrs.extend("%s (v)" % (name,) for name in sorted(graph.vertex_attributes()))
        attrs.extend("%s (e)" % (name,) for name in sorted(graph.edge_attributes()))
        if attrs:
            result.append("+ attr: %s" % ", ".join(attrs))
            if self.wrapper is not None:
                self.wrapper.subsequent_indent = "  "
                result[-1:] = self.wrapper.wrap(result[-1])
                self.wrapper.subsequent_indent = ""

        return result
def _construct_header ( self ) : graph = self . _graph params = dict ( directed = "UD" [ graph . is_directed ( ) ] , named = "-N" [ graph . is_named ( ) ] , weighted = "-W" [ graph . is_weighted ( ) ] , typed = "-T" [ "type" in graph . vertex_attributes ( ) ] , vcount = graph . vcount ( ) , ecount = graph . ecount ( ) , ) if "name" in graph . attributes ( ) : params [ "name" ] = graph [ "name" ] else : params [ "name" ] = "" result = [ "IGRAPH %(directed)s%(named)s%(weighted)s%(typed)s " "%(vcount)d %(ecount)d -- %(name)s" % params ] attrs = [ "%s (g)" % ( name , ) for name in sorted ( graph . attributes ( ) ) ] attrs . extend ( "%s (v)" % ( name , ) for name in sorted ( graph . vertex_attributes ( ) ) ) attrs . extend ( "%s (e)" % ( name , ) for name in sorted ( graph . edge_attributes ( ) ) ) if attrs : result . append ( "+ attr: %s" % ", " . join ( attrs ) ) if self . wrapper is not None : self . wrapper . subsequent_indent = "  " result [ - 1 : ] = self . wrapper . wrap ( result [ - 1 ] ) self . wrapper . subsequent_indent = "" return result