Fixed date handling for GEDCOM

svn: r600
This commit is contained in:
Don Allingham 2001-12-01 04:23:42 +00:00
parent be6a870a01
commit 13b2796ead
10 changed files with 454 additions and 196 deletions

View File

@ -839,7 +839,7 @@ class SingleDate:
if self.month == UNDEF: if self.month == UNDEF:
raise Date.Error,text raise Date.Error,text
self.day = int(matches[1]) self.day = int(matches[1])
if len(matches) == 4: if len(matches) == 4 and matches[3] != None:
self.setYearVal(matches[3]) self.setYearVal(matches[3])
else: else:
self.year = UNDEF self.year = UNDEF

View File

@ -959,7 +959,7 @@ class EditPerson:
d = Date() d = Date()
d.set(date) d.set(date)
if compare_dates(d,ord.getDateObj()) != 0: if compare_dates(d,ord.getDateObj()) != 0:
ord.setDateObj(date) ord.setDateObj(d)
utils.modified() utils.modified()
if ord.getTemple() != temple: if ord.getTemple() != temple:
ord.setTemple(temple) ord.setTemple(temple)

View File

@ -122,12 +122,16 @@ class GrampsParser:
def start_lds_ord(self,attrs): def start_lds_ord(self,attrs):
type = u2l(attrs['type']) type = u2l(attrs['type'])
self.ord = LdsOrd() self.ord = LdsOrd()
if type == "baptism": if self.person:
self.person.setLdsBaptism(self.ord) if type == "baptism":
elif type == "endowment": self.person.setLdsBaptism(self.ord)
self.person.setLdsEndowment(self.ord) elif type == "endowment":
else: self.person.setLdsEndowment(self.ord)
self.person.setLdsSeal(self.ord) elif type == "sealed_to_parents":
self.person.setLdsSeal(self.ord)
elif self.family:
if type == "sealed_to_spouse":
self.family.setLdsSeal(self.ord)
def start_temple(self,attrs): def start_temple(self,attrs):
self.ord.setTemple(u2l(attrs['val'])) self.ord.setTemple(u2l(attrs['val']))

View File

@ -40,6 +40,11 @@ import ImageSelect
from intl import gettext from intl import gettext
_ = gettext _ = gettext
_temple_names = const.lds_temple_codes.keys()
_temple_names.sort()
_temple_names = [""] + _temple_names
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Marriage class # Marriage class
@ -47,19 +52,15 @@ _ = gettext
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class Marriage: class Marriage:
#-------------------------------------------------------------------------
#
# Initializes the class, and displays the window
#
#-------------------------------------------------------------------------
def __init__(self,family,db): def __init__(self,family,db):
"""Initializes the Marriage class, and displays the window"""
self.family = family self.family = family
self.db = db self.db = db
self.path = db.getSavePath() self.path = db.getSavePath()
self.top = libglade.GladeXML(const.marriageFile,"marriageEditor") self.top = libglade.GladeXML(const.marriageFile,"marriageEditor")
top_window = self.get_widget("marriageEditor") top_window = self.get_widget("marriageEditor")
fid = "f%s" % family.getId() fid = family.getId()
plwidget = self.top.get_widget("photolist") plwidget = self.top.get_widget("photolist")
self.gallery = ImageSelect.Gallery(family, self.path, fid, plwidget, db) self.gallery = ImageSelect.Gallery(family, self.path, fid, plwidget, db)
self.top.signal_autoconnect({ self.top.signal_autoconnect({
@ -103,6 +104,8 @@ class Marriage:
self.attr_value = self.get_widget("attr_value") self.attr_value = self.get_widget("attr_value")
self.event_details = self.get_widget("event_details") self.event_details = self.get_widget("event_details")
self.attr_details_field = self.get_widget("attr_details") self.attr_details_field = self.get_widget("attr_details")
self.lds_date = self.get_widget("lds_date")
self.lds_temple = self.get_widget("lds_temple")
self.event_list.set_column_visibility(3,Config.show_detail) self.event_list.set_column_visibility(3,Config.show_detail)
self.attr_list.set_column_visibility(2,Config.show_detail) self.attr_list.set_column_visibility(2,Config.show_detail)
@ -119,6 +122,18 @@ class Marriage:
self.type_field.entry.set_text(frel) self.type_field.entry.set_text(frel)
self.gid.set_text(family.getId()) self.gid.set_text(family.getId())
self.gid.set_editable(Config.id_edit) self.gid.set_editable(Config.id_edit)
ord = family.getLdsSeal()
self.lds_temple.set_popdown_strings(_temple_names)
if ord:
self.lds_date.set_text(ord.getDate())
if ord.getTemple() != "":
name = const.lds_temple_to_abrev[ord.getTemple()]
else:
name = ""
self.lds_temple.entry.set_text(name)
else:
self.lds_temple.entry.set_text("")
# set notes data # set notes data
self.notes_field.set_point(0) self.notes_field.set_point(0)
@ -168,6 +183,24 @@ class Marriage:
if self.family.getId() != idval: if self.family.getId() != idval:
changed = 1 changed = 1
date = self.lds_date.get_text()
temple = self.lds_temple.entry.get_text()
if const.lds_temple_codes.has_key(temple):
temple = const.lds_temple_codes[temple]
else:
temple = ""
ord = self.family.getLdsSeal()
if not ord:
if date or temple:
changed = 1
else:
d = Date()
d.set(date)
if compare_dates(d,ord.getDateObj()) != 0:
changed = 1
elif ord.getTemple() != temple:
changed = 1
return changed return changed
def on_cancel_edit(self,obj): def on_cancel_edit(self,obj):
@ -220,6 +253,30 @@ class Marriage:
self.family.setNote(text) self.family.setNote(text)
utils.modified() utils.modified()
date = self.lds_date.get_text()
temple = self.lds_temple.entry.get_text()
if const.lds_temple_codes.has_key(temple):
temple = const.lds_temple_codes[temple]
else:
temple = ""
ord = self.family.getLdsSeal()
if not ord:
if date or temple:
ord = LdsOrd()
ord.setDate(date)
ord.setTemple(temple)
self.family.setLdsSeal(ord)
utils.modified()
else:
d = Date()
d.set(date)
if compare_dates(d,ord.getDateObj()) != 0:
ord.setDateObj(d)
utils.modified()
if ord.getTemple() != temple:
ord.setTemple(temple)
utils.modified()
utils.destroy_passed_object(self.get_widget("marriageEditor")) utils.destroy_passed_object(self.get_widget("marriageEditor"))
self.update_lists() self.update_lists()

View File

@ -616,6 +616,10 @@ class Address(DataObj):
"""returns the Date object associated with the Address""" """returns the Date object associated with the Address"""
return self.date return self.date
def setDateObj(self,obj):
"""sets the Date object associated with the Address"""
self.date = obj
def setStreet(self,val): def setStreet(self,val):
"""sets the street portion of the Address""" """sets the street portion of the Address"""
self.street = val self.street = val
@ -1246,6 +1250,13 @@ class Family:
self.note = Note() self.note = Note()
self.attributeList = [] self.attributeList = []
self.position = None self.position = None
self.lds_seal = None
def setLdsSeal(self,ord):
self.lds_seal = ord
def getLdsSeal(self):
return self.lds_seal
def setPosition(self,pos): def setPosition(self,pos):
"""sets a graphical location pointer for graphic display (x,y)""" """sets a graphical location pointer for graphic display (x,y)"""

View File

@ -604,6 +604,7 @@ def write_xml_data(database, g, callback, sp):
for event in family.getEventList(): for event in family.getEventList():
dump_event(g,event,3) dump_event(g,event,3)
dump_ordinance(g,"sealed_to_spouse",family.getLdsSeal(),3)
write_photo_list(g,family.getPhotoList()) write_photo_list(g,family.getPhotoList())

View File

@ -513,181 +513,180 @@ places = []
surnames = [] surnames = []
lds_temple_codes = { lds_temple_codes = {
"ALBERTA" : "ALBER", "Cardston, Alberta" : "ALBER",
"APIA" : "SAMOA", "Apia, Samoa" : "APIA",
"ARIZONA" : "ARIZO", "Mesa, Arizona" : "ARIZO",
"ATLANTA GA": "ATLAN", "Atlanta Georgia" : "ATLAN",
"BOGOTA COL.": "BOGOT", "Bogota Columbia" : "BOGOT",
"BOISE ID": "BOISE", "Boise Idaho" : "BOISE",
"BOUNTIFUL UT": "BOUNT", "Bountiful Utah" : "BOUNT",
"BUENOS AIRES": "BAIRE", "Buenos Aires, Argentina" : "BAIRE",
"CHICAGO IL": "CHICA", "Chicago, Illinois" : "CHICA",
"COCHABAMBA, BOLIVA": "COCHA", "Cochabamba, Boliva" : "COCHA",
"DALLAS, TX": "DALLA", "Dallas, Texas" : "DALLA",
"DENVER, CO": "DENVE", "Denver, Colorado" : "DENVE",
"ENDOWMENT HOUSE": "EHOUS", "Endowment House" : "EHOUS",
"FRANKFURT": "FRANK", "Frankfurt, Germany" : "FRANK",
"FREIBERG": "FREIB", "Freiberg, Germany" : "FREIB",
"GUATAMALA": "GUATE", "Guatamala City, Guatamala": "GUATE",
"GUAYAQUIL, ECUADOR": "GUAYA", "Guayaquil, Ecuador" : "GUAYA",
"HARTFORD, CONN": "HARTF", "Hartford, Connecticut" : "HARTF",
"HAWAII": "HAWAI", "Laie, Hawaii" : "HAWAI",
"HONG KONG": "HKONG", "Hong Kong, China" : "HKONG",
"IDAHO FALLS, ID": "IFALL", "Idaho Falls, Idaho" : "IFALL",
"JOHANNESBURG, S.A.": "JOHAN", "Johannesburg, South Africa" : "JOHAN",
"JORDAN RIVER, UT": "JRIVE", "Sourth Jordan, Utah" : "JRIVE",
"LAS VEGAS, NV": "LVEGA", "Las Vegas, Nevada" : "LVEGA",
"LIMA, PERU": "LIMA" , "Lima, Peru" : "LIMA" ,
"LOGAN, UT": "LOGAN", "Logan, Utah" : "LOGAN",
"LONDON": "LONDO", "London, England" : "LONDO",
"LOS ANGELES, CA": "LANGE", "Los Angeles, California" : "LANGE",
"MADRID, SPAIN": "MADRI", "Madrid, Spain" : "MADRI",
"MANILA, PHILIPPINES": "MANIL", "Manila, Philippines" : "MANIL",
"MANTI, UT": "MANTI", "Manti, Utah" : "MANTI",
"MEXICO CITY": "MEXIC", "Mexico City, Mexico" : "MEXIC",
"MT. TIMPANOGAS, UT": "MTIMP", "American Fork, Utah" : "MTIMP",
"NASHVILLE, TENN": "NASHV", "Nashville, Tennessee" : "NASHV",
"NAUVOO": "NAUVO", "Nauvoo, Illinois" : "NAUVO",
"NEW ZEALAND": "NZEAL", "Hamilton, New Zealand" : "NZEAL",
"NUKU'ALOFA, TONGA": "NUKUA", "Nuku'alofa, Tonga" : "NUKUA",
"OAKLAND, CA": "OAKLA", "Oakland, California" : "OAKLA",
"OGDEN, UT": "OGDEN", "Ogden, Utah" : "OGDEN",
"ORLANDO, FL": "ORLAN", "Orlando, Florida" : "ORLAN",
"PAPEETE, TAHITI": "PAPEE", "Papeete, Tahiti" : "PAPEE",
"PORTLAND, OR": "PORTL", "Portland, Oregon" : "PORTL",
"PRESIDENT'S OFFICE": "POFFI", "President's Office" : "POFFI",
"PRESTON, ENG": "PREST", "Preston, England" : "PREST",
"PROVO, UT": "PROVO", "Provo, Utah" : "PROVO",
"RECIFE, BRAZIL": "RECIF", "Recife, Brazil" : "RECIF",
"SALT LAKE, UT": "SLAKE", "Salt Lake City, Utah" : "SLAKE",
"SAN DIEGO, CA": "SDIEG", "San Diego, California" : "SDIEG",
"SANTIAGO, CHILE": "SANTI", "Santiago, Chile" : "SANTI",
"SANTO DOMINGO, D.R.": "SDOMI", "Santo Domingo, Dominican Republic" : "SDOMI",
"SAO PAULO, BRAZ": "SPAUL", "Sao Paulo, Brazil" : "SPAUL",
"SEATTLE, WA": "SEATT", "Seattle, Washington" : "SEATT",
"SEOUL, KOREA": "SEOUL", "Seoul, South Korea" : "SEOUL",
"ST. GEORGE, UT": "SGEOR", "St. George, Utah" : "SGEOR",
"ST. LOUIS, MISSOURI": "SLOUI", "St. Louis, Missouri" : "SLOUI",
"STOCKHOLM, SWDN": "STOCK", "Stockholm, Sweden" : "STOCK",
"SWISS": "SWISS", "Bern, Switzerland" : "SWISS",
"SYDNEY, AUST": "SYDNE", "Sydney, Australia" : "SYDNE",
"TAIPEI, TAIWAN": "TAIPE", "Taipei, Taiwan" : "TAIPE",
"TOKYO, JAPAN": "TOKYO", "Tokyo, Japan" : "TOKYO",
"TORONTO, CAN.": "TORNO", "Toronto, Ontario" : "TORNO",
"VERNAL, UT.": "VERNA", "Vernal, Utah" : "VERNA",
"WASHINGTON, DC": "WASHI", "Washington, D.C." : "WASHI",
} }
lds_temple_to_abrev = { lds_temple_to_abrev = {
"ALBER": "ALBERTA" , "ALBER": "Cardston, Alberta",
"SAMOA": "APIA" , "APIA" : "Apia, Samoa",
"AP": "APIA" , "AP" : "Apia, Samoa",
"APIA": "APIA" , "ARIZO": "Mesa, Arizona",
"ARIZO": "ARIZONA" , "AZ" : "Mesa, Arizona",
"AZ": "ARIZONA" , "ATLAN": "Atlanta, Georgia",
"ATLAN": "ATLANTA GA", "AT" : "Atlanta, Georgia",
"AT": "ATLANTA GA", "BOGOT": "Bogota, Columbia",
"BOGOT": "BOGOTA COL.", "BG" : "Bogota, Columbia",
"BG": "BOGOTA COL.", "BOISE": "Boise Idaho",
"BOISE": "BOISE ID", "BO" : "Boise Idaho",
"BO": "BOISE ID", "BOUNT": "Bountiful, Utah",
"BOUNT": "BOUNTIFUL UT", "BAIRE": "Buenos Aires, Argentina",
"BAIRE": "BUENOS AIRES", "BA" : "Buenos Aires, Argentina",
"BA": "BUENOS AIRES", "CHICA": "Chicago, Illinois",
"CHICA": "CHICAGO IL", "CH" : "Chicago, Illinois",
"CH": "CHICAGO IL", "COCHA": "Cochabamba, Boliva",
"COCHA": "COCHABAMBA, BOLIVA", "DALLA": "Dallas, Texas",
"DALLA": "DALLAS, TX", "DA" : "Dallas, Texas",
"DA": "DALLAS, TX", "DENVE": "Denver, Colorado",
"DENVE": "DENVER, CO", "DV" : "Denver, Colorado",
"DV": "DENVER, CO", "EHOUS": "Endowment House",
"EHOUS": "ENDOWMENT HOUSE", "EH" : "Endowment House",
"EH": "ENDOWMENT HOUSE", "FRANK": "Frankfurt, Germany",
"FRANK": "FRANKFURT", "FR" : "Frankfurt, Germany",
"FR": "FRANKFURT", "FREIB": "Freiberg, Germany",
"FREIB": "FREIBERG", "FD" : "Freiberg, Germany",
"FD": "FREIBERG", "GUATE": "Guatamala City, Guatamala",
"GUATE": "GUATAMALA", "GA" : "Guatamala City, Guatamala",
"GA": "GUATAMALA", "GUAYA": "Guayaquil, Ecuador",
"GUAYA": "GUAYAQUIL, ECUADOR", "GY" : "Guayaquil, Ecuador",
"GY": "GUAYAQUIL, ECUADOR", "HARTF": "Hartford, Connecticut",
"HARTF": "HARTFORD, CONN", "HAWAI": "Laie, Hawaii",
"HAWAI": "HAWAII", "HA" : "Laie, Hawaii",
"HA": "HAWAII", "HKONG": "Hong Kong, China",
"HKONG": "HONG KONG", "IFALL": "Idaho Falls, Idaho",
"IFALL": "IDAHO FALLS, ID", "IF" : "Idaho Falls, Idaho",
"IF": "IDAHO FALLS, ID", "JOHAN": "Johannesburg, South Africa",
"JOHAN": "JOHANNESBURG, S.A.", "JO" : "Johannesburg, South Africa",
"JO": "JOHANNESBURG, S.A.", "JRIVE": "South Jordan, Utah",
"JRIVE": "JORDAN RIVER, UT", "JR" : "South Jorhan, Utah",
"JR": "JORDAN RIVER, UT", "LVEGA": "Las Vegas, Nevada",
"LVEGA": "LAS VEGAS, NV", "LV" : "Las Vegas, Nevada",
"LV": "LAS VEGAS, NV", "LIMA" : "Lima, Peru",
"LIMA" : "LIMA, PERU", "LI" : "Lima, Peru",
"LI": "LIMA, PERU", "LOGAN": "Logan, Utah",
"LOGAN": "LOGAN, UT", "LG" : "Logan, Utah",
"LG": "LOGAN, UT", "LONDO": "London, England",
"LONDO": "LONDON", "LD" : "London, England",
"LD": "LONDON", "LANGE": "Los Angeles, California",
"LANGE": "LOS ANGELES, CA", "LA" : "Los Angeles, California",
"LA": "LOS ANGELES, CA", "MADRI": "Madrid, Spain",
"MADRI": "MADRID, SPAIN", "MANIL": "Manila, Philippines",
"MANIL": "MANILA, PHILIPPINES", "MA" : "Manila, Philippines",
"MA": "MANILA, PHILIPPINES", "MANTI": "Manti, Utah",
"MANTI": "MANTI, UT", "MT" : "Manti, Utah",
"MT": "MANTI, UT", "MEXIC": "Mexico City, Mexico",
"MEXIC": "MEXICO CITY", "MX" : "Mexico City, Mexico",
"MX": "MEXICO CITY", "MTIMP": "American Fork, Utah",
"MTIMP": "MT. TIMPANOGAS, UT", "NASHV": "Nashville, Tennessee",
"NASHV": "NASHVILLE, TENN", "NAUVO": "Nauvoo, Illinois",
"NAUVO": "NAUVOO", "NZEAL": "Hamilton, New Zealand",
"NZEAL": "NEW ZEALAND", "NZ" : "Hamilton, New Zealand",
"NZ": "NEW ZEALAND", "NUKUA": "Nuku'alofa, Tonga",
"NUKUA": "NUKU'ALOFA, TONGA", "TG" : "Nuku'alofa, Tonga",
"TG": "NUKU'ALOFA, TONGA", "OAKLA": "Oakland, California",
"OAKLA": "OAKLAND, CA", "OK" : "Oakland, California",
"OK": "OAKLAND, CA", "OGDEN": "Ogden, Utah",
"OGDEN": "OGDEN, UT", "OG" : "Ogden, Utah",
"OG": "OGDEN, UT", "ORLAN": "Orlando, Florida",
"ORLAN": "ORLANDO, FL", "PAPEE": "Papeete, Tahiti",
"PAPEE": "PAPEETE, TAHITI", "TA" : "Papeete, Tahiti",
"TA": "PAPEETE, TAHITI", "PORTL": "Portland, Oregon",
"PORTL": "PORTLAND, OR", "PT" : "Portland, Oregon",
"PT": "PORTLAND, OR", "POFFI": "President's Office",
"POFFI": "PRESIDENT'S OFFICE", "PREST": "Preston, England",
"PREST": "PRESTON, ENG", "PROVO": "Provo, Utah",
"PROVO": "PROVO, UT", "PV" : "Provo, Utah",
"PV": "PROVO, UT", "RECIF": "Recife, Brazil",
"RECIF": "RECIFE, BRAZIL", "SLAKE": "Salt Lake City, Utah",
"SLAKE": "SALT LAKE, UT", "SL" : "Salt Lake City, Utah",
"SL": "SALT LAKE, UT", "SDIEG": "San Diego, California",
"SDIEG": "SAN DIEGO, CA", "SA" : "San Diego, California",
"SA": "SAN DIEGO, CA", "SANTI": "Santiago, Chile",
"SANTI": "SANTIAGO, CHILE", "SN" : "Santiago, Chile",
"SN": "SANTIAGO, CHILE", "SDOMI": "Santo Domingo, Dominican Republic",
"SDOMI": "SANTO DOMINGO, D.R.", "SPAUL": "Sao Paulo, Brazil",
"SPAUL": "SAO PAULO, BRAZ", "SP" : "Sao Paulo, Brazil",
"SP": "SAO PAULO, BRAZ", "SEATT": "Seattle, Washington",
"SEATT": "SEATTLE, WA", "SE" : "Seattle, Washington",
"SE": "SEATTLE, WA", "SEOUL": "Seoul, South Korea",
"SEOUL": "SEOUL, KOREA", "SO" : "Seoul, South Korea",
"SO": "SEOUL, KOREA", "SGEOR": "St. George, Utah",
"SGEOR": "ST. GEORGE, UT", "SG" : "St. George, Utah",
"SG": "ST. GEORGE, UT", "SLOUI": "St. Louis, Missouri",
"SLOUI": "ST. LOUIS, MISSOURI", "STOCK": "Stockholm, Sweden",
"STOCK": "STOCKHOLM, SWDN", "ST" : "Stockholm, Sweden",
"ST": "STOCKHOLM, SWDN", "SWISS": "Bern, Switzerland",
"SWISS": "SWISS", "SW" : "Bern, Switzerland",
"SW": "SWISS", "SYDNE": "Sydney, Australia",
"SYDNE": "SYDNEY, AUST", "SD" : "Sydney, Australia",
"SD": "SYDNEY, AUST", "TAIPE": "Taipei, Taiwan",
"TAIPE": "TAIPEI, TAIWAN", "TP" : "Taipei, Taiwan",
"TP": "TAIPEI, TAIWAN", "TOKYO": "Tokyo, Japan",
"TOKYO": "TOKYO, JAPAN", "TK" : "Tokyo, Japan",
"TK": "TOKYO, JAPAN", "TORNO": "Toronto, Ontario",
"TORNO": "TORONTO, CAN.", "TR" : "Toronto, Ontario",
"TR": "TORONTO, CAN.", "VERNA": "Vernal, Utah",
"VERNA": "VERNAL, UT.", "WASHI": "Washington, D.C.",
"WASHI": "WASHINGTON, DC", "WA" : "Washington, D.C.",
"WA": "WASHINGTON, DC",
} }

View File

@ -952,11 +952,11 @@ def sort_child_list(clist):
clist.sort() clist.sort()
if ListColors.get_enable(): if ListColors.get_enable():
try: try:
oddbg = GdkColor(ListColors.oddbg[0],ListColors.oddbg[1],ListColors.oddbg[2]) oddbg = gtk.GdkColor(ListColors.oddbg[0],ListColors.oddbg[1],ListColors.oddbg[2])
oddfg = GdkColor(ListColors.oddfg[0],ListColors.oddfg[1],ListColors.oddfg[2]) oddfg = gtk.GdkColor(ListColors.oddfg[0],ListColors.oddfg[1],ListColors.oddfg[2])
evenbg = GdkColor(ListColors.evenbg[0],ListColors.evenbg[1],ListColors.evenbg[2]) evenbg = gtk.GdkColor(ListColors.evenbg[0],ListColors.evenbg[1],ListColors.evenbg[2])
evenfg = GdkColor(ListColors.evenfg[0],ListColors.evenfg[1],ListColors.evenfg[2]) evenfg = gtk.GdkColor(ListColors.evenfg[0],ListColors.evenfg[1],ListColors.evenfg[2])
ancestorfg = GdkColor(ListColors.ancestorfg[0],ListColors.ancestorfg[1],ListColors.ancestorfg[2]) ancestorfg = gtk.GdkColor(ListColors.ancestorfg[0],ListColors.ancestorfg[1],ListColors.ancestorfg[2])
rows = clist.rows rows = clist.rows
for i in range(0,rows): for i in range(0,rows):
clist.set_background(i,(evenbg,oddbg)[i%2]) clist.set_background(i,(evenbg,oddbg)[i%2])

View File

@ -1357,6 +1357,180 @@
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>GtkVBox</class>
<name>vbox35</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkLabel</class>
<name>label233</name>
<label>Spouse Sealing</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator6</name>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkTable</class>
<name>table11</name>
<rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label234</name>
<label>Date</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>5</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label235</name>
<label>Temple</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>5</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>lds_date</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>lds_temple</name>
<value_in_list>True</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items></items>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>combo-entry2</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label232</name>
<label>LDS</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>
</widget> </widget>
</widget> </widget>

View File

@ -470,6 +470,7 @@ class GedcomParser:
def parse_individual(self): def parse_individual(self):
name_cnt = 0 name_cnt = 0
note = ""
while 1: while 1:
matches = self.get_next() matches = self.get_next()
@ -513,7 +514,11 @@ class GedcomParser:
self.parse_person_object(2) self.parse_person_object(2)
elif matches[1] == "NOTE": elif matches[1] == "NOTE":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[2] + self.parse_continue_data() note = self.person.getNote()
if note == "":
note = matches[2] + self.parse_continue_data()
else:
note = "%s\n\n%s%s" % (note,matches[2],self.parse_continue_data())
self.person.setNote(note) self.person.setNote(note)
self.ignore_sub_junk(2) self.ignore_sub_junk(2)
else: else:
@ -533,7 +538,10 @@ class GedcomParser:
elif matches[1] == "FAMS": elif matches[1] == "FAMS":
family = self.db.findFamily(matches[2],self.fmap) family = self.db.findFamily(matches[2],self.fmap)
self.person.addFamily(family) self.person.addFamily(family)
note = self.parse_optional_note(2) if note == "":
note = self.parse_optional_note(2)
else:
note = "%s\n\n%s" % (note,self.parse_optional_note(2))
elif matches[1] == "FAMC": elif matches[1] == "FAMC":
type,note = self.parse_famc_type(2) type,note = self.parse_famc_type(2)
family = self.db.findFamily(matches[2],self.fmap) family = self.db.findFamily(matches[2],self.fmap)
@ -1039,12 +1047,14 @@ class GedcomParser:
if attr.getValue() == "": if attr.getValue() == "":
attr.setValue(val) attr.setValue(val)
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
elif matches[1] == "DATE":
note = "%s\n\n" % ("Date : %s" % matches[2])
elif matches[1] == "NOTE": elif matches[1] == "NOTE":
info = matches[2] + self.parse_continue_data() info = matches[2] + self.parse_continue_data()
if note == "": if note == "":
note = info note = info
else: else:
note = "\n%s" % info note = "%s\n\n%s" % (note,info)
elif matches[1] == "CONC": elif matches[1] == "CONC":
if self.broken_conc: if self.broken_conc:
attr.setValue("%s %s" % (attr.getValue(), matches[2])) attr.setValue("%s %s" % (attr.getValue(), matches[2]))
@ -1054,6 +1064,8 @@ class GedcomParser:
attr.setValue("%s\n%s" % (attr.getValue(),matches[2])) attr.setValue("%s\n%s" % (attr.getValue(),matches[2]))
else: else:
self.barf(level+1) self.barf(level+1)
if note != "":
attr.setNote(note)
def parse_family_event(self,event,level): def parse_family_event(self,event,level):
global ged2fam global ged2fam