* src/plugins/ReadGedcom.py: More source parsing cleanups.

(parse_source_objects): Remove redundant function.


svn: r2591
This commit is contained in:
Alex Roitman 2004-01-06 06:11:28 +00:00
parent 1a1eb05059
commit 5615876d2a
2 changed files with 2 additions and 39 deletions

View File

@ -1,5 +1,6 @@
2004-01-05 Alex Roitman <shura@alex.neuro.umn.edu> 2004-01-05 Alex Roitman <shura@alex.neuro.umn.edu>
* src/plugins/ReadGedcom.py: More source parsing cleanups. * src/plugins/ReadGedcom.py: More source parsing cleanups.
(parse_source_objects): Remove redundant function.
2004-01-04 Alex Roitman <shura@alex.neuro.umn.edu> 2004-01-04 Alex Roitman <shura@alex.neuro.umn.edu>
* src/plugins/ReadGedcom.py: Correct level in parsing LDS ordinance * src/plugins/ReadGedcom.py: Correct level in parsing LDS ordinance

View File

@ -963,44 +963,6 @@ class GedcomParser:
oref.setReference(photo) oref.setReference(photo)
self.person.addPhoto(oref) self.person.addPhoto(oref)
def parse_source_object(self,source,level):
form = ""
file = ""
title = ""
note = ""
while 1:
matches = self.get_next()
if matches[1] == "FORM":
form = string.lower(matches[2])
elif matches[1] == "TITL":
title = matches[2]
elif matches[1] == "FILE":
file = matches[2]
elif matches[1] == "NOTE":
note = matches[2] + self.parse_continue_data(level+1)
elif int(matches[0]) < level:
self.backup()
break
else:
self.barf(level+1)
if form:
(ok,path) = self.find_file(file,self.dir_path)
if not ok:
self.warn(_("Warning: could not import %s") % file + "\n")
self.warn(_("\tThe following paths were tried:\n\t\t"))
self.warn(string.join(path,"\n\t\t"))
self.warn('\n')
else:
photo = RelLib.Photo()
photo.setPath(path)
photo.setDescription(title)
photo.setMimeType(Utils.get_mime_type(path))
self.db.addObject(photo)
oref = RelLib.ObjectRef()
oref.setReference(photo)
source.addPhoto(oref)
def parse_family_object(self,level): def parse_family_object(self,level):
form = "" form = ""
file = "" file = ""