test_nodedesc.py
Go to the documentation of this file.
1 from wirecell.dfp import nodetype, dot
2 import pygraphviz as pgv
3 
5  'Make a wirecell.dfp.graph.Graph'
6 
7  addtypes = True
8  rankdir='TB'
9  if addtypes:
10  rankdir='LR'
11 
12  ag = pgv.AGraph(name="nodetypes", directed=True, strict=False, rankdir=rankdir)
13  ag.node_attr['shape'] = 'record'
14 
15  j = open("nodedesc.json").read()
16  for typ,dat in nodetype.loads(j).items():
17  ag.add_node(typ, label = dot.nodetype_label(dat, addtypes))
18 
19  print ag.string()
20 
21 
22 if '__main__' == __name__:
int open(const char *, int)
Opens a file descriptor.
int read(int, char *, size_t)
Read bytes from a file descriptor.
def test_nodedesc()
Definition: test_nodedesc.py:4