From: Don A. <dal...@us...> - 2003-01-27 04:25:56
|
Alexandre, Thanks. I'll merge this into the gramps2 CVS tree tomorrow. Don On Sun, 2003-01-26 at 14:25, Alexandre Duret-Lutz wrote: > Apparently GraphVizard understands only Latin-1, so because > gramps2 stores text in unicode I had to convert names on output. > > This also guards two getId() calls. > > Index: GraphViz.py > =================================================================== > RCS file: /cvsroot/gramps/gramps2/src/plugins/GraphViz.py,v > retrieving revision 1.6 > diff -u -r1.6 GraphViz.py > --- GraphViz.py 15 Jan 2003 05:25:50 -0000 1.6 > +++ GraphViz.py 26 Jan 2003 21:19:40 -0000 > @@ -45,6 +45,7 @@ > import TextDoc > import GenericFilter > from intl import gettext as _ > +from latin_utf8 import utf8_to_latin > > #------------------------------------------------------------------------ > # > @@ -333,8 +334,9 @@ > mother = family.getMother() > fadopted = frel != _("Birth") > madopted = mrel != _("Birth") > - if show_families and (person_dict.has_key(father.getId()) or > - person_dict.has_key(mother.getId())): > + if (show_families and > + (father and person_dict.has_key(father.getId()) or > + mother and person_dict.has_key(mother.getId()))): > # Link to the family node. > famid = string.replace(family.getId(),'-','_') > file.write('p%s -> f%s [' % (pid, famid)) > @@ -403,7 +405,7 @@ > file.write('color=deeppink, ') > else: > file.write('color=black, ') > - file.write('fontname="Arial", label="%s"];\n' % label) > + file.write('fontname="Arial", label="%s"];\n' % utf8_to_latin(label)) > # Output families's nodes. > if show_families: > family_list = person.getFamilyList() -- Don Allingham <dal...@us...> GRAMPS - Open Source Genealogy |