From b239854bb47e5a369c1aaecc8b6fdbf719f7bb2c Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 3 Jun 2005 22:38:14 +0000 Subject: [PATCH] event/name type fixes svn: r4780 --- ChangeLog | 7 +++++++ example/gramps/data.gramps | Bin 5410 -> 24343 bytes src/DisplayModels.py | 1 - src/ListBox.py | 12 +++++++++++- src/PedView.py | 5 ++++- src/ReadXML.py | 17 +++++++++++++++-- src/RelLib.py | 7 +++++-- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 405332463..c5f66f236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-06-03 Don Allingham + * src/DisplayModels.py: remove unused print + * src/ListBox.py: get EventBox working for event types + * src/PedView.py: handle event types + * src/ReadXML.py: handle name types properly + * src/RelLib.py: add type checking for set_type + 2005-06-03 Martin Hawlisch * src/DisplayModels.py (RepositoryModel): Display repository type as text * src/RelLib.py (Repository): Serialize type as tuple not unicode diff --git a/example/gramps/data.gramps b/example/gramps/data.gramps index a3280d1fc25325bbadd9f19c09dff70a98ff2a16..65d86ea43ee668d9aaf4f0c843626ae0f43b6669 100644 GIT binary patch literal 24343 zcmcg!-E!Nw6~50?pt|U^GnTC%+Y+a;x3=TN$tJPK%64a`(+gOFEG87GAt`(PP<@KN zSU-RycmSF(r7)i4!Xm)~;5+{ZKa*enTm|ew#EBn;C!PL&uk*|4o5^3^USE9uDSB8taBgp)jHXqr}GZ`_kYl|XmR?6vB^^KxrpVT_%VwGPsLo)5GS1h zJG;4MgI;ggDf{c~d;9(FIu`v7TZ?ENpyA=5!xnty2fj!!qN5H=qD?%LKMv6<;Ofu8 zQRg7j+;3r~Se3 z@JO}EAJ8VtC={o|;jnvjbky}mgF)6%JtpnMiu=LoU38box&JdMhQA+*RDF>(P+w%f zOZ+AWB@-tZPuN^6_$EkCIv<9kPLBE-G82W&pX2FZoIeGw_ac-c@NROD|5c1jGK8g1 zYq0p-kJBalf(QC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zD-i6qH;~uv#@~fh7aj6wzJe9-(q={Il7x_G7Pgu1uUvTR3T653IqH#%=`_fd$ugX_ zyrE`xxb{Jeraw(VL+~h}L@Nu8Zoj?S0h~qvW zd?T8do{yH$YmkL$428uGwqIVxjZ(43WpYoby$5c~u#cuSK#^38&$3CqlhWD(7M^C{Uq(Sf z(h>?3GEv4SNq?PZ04nF z(TBkj-FWxM_PIiB9Q4X&X9Kt8`#-h-enWIHLg((|t+^Dg@j1N9`92;*!ib0knQ*vl z#)z0)BdQ*X_HY#O>}UufJUzcQV=!#4!JvvL>TmXD`(IRiT610^5qnEQ18By$xP0Rx z8^QCAiC8=d3NjgE;&YAZxQ8h3pa@IwG*g%{CgBToiW#^+Pb_U*hikY9AKqVY|M>0y M0RuZnr)qxy06z+Et^fc4 diff --git a/src/DisplayModels.py b/src/DisplayModels.py index d00d8f912..dcdd6196a 100644 --- a/src/DisplayModels.py +++ b/src/DisplayModels.py @@ -220,7 +220,6 @@ class ChildModel(gtk.ListStore): def column_birth_day(self,data): event_ref = data.get_birth_ref() if event_ref and event_ref.ref: - print event_ref.ref return self.db.get_event_from_handle(event_ref.ref).get_date() else: return u"" diff --git a/src/ListBox.py b/src/ListBox.py index b9e9caa04..04ada147f 100644 --- a/src/ListBox.py +++ b/src/ListBox.py @@ -270,8 +270,18 @@ class EventListBox(ReorderListBox): ReorderListBox.__init__(self, parent, person, obj, label, button_list, evalues, DdTargets.EVENT) + self.name_map = {} + self.val_map = Utils.personal_events + self.custom = RelLib.Event.CUSTOM + for key in self.val_map.keys(): + self.name_map[self.val_map[key]] = key + def set_name(self,index,value): - self.data[index][1].set_name(value) + val = self.name_map.get(value,self.custom) + if val == self.custom: + self.data[index][1].set_type((val,value)) + else: + self.data[index][1].set_type((val,self.val_map[val])) self.change_list.add(self.data[index]) def set_description(self,index,value): diff --git a/src/PedView.py b/src/PedView.py index ca3da2cc1..87d8bd21c 100644 --- a/src/PedView.py +++ b/src/PedView.py @@ -46,6 +46,7 @@ import GrampsCfg import Relationship import NameDisplay import RelLib +import Utils #------------------------------------------------------------------------- # @@ -690,7 +691,9 @@ class PedigreeView: if event: if line_count < 3: return event.get_date() - text += _(event.get_name()) + i,s = event.get_type() + name = Utils.family_relations[i] + text += name text += "\n" text += event.get_date() text += "\n" diff --git a/src/ReadXML.py b/src/ReadXML.py index 44ea6645f..092273272 100644 --- a/src/ReadXML.py +++ b/src/ReadXML.py @@ -64,6 +64,14 @@ _FAMILY_TRANS = { 'Other' : RelLib.Family.CUSTOM, } +_NAME_TRANS = { + "Unknown" : RelLib.Name.UNKNOWN, + "Custom" : RelLib.Name.CUSTOM, + "Also Known As" : RelLib.Name.AKA, + "Birth Name" : RelLib.Name.BIRTH, + "Married Name" : RelLib.Name.MARRIED, + } + #------------------------------------------------------------------------- # # Importing data into the currently open database. @@ -893,7 +901,11 @@ class GrampsParser: if not self.in_witness: self.name = RelLib.Name() if attrs.has_key("type"): - self.name.set_type(attrs["type"]) + tval = _NAME_TRANS[attrs['type']] + if tval == RelLib.Name.CUSTOM: + self.name.set_type((tval,attrs["type"])) + else: + self.name.set_type((tval,Utils.name_types[tval])) if attrs.has_key("sort"): self.name.set_sort_as(int(attrs["sort"])) if attrs.has_key("display"): @@ -1242,7 +1254,6 @@ class GrampsParser: self.person.set_death_ref(ref) else: self.person.add_event_ref(ref) - print self.event.get_date() self.db.commit_event(self.event,self.trans,self.change) self.event = None @@ -1254,6 +1265,7 @@ class GrampsParser: self.name.set_type("Birth Name") self.person.set_primary_name (self.name) self.person.get_primary_name().build_sort_name() + print "*",self.person.primary_name.get_name() self.name = None def stop_ref(self,tag): @@ -1293,6 +1305,7 @@ class GrampsParser: def stop_person(self,*tag): self.db.commit_person(self.person,self.trans,self.change) + print self.person.handle,self.person.primary_name.get_name() self.person = None while gtk.events_pending(): gtk.main_iteration() diff --git a/src/RelLib.py b/src/RelLib.py index 3e26c426c..e130419d8 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -2369,6 +2369,7 @@ class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase,PlaceBase): @param the_type: Type to assign to the Event @type the_type: tuple """ + assert type(the_type) == tuple self.type = the_type def get_type(self): @@ -3535,6 +3536,7 @@ class Attribute(PrivateSourceNote): def set_type(self,val): """sets the type (or key) of the Attribute instance""" + assert type(the_type) == tuple self.type = val def get_type(self): @@ -3801,9 +3803,10 @@ class Name(PrivateSourceNote,DateBase): """ self.prefix = val - def set_type(self,type): + def set_type(self,the_type): """sets the type of the Name instance""" - self.type = type + assert type(the_type) == tuple + self.type = the_type def get_type(self): """returns the type of the Name instance"""