From 386205877bbee57178432a31eb76a482792c7468 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Wed, 9 Oct 2013 16:19:47 +0000 Subject: [PATCH] 7102: XML: Gramps does not export 'very low' value (0) for confidence into citation svn: r23288 --- gramps/plugins/export/exportxml.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/export/exportxml.py b/gramps/plugins/export/exportxml.py index 63e95cdf5..9bf54f418 100644 --- a/gramps/plugins/export/exportxml.py +++ b/gramps/plugins/export/exportxml.py @@ -579,7 +579,8 @@ class GrampsXmlWriter(UpdateCallback): self.write_primary_tag("citation", citation, index) self.write_date(citation.get_date_object(), index+1) self.write_line("page", citation.get_page(), index+1) - self.write_line("confidence", citation.get_confidence_level(), index+1) + self.write_line_always("confidence", + citation.get_confidence_level(), index+1) self.write_note_list(citation.get_note_list(), index+1) self.write_media_list(citation.get_media_list(), index+1) self.write_data_map(citation.get_data_map()) @@ -829,13 +830,18 @@ class GrampsXmlWriter(UpdateCallback): def write_line_nofix(self,tagname,value,indent=1): """Writes a line, but does not escape characters. - Use this instead of write_line is the value is already fixed, + Use this instead of write_line if the value is already fixed, this avoids & becoming &amp; """ if value: self.g.write('%s<%s>%s\n' % (' '*indent, tagname, value, tagname)) + def write_line_always(self,tagname,value,indent=1): + """Writes a line, always, even with a zero value.""" + self.g.write('%s<%s>%s\n' % + (' '*indent,tagname,self.fix(value),tagname)) + def get_iso_date(self,date): if date[2] == 0: y = "????"