MCPcopy
hub / github.com/programthink/zhao / dump

Method dump

bin/make.py:146–178  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

144
145
146 def dump(self) :
147 output = StringIO()
148
149 for n in self._nodes :
150 output.write(self._dot_node(n))
151 output.write(u'\n')
152
153 for r in self._relations :
154 output.write(self._dot_relation(r))
155 output.write(u'\n')
156
157 if len(self._families) > 1 :
158 for f in self._families :
159 output.write(self._dot_sub_graph(f))
160
161 template = u'''
162digraph %s
163{
164\trankdir = "LR";
165\tranksep = 0.5;
166\tlabel = "%s";
167\tlabelloc = "t";
168\tfontsize = "24";
169\tfontname = "SimHei";
170
171\tgraph [style="filled", color="lightgrey"];
172\tnode [fontname="SimSun"];
173\tedge [fontname="SimSun"];
174
175%s
176}
177'''
178 return template % (self._name, self._name, output.getvalue())
179
180
181 def _node_color(self, node) :

Callers 1

doMethod · 0.80

Calls 3

_dot_nodeMethod · 0.95
_dot_relationMethod · 0.95
_dot_sub_graphMethod · 0.95

Tested by

no test coverage detected