* src/ReadGedcom.py: add a few more items to parse from Legacy
generated GEDCOM files svn: r4596
This commit is contained in:
parent
791f96417f
commit
a4f66df140
@ -1,3 +1,7 @@
|
|||||||
|
2005-05-14 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/ReadGedcom.py: add a few more items to parse from Legacy
|
||||||
|
generated GEDCOM files
|
||||||
|
|
||||||
2005-05-14 Alex Roitman <shura@gramps-project.org>
|
2005-05-14 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/data/Makefile.am: Always install gramps.schemas and gramps.xml,
|
* src/data/Makefile.am: Always install gramps.schemas and gramps.xml,
|
||||||
with or without packager mode.
|
with or without packager mode.
|
||||||
|
@ -573,7 +573,7 @@ class GedcomParser:
|
|||||||
title = matches[2] + self.parse_continue_data(level+1)
|
title = matches[2] + self.parse_continue_data(level+1)
|
||||||
title = title.replace('\n',' ')
|
title = title.replace('\n',' ')
|
||||||
self.source.set_title(title)
|
self.source.set_title(title)
|
||||||
elif matches[1] == "TAXT" or matches[1] == "PERI": # EasyTree Sierra On-Line
|
elif matches[1] in ["TAXT","PERI"]: # EasyTree Sierra On-Line
|
||||||
if self.source.get_title() == "":
|
if self.source.get_title() == "":
|
||||||
title = matches[2] + self.parse_continue_data(level+1)
|
title = matches[2] + self.parse_continue_data(level+1)
|
||||||
title = title.replace('\n',' ')
|
title = title.replace('\n',' ')
|
||||||
@ -603,7 +603,7 @@ class GedcomParser:
|
|||||||
note = "%s %s" % (matches[1],matches[2])
|
note = "%s %s" % (matches[1],matches[2])
|
||||||
|
|
||||||
def parse_record(self):
|
def parse_record(self):
|
||||||
while 1:
|
while True:
|
||||||
matches = self.get_next()
|
matches = self.get_next()
|
||||||
if matches[2] == "FAM":
|
if matches[2] == "FAM":
|
||||||
if self.fam_count % UPDATE == 0 and self.window:
|
if self.fam_count % UPDATE == 0 and self.window:
|
||||||
@ -914,9 +914,9 @@ class GedcomParser:
|
|||||||
def parse_individual(self):
|
def parse_individual(self):
|
||||||
name_cnt = 0
|
name_cnt = 0
|
||||||
note = ""
|
note = ""
|
||||||
while 1:
|
while True:
|
||||||
matches = self.get_next()
|
matches = self.get_next()
|
||||||
|
|
||||||
if int(matches[0]) < 1:
|
if int(matches[0]) < 1:
|
||||||
self.backup()
|
self.backup()
|
||||||
return
|
return
|
||||||
@ -1074,7 +1074,7 @@ class GedcomParser:
|
|||||||
attr.set_type(matches[1])
|
attr.set_type(matches[1])
|
||||||
attr.set_value(matches[2])
|
attr.set_value(matches[2])
|
||||||
self.person.add_attribute(attr)
|
self.person.add_attribute(attr)
|
||||||
elif matches[1] in ["CHAN","ASSO","ANCI","DESI","RIN"]:
|
elif matches[1] in ["CHAN","ASSO","ANCI","DESI","RIN","_TODO"]:
|
||||||
self.ignore_sub_junk(2)
|
self.ignore_sub_junk(2)
|
||||||
else:
|
else:
|
||||||
event = RelLib.Event()
|
event = RelLib.Event()
|
||||||
@ -1150,9 +1150,12 @@ class GedcomParser:
|
|||||||
filename = ""
|
filename = ""
|
||||||
title = "no title"
|
title = "no title"
|
||||||
note = ""
|
note = ""
|
||||||
while 1:
|
while True:
|
||||||
matches = self.get_next()
|
matches = self.get_next()
|
||||||
if matches[1] == "FORM":
|
if int(matches[0]) < level:
|
||||||
|
self.backup()
|
||||||
|
break
|
||||||
|
elif matches[1] == "FORM":
|
||||||
form = matches[2].lower()
|
form = matches[2].lower()
|
||||||
elif matches[1] == "TITL":
|
elif matches[1] == "TITL":
|
||||||
title = matches[2]
|
title = matches[2]
|
||||||
@ -1162,9 +1165,6 @@ class GedcomParser:
|
|||||||
note = matches[2] + self.parse_continue_data(level+1)
|
note = matches[2] + self.parse_continue_data(level+1)
|
||||||
elif matches[1][0] == "_":
|
elif matches[1][0] == "_":
|
||||||
self.ignore_sub_junk(level+1)
|
self.ignore_sub_junk(level+1)
|
||||||
elif int(matches[0]) < level:
|
|
||||||
self.backup()
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
self.barf(level+1)
|
self.barf(level+1)
|
||||||
|
|
||||||
@ -1357,6 +1357,8 @@ class GedcomParser:
|
|||||||
event.set_name(name)
|
event.set_name(name)
|
||||||
else:
|
else:
|
||||||
event.set_description(matches[2])
|
event.set_description(matches[2])
|
||||||
|
elif matches[1] == "_PRIV" and matches[2] == "Y":
|
||||||
|
event.set_privacy(True)
|
||||||
elif matches[1] == "DATE":
|
elif matches[1] == "DATE":
|
||||||
event.set_date_object(self.extract_date(matches[2]))
|
event.set_date_object(self.extract_date(matches[2]))
|
||||||
elif matches[1] == "SOUR":
|
elif matches[1] == "SOUR":
|
||||||
@ -1585,10 +1587,13 @@ class GedcomParser:
|
|||||||
return
|
return
|
||||||
elif matches[1] == "PAGE":
|
elif matches[1] == "PAGE":
|
||||||
source.set_page(matches[2] + self.parse_continue_data(level+1))
|
source.set_page(matches[2] + self.parse_continue_data(level+1))
|
||||||
|
elif matches[1] == "DATE":
|
||||||
|
source.set_date_object(self.extract_date(matches[2]))
|
||||||
elif matches[1] == "DATA":
|
elif matches[1] == "DATA":
|
||||||
date,text = self.parse_source_data(level+1)
|
date,text = self.parse_source_data(level+1)
|
||||||
d = self.dp.parse(date)
|
if date:
|
||||||
source.set_date_object(d)
|
d = self.dp.parse(date)
|
||||||
|
source.set_date_object(d)
|
||||||
source.set_text(text)
|
source.set_text(text)
|
||||||
elif matches[1] in ["OBJE","REFN","TEXT"]:
|
elif matches[1] in ["OBJE","REFN","TEXT"]:
|
||||||
self.ignore_sub_junk(level+1)
|
self.ignore_sub_junk(level+1)
|
||||||
|
Loading…
Reference in New Issue
Block a user