diff --git a/bin/make.py b/bin/make.py index c195cf9..32fd69c 100755 --- a/bin/make.py +++ b/bin/make.py @@ -192,25 +192,32 @@ digraph %s else : return (u'blue' if u'M'==node.sex else u'red') + def _other_names(self, node) : + other_names = '' + if u'person'==node.type and node.other_names : + other_names = u', '.join(['%s:%s' % (k,v) for k,v in node.other_names.items()]) + elif u'company'==node.type and node.full_name : + other_names = node.full_name + return u'(%s)' % (other_names,) if other_names else u'' + def _dot_node(self, node_id) : node = Node.all[node_id] template = u'''\t%s [shape="%s", color="%s", ''' \ u'''label=<''' \ u'''''' \ + u'''%s''' \ u'''''' \ u'''
%s%s
%s
%s
>];\n''' portrait = u'../data/person/%s/portrait.png' % (node_id,) - if os.path.exists(portrait) : - portrait = u'' % portrait - else : - portrait = u'' + portrait = u'' % (portrait,) if os.path.exists(portrait) else u'' - return template % (node.name, + return template % (node.id, u'box' if u'person'==node.type else u'ellipse', self._node_color(node), node.name, (u'' if node.birth==u'N/A' else u' [%s]'%node.birth), + self._other_names(node), portrait, node.desc.replace(u'\n', u'
'))