MCPcopy Index your code
hub / github.com/programthink/zhao / _dot_relation

Method _dot_relation

bin/make.py:217–234  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

215
216
217 def _dot_relation(self, name) :
218 relation = Relation.all[name]
219 template = u'''\t%s -> %s [label="%s", style=%s, color="%s"];\n'''
220
221 if re.match(u'^夫|妻$', relation.desc) :
222 style = u'bold'
223 elif re.match(u'^父|母$', relation.desc) :
224 style = u'solid'
225 elif re.match(u'^(独|长|次|三|四|五|六|七)?(子|女)$', relation.desc) :
226 style = u'solid'
227 elif re.match(u'^.*?(兄|弟|姐|妹)$', relation.desc) :
228 style = u'dashed'
229 else :
230 style = u'dotted'
231
232 return template % (relation.node_from, relation.node_to,
233 relation.desc, style,
234 self._node_color(Node.all[relation.node_to]))
235
236
237 def _dot_sub_graph(self, name) :

Callers 1

dumpMethod · 0.95

Calls 1

_node_colorMethod · 0.95

Tested by

no test coverage detected