Better handling of FTM gedcom

svn: r811
This commit is contained in:
Don Allingham 2002-03-03 16:10:51 +00:00
parent 5b0f8628da
commit a0796073fc
3 changed files with 30 additions and 23 deletions

View File

@ -2449,8 +2449,8 @@
<handler>on_event_button_press</handler> <handler>on_event_button_press</handler>
<last_modification_time>Sun, 04 Nov 2001 15:29:48 GMT</last_modification_time> <last_modification_time>Sun, 04 Nov 2001 15:29:48 GMT</last_modification_time>
</signal> </signal>
<columns>4</columns> <columns>5</columns>
<column_widths>125,150,200,50</column_widths> <column_widths>115,110,150,100,50</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode> <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles> <show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type> <shadow_type>GTK_SHADOW_IN</shadow_type>
@ -2468,6 +2468,19 @@
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label108</name>
<label>Description</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>

View File

@ -197,7 +197,7 @@ class EditPerson:
self.name_note = self.get_widget("name_note") self.name_note = self.get_widget("name_note")
self.name_source = self.get_widget("name_source") self.name_source = self.get_widget("name_source")
self.gid = self.get_widget("gid") self.gid = self.get_widget("gid")
self.elist = person.getEventList()[:] self.elist = person.getEventList()[:]
self.nlist = person.getAlternateNames()[:] self.nlist = person.getAlternateNames()[:]
self.alist = person.getAttributeList()[:] self.alist = person.getAttributeList()[:]
@ -227,7 +227,7 @@ class EditPerson:
self.gid.set_text(person.getId()) self.gid.set_text(person.getId())
self.gid.set_editable(GrampsCfg.id_edit) self.gid.set_editable(GrampsCfg.id_edit)
self.event_list.set_column_visibility(3,GrampsCfg.show_detail) self.event_list.set_column_visibility(4,GrampsCfg.show_detail)
self.name_list.set_column_visibility(2,GrampsCfg.show_detail) self.name_list.set_column_visibility(2,GrampsCfg.show_detail)
self.attr_list.set_column_visibility(2,GrampsCfg.show_detail) self.attr_list.set_column_visibility(2,GrampsCfg.show_detail)
self.addr_list.set_column_visibility(2,GrampsCfg.show_detail) self.addr_list.set_column_visibility(2,GrampsCfg.show_detail)
@ -1387,7 +1387,7 @@ def disp_addr(addr):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def disp_event(event): def disp_event(event):
attr = Utils.get_detail_flags(event) attr = Utils.get_detail_flags(event)
return [const.display_pevent(event.getName()), return [const.display_pevent(event.getName()),event.getDescription(),
event.getQuoteDate(),event.getPlaceName(),attr] event.getQuoteDate(),event.getPlaceName(),attr]
def src_changed(parent): def src_changed(parent):

View File

@ -725,17 +725,17 @@ class GedcomParser:
self.parse_person_attr(attr,2) self.parse_person_attr(attr,2)
continue continue
else: else:
val = self.gedsource.tag2gramps(matches[1]) val = self.gedsource.tag2gramps(n)
if val: if val:
event.setName(val) event.setName(val)
else: else:
event.setName(matches[1]) event.setName(n)
self.parse_person_event(event,2) self.parse_person_event(event,2)
if matches[2] != None: if matches[2]:
event.setDescription(matches[2]) event.setDescription(matches[2])
self.person.addEvent(event) self.person.addEvent(event)
def parse_optional_note(self,level): def parse_optional_note(self,level):
note = "" note = ""
while 1: while 1:
@ -1119,20 +1119,15 @@ class GedcomParser:
self.person.addAltFamily(family,mrel,frel) self.person.addAltFamily(family,mrel,frel)
elif matches[1] == "PLAC": elif matches[1] == "PLAC":
val = matches[2] val = matches[2]
n = string.strip(event.getName()) if self.placemap.has_key(val):
if self.is_ftw and n in ["Occupation","Degree","SSN"]: place = self.placemap[val]
event.setDescription(val)
self.ignore_sub_junk(level+1)
else: else:
if self.placemap.has_key(val): place = Place()
place = self.placemap[val] place.set_title(matches[2])
else: self.db.addPlace(place)
place = Place() self.placemap[val] = place
place.set_title(matches[2]) event.setPlace(place)
self.db.addPlace(place) self.ignore_sub_junk(level+1)
self.placemap[val] = place
event.setPlace(place)
self.ignore_sub_junk(level+1)
elif matches[1] == "TYPE": elif matches[1] == "TYPE":
# eventually do something intelligent here # eventually do something intelligent here
pass pass
@ -1645,7 +1640,6 @@ class GedcomParser:
index = 0 index = 0
new_pmax = self.db.pmapIndex new_pmax = self.db.pmapIndex
for person in self.added.keys(): for person in self.added.keys():
print index,person.getPrimaryName().getName()
index = index + 1 index = index + 1
if self.refn.has_key(person): if self.refn.has_key(person):
val = self.refn[person] val = self.refn[person]