* 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

@ -1,3 +1,7 @@
2005-04-21 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/ReadGedcom.py (parse_family_object): Set MediaRef properly
* src/Marriage.py (__init__): Properly get place title
2005-04-20 Don Allingham <don@gramps-project.org>
* src/DbPrompter.py: handle runtime errors issued by
gnomevfs.get_mime_type

View File

@ -236,8 +236,11 @@ class Marriage:
lds_ord = self.family.get_lds_sealing()
if lds_ord:
if lds_ord.get_place_handle():
self.lds_place.child.set_text(lds_ord.get_place_handle().get_title())
place_handle = lds_ord.get_place_handle()
if place_handle:
place = self.db.get_place_from_handle( place_handle)
if place:
self.lds_place.child.set_text( place.get_title())
self.lds_date.set_text(lds_ord.get_date())
self.seal_stat = lds_ord.get_status()
self.lds_date_object = lds_ord.get_date_object()

View File

@ -1209,14 +1209,19 @@ class GedcomParser:
self.warn("\n\t\t".join(path))
self.warn('\n')
else:
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):