graph — The graph subcommand

Module for the graph subcommand.

class valjean.cambronne.commands.graph.GraphCommand[source]

Command class for the build subcommand.

register(parser)[source]

Register options for this command in the parser.

static execute(args, _config)[source]

Execute the graph command.

static merge_graph_str(solid_graph, dashed_graph)[source]

Merge two strings representing graphviz graphs into one graph. The graphs are merged in such a way that the edges of solid_graph and dashed_graph are respectively represented as solid and dashed.

For example:

>>> print(solid_graph)
digraph {
  node1 -> node2;
  node2 -> node3;
}
>>> print(dashed_graph)
digraph {
  node1 -> node3;
}
>>> print(GraphCommand.merge_graph_str(solid_graph, dashed_graph))
digraph {
  subgraph G1 {
  node1 -> node2;
  node2 -> node3;
  }
  subgraph G2 {
  edge [style=dashed];
  node1 -> node3;
  }
}
Parameters:
Returns:

the merged graph.

Return type:

str