diff --git a/ChangeLog b/ChangeLog index c09d7d613..bf4434bb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-01 Alex Roitman + * src/plugins/StatisticsChart.py: Remove cause. + * src/GrampsDb/_WriteXML.py (write_object): Escape path of the files; + (fix): remove control characters. + 2006-08-29 Alex Roitman * src/GrampsDb/_GrampsDbBase.py (remove_person,_do_remove_object): Properly delete objects; diff --git a/src/GrampsDb/_WriteXML.py b/src/GrampsDb/_WriteXML.py index d01360b01..bf2c582cd 100644 --- a/src/GrampsDb/_WriteXML.py +++ b/src/GrampsDb/_WriteXML.py @@ -72,6 +72,9 @@ except: _xml_version = "1.1.2" +# table for skipping control chars from XML +strip_dict = dict.fromkeys(range(20)) + #------------------------------------------------------------------------- # # @@ -364,7 +367,7 @@ class XmlWriter(UpdateCallback): self.g.write(" \n") def fix(self,line): - l = line.strip() + l = unicode(line).strip().translate(strip_dict) l = l.replace('&','&') l = l.replace('>','>') l = l.replace('<','<') @@ -997,7 +1000,7 @@ class XmlWriter(UpdateCallback): path = path[1:] self.g.write('%s\n' - % (" "*(index+1),path,mime_type,desc_text)) + % (" "*(index+1),self.fix(path),mime_type,desc_text)) self.write_attribute_list(obj.get_attribute_list()) if obj.get_note() != "": self.write_note("note",obj.get_note_object(),index+1) diff --git a/src/plugins/StatisticsChart.py b/src/plugins/StatisticsChart.py index d93800b73..4d7287499 100644 --- a/src/plugins/StatisticsChart.py +++ b/src/plugins/StatisticsChart.py @@ -109,8 +109,6 @@ class Extract: self.get_birth, self.get_month), 'data_dmonth': ("Death month", _("Death month"), self.get_death, self.get_month), - 'data_dcause': ("Cause of death", _("Cause of death"), - self.get_death, self.get_cause), 'data_bplace': ("Birth place", _("Birth place"), self.get_birth, self.get_place), 'data_dplace': ("Death place", _("Death place"), @@ -193,13 +191,6 @@ class Extract: return [DateHandler.displayer._months[month]] return [_("Date(s) missing")] - def get_cause(self, event): - "return cause for given event" - cause = event.get_cause() - if cause: - return [cause] - return [_("Cause missing")] - def get_place(self, event): "return place for given event" place_handle = event.get_place_handle()