* src/ReadGedcom.py (parse_family_object): Set MediaRef properly

* src/Marriage.py (__init__): Properly get place title


svn: r4395
This commit is contained in:
Martin Hawlisch
2005-04-21 09:54:53 +00:00
parent 3aebc669e3
commit d43ec2d13c
3 changed files with 20 additions and 8 deletions

View File

@ -1209,14 +1209,19 @@ class GedcomParser:
self.warn("\n\t\t".join(path))
self.warn('\n')
else:
photo = RelLib.MediaObject()
photo.set_path(path)
photo.set_description(title)
photo.set_mime_type(GrampsMime.get_type(os.path.abspath(path)))
self.db.add_object(photo, self.trans)
photo_handle = self.media_map.get(path)
if photo_handle == None:
photo = RelLib.MediaObject()
photo.set_path(path)
photo.set_description(title)
photo.set_mime_type(GrampsMime.get_type(os.path.abspath(path)))
self.db.add_object(photo, self.trans)
self.media_map[path] = photo.get_handle()
else:
photo = self.db.get_object_from_handle(photo_handle)
oref = RelLib.MediaRef()
oref.set_reference_handle(photo.get_handle())
self.family.add_media_reference(photo)
self.family.add_media_reference(oref)
self.db.commit_family(self.family, self.trans)
def parse_residence(self,address,level):