From ad9d719a837c86b6b43d07def6b0bcbf2afbc39e Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 10 May 2007 21:41:45 +0000 Subject: [PATCH] 2007-05-09 Benny Malengier * src/GrampsDb/_ReadXML.py: partly fix #1053, import privacy of person, family, media, source, place and repo correct. Still to do: sourceref and lds_ordinance svn: r8457 --- ChangeLog | 4 ++++ src/GrampsDb/_ReadXML.py | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b0a61f25b..614b13dd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-05-09 Benny Malengier + * src/GrampsDb/_ReadXML.py: partly fix #1053, import privacy of person, family, + media, source, place and repo correct. Still to do: sourceref and lds_ordinance + 2007-05-10 Martin Hawlisch * src/DataViews/_PedigreeView.py: Some rendering fixes for RTL locales diff --git a/src/GrampsDb/_ReadXML.py b/src/GrampsDb/_ReadXML.py index 1dfc7ba83..d880aff35 100644 --- a/src/GrampsDb/_ReadXML.py +++ b/src/GrampsDb/_ReadXML.py @@ -686,6 +686,9 @@ class GrampsParser(UpdateCallback): self.placeobj.set_gramps_id(gramps_id) except KeyError: self.placeobj = self.find_place_by_gramps_id(gramps_id) + + self.placeobj.private = bool(attrs.get("priv")) + # GRAMPS LEGACY: title in the placeobj tag self.placeobj.title = attrs.get('title','') self.locations = 0 @@ -891,7 +894,8 @@ class GrampsParser(UpdateCallback): self.person.set_gramps_id(new_id) except KeyError: self.person = self.find_person_by_gramps_id(new_id) - + + self.person.private = bool(attrs.get("priv")) # Old and new markers: complete=1 and marker=word both have to work if attrs.get('complete'): # this is only true for complete=1 self.person.marker.set(RelLib.MarkerType.COMPLETE) @@ -988,6 +992,9 @@ class GrampsParser(UpdateCallback): self.family.set_gramps_id(gramps_id) except KeyError: self.family = self.find_family_by_gramps_id(gramps_id) + + self.family.private = bool(attrs.get("priv")) + # GRAMPS LEGACY: the type now belongs to tag # Here we need to support old format of if attrs.has_key('type'): @@ -1135,6 +1142,8 @@ class GrampsParser(UpdateCallback): self.source.set_gramps_id(gramps_id) except KeyError: self.source = self.find_source_by_gramps_id(gramps_id) + + self.source.private = bool(attrs.get("priv")) def start_reporef(self,attrs): self.reporef = RelLib.RepoRef() @@ -1188,6 +1197,7 @@ class GrampsParser(UpdateCallback): # the old format of self.object.mime = attrs.get('mime','') self.object.desc = attrs.get('description','') + self.object.private = bool(attrs.get("priv")) src = attrs.get("src",'') if src: if not os.path.isabs(src): @@ -1203,6 +1213,8 @@ class GrampsParser(UpdateCallback): self.repo.set_gramps_id(gramps_id) except KeyError: self.repo = self.find_repository_by_gramps_id(gramps_id) + + self.repo.private = bool(attrs.get("priv")) def stop_people(self,*tag): pass @@ -1225,6 +1237,7 @@ class GrampsParser(UpdateCallback): self.reporef = None def start_photo(self,attrs): + #legacy object, not anymore written self.photo = RelLib.MediaObject() self.pref = RelLib.MediaRef() self.pref.set_reference_handle(self.photo.get_handle()) @@ -1234,6 +1247,7 @@ class GrampsParser(UpdateCallback): self.photo.set_description(attrs[key]) elif key == "priv": self.pref.set_privacy(int(attrs[key])) + self.photo.set_privacy(int(attrs[key])) elif key == "src": src = attrs["src"] if not os.path.isabs(src):