From 4952e06acdb6aa3297be28bf99a5520995e0d33e Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 6 Oct 2006 23:03:56 +0000 Subject: [PATCH] * src/GrampsDb/_WriteXML.py (write_data_map): Escape special chars in key/value pairs. * src/GrampsDb/_GrampsBSDDB.py (load): Do not create logs when TXN is disabled; (gramps_upgrade_9): Include upgrade_11 steps into upgrade_9. svn: r7360 --- gramps2/ChangeLog | 7 +++++-- gramps2/src/GrampsDb/_GrampsBSDDB.py | 18 ++++++++++++++---- gramps2/src/GrampsDb/_WriteXML.py | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index e50db76a0..7c64446e1 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -4,8 +4,11 @@ * src/plugins/SoundGen.py: Dont fail with empty database 2006-10-06 Alex Roitman - * src/GrampsDb/_GrampsBSDDB.py (GrampsBSDDB.load): Do not create - logs when TXN is disabled. + * src/GrampsDb/_WriteXML.py (write_data_map): Escape special chars + in key/value pairs. + * src/GrampsDb/_GrampsBSDDB.py (load): Do not create logs when TXN + is disabled; + (gramps_upgrade_9): Include upgrade_11 steps into upgrade_9. 2006-10-05 Alex Roitman * src/DataViews/_PersonView.py (set_inactive): Check active status. diff --git a/gramps2/src/GrampsDb/_GrampsBSDDB.py b/gramps2/src/GrampsDb/_GrampsBSDDB.py index d22f5e827..9a17423bc 100644 --- a/gramps2/src/GrampsDb/_GrampsBSDDB.py +++ b/gramps2/src/GrampsDb/_GrampsBSDDB.py @@ -1488,7 +1488,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): self.metadata.sync() def gramps_upgrade_9(self): - print "Upgrading to DB version 10 -- this may take a while" + print "Upgrading to DB version 11 -- this may take a while" # The very very first thing is to check for duplicates in the # primary tables and remove them. self.set_total(7) @@ -1726,6 +1726,10 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): # Old lds ords did not have private attribute for item in person.lds_ord_list: item.private = False + + # Upgrade addresses: this is an upgrade_11 step + for addr in person.address_list: + addr.county = u'' self.commit_person(person,trans) self.update() @@ -1828,7 +1832,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): place = Place() place.handle = handle (junk_handle, place.gramps_id, place.title, place.long, place.lat, - place.main_loc, place.alt_loc, place.urls, place.media_list, + main_loc, alt_loc, place.urls, place.media_list, place.source_list, place.note, place.change) = info # Cover attributes contained in MediaRefs @@ -1839,6 +1843,12 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): for url in place.urls: convert_url_9(url) + # Upgrade locations: this is an upgrade_11 step + if place.main_loc: + place.main_loc.street = u'' + for l in place.alt_loc: + l.street = u'' + self.commit_place(place,trans) self.update() @@ -1868,13 +1878,13 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback): the_txn = self.env.txn_begin() else: the_txn = None - self.metadata.put('version',10,txn=the_txn) + self.metadata.put('version',11,txn=the_txn) if self.UseTXN: the_txn.commit() else: self.metadata.sync() - print "Done upgrading to DB version 10" + print "Done upgrading to DB version 11" def gramps_upgrade_10(self): print "Upgrading to DB version 10 -- this may take a while" diff --git a/gramps2/src/GrampsDb/_WriteXML.py b/gramps2/src/GrampsDb/_WriteXML.py index 6559dddb4..19a0e44f0 100644 --- a/gramps2/src/GrampsDb/_WriteXML.py +++ b/gramps2/src/GrampsDb/_WriteXML.py @@ -912,7 +912,7 @@ class XmlWriter(UpdateCallback): sp = ' '*indent for key in datamap.keys(): self.g.write('%s\n' % - (sp,key,datamap[key])) + (sp,self.fix(key),self.fix(datamap[key]))) def write_reporef_list(self,rrlist,index=1): for reporef in rrlist: