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

Method _dot_node

bin/make.py:195–214  ·  view source on GitHub ↗
(self, node_id)

Source from the content-addressed store, hash-verified

193 return u'<tr><td>(%s)</td></tr>' % (other_names,) if other_names else ''
194
195 def _dot_node(self, node_id) :
196 node = Node.all[node_id]
197 template = u'\t%s [shape="%s", color="%s", ' \
198 u'label=<<table border="0" cellborder="0">' \
199 u'<tr><td>%s%s</td></tr>' \
200 u'%s' \
201 u'<tr><td>%s</td></tr>' \
202 u'<tr><td>%s</td></tr></table>>];\n'
203
204 portrait = u'../data/person/%s/portrait.png' % (node_id,)
205 portrait = u'<img src="%s"/>' % (portrait,) if os.path.exists(portrait) else ''
206
207 return template % (node.id,
208 u'box' if u'person'==node.type else u'ellipse',
209 self._node_color(node),
210 node.name,
211 (u'' if node.birth==u'N/A' else u' [%s]'%node.birth),
212 self._other_names(node),
213 portrait,
214 node.desc.replace(u'\n', u'<br/>'))
215
216
217 def _dot_relation(self, name) :

Callers 2

dumpMethod · 0.95
_dot_sub_graphMethod · 0.95

Calls 2

_node_colorMethod · 0.95
_other_namesMethod · 0.95

Tested by

no test coverage detected