* src/WriteGedcom.py (write_sources, write_person, write_ord):

Use gramps id instead of handle.
* src/GenericFilter.py: Check object for being not None.


svn: r3467
This commit is contained in:
Alex Roitman 2004-08-22 05:33:37 +00:00
parent 41e0ff14a8
commit 355c3865f5
3 changed files with 18 additions and 14 deletions

View File

@ -37,6 +37,10 @@
* src/plugins/Check.py: Import const module. * src/plugins/Check.py: Import const module.
* src/PedView.py: Add person to the list even if there are no parents. * src/PedView.py: Add person to the list even if there are no parents.
* src/WriteGedcom.py (write_sources, write_person, write_ord):
Use gramps id instead of handle.
* src/GenericFilter.py: Check object for being not None.
2004-08-20 Don Allingham <dallingham@users.sourceforge.net> 2004-08-20 Don Allingham <dallingham@users.sourceforge.net>
* src/gramps_main.py: update family display after EditPerson * src/gramps_main.py: update family display after EditPerson
* src/EditPerson.py: fix callback * src/EditPerson.py: fix callback

View File

@ -169,8 +169,8 @@ class RelationshipPathBetween(Rule):
p = self.db.get_person_from_handle(p_id) p = self.db.get_person_from_handle(p_id)
for fam_id in p.get_family_handle_list(): for fam_id in p.get_family_handle_list():
if fam_id: fam = self.db.get_family_from_handle(fam_id)
fam = self.db.get_family_from_handle(fam_id) if fam:
for child_handle in fam.get_child_handle_list(): for child_handle in fam.get_child_handle_list():
if child_handle: if child_handle:
self.desc_list(child_handle,map,0) self.desc_list(child_handle,map,0)
@ -351,8 +351,8 @@ class IsDescendantOf(Rule):
p = self.db.get_person_from_handle(p_id) p = self.db.get_person_from_handle(p_id)
for fam_id in p.get_family_handle_list(): for fam_id in p.get_family_handle_list():
if fam_id: fam = self.db.get_family_from_handle(fam_id)
fam = self.db.get_family_from_handle(fam_id) if fam:
for child_handle in fam.get_child_handle_list(): for child_handle in fam.get_child_handle_list():
self.init_list(child_handle,0) self.init_list(child_handle,0)
@ -635,8 +635,8 @@ class IsAncestorOf(Rule):
p = self.db.get_person_from_handle(p_id) p = self.db.get_person_from_handle(p_id)
fam_id = p.get_main_parents_family_handle() fam_id = p.get_main_parents_family_handle()
if fam_id: fam = self.db.get_family_from_handle(fam_id)
fam = self.db.get_family_from_handle(fam_id) if fam:
f_id = fam.get_father_handle() f_id = fam.get_father_handle()
m_id = fam.get_mother_handle() m_id = fam.get_mother_handle()
@ -732,8 +732,8 @@ class IsLessThanNthGenerationAncestorOf(Rule):
p = self.db.get_person_from_handle(p_id) p = self.db.get_person_from_handle(p_id)
fam_id = p.get_main_parents_family_handle() fam_id = p.get_main_parents_family_handle()
if fam_id: fam = self.db.get_family_from_handle(fam_id)
fam = self.db.get_family_from_handle(fam_id) if fam:
f_id = fam.get_father_handle() f_id = fam.get_father_handle()
m_id = fam.get_mother_handle() m_id = fam.get_mother_handle()
@ -785,8 +785,8 @@ class IsMoreThanNthGenerationAncestorOf(Rule):
p = self.db.get_person_from_handle(p_id) p = self.db.get_person_from_handle(p_id)
fam_id = p.get_main_parents_family_handle() fam_id = p.get_main_parents_family_handle()
if fam_id: fam = self.db.get_family_from_handle(fam_id)
fam = self.db.get_family_from_handle(fam_id) if fam:
f_id = fam.get_father_handle() f_id = fam.get_father_handle()
m_id = fam.get_mother_handle() m_id = fam.get_mother_handle()

View File

@ -817,7 +817,7 @@ class GedcomWriter:
index = 0.0 index = 0.0
for key in self.slist.keys(): for key in self.slist.keys():
source = self.db.get_source_from_handle(key) source = self.db.get_source_from_handle(key)
self.writeln("0 @%s@ SOUR" % self.sid(source.get_handle())) self.writeln("0 @%s@ SOUR" % self.sid(source.get_gramps_id()))
if source.get_title(): if source.get_title():
self.writeln("1 TITL %s" % fmtline(self.cnvtxt(source.get_title()),248,1,self.nl)) self.writeln("1 TITL %s" % fmtline(self.cnvtxt(source.get_title()),248,1,self.nl))
if source.get_author(): if source.get_author():
@ -912,7 +912,7 @@ class GedcomWriter:
fam = f[0] fam = f[0]
break break
if fam: if fam:
self.writeln('2 FAMC @%s@' % self.fid(fam.get_handle())) self.writeln('2 FAMC @%s@' % self.fid(fam.get_gramps_id()))
if mrel == frel: if mrel == frel:
self.writeln('3 ADOP BOTH') self.writeln('3 ADOP BOTH')
elif mrel == "adopted": elif mrel == "adopted":
@ -938,7 +938,7 @@ class GedcomWriter:
fam = f[0] fam = f[0]
break break
if fam: if fam:
self.writeln('2 FAMC @%s@' % self.fid(fam.get_handle())) self.writeln('2 FAMC @%s@' % self.fid(fam.get_gramps_id()))
if mrel == frel: if mrel == frel:
self.writeln('3 ADOP BOTH') self.writeln('3 ADOP BOTH')
elif mrel == "adopted": elif mrel == "adopted":
@ -1137,7 +1137,7 @@ class GedcomWriter:
self.writeln('%d %s' % (index,name)) self.writeln('%d %s' % (index,name))
self.print_date("%d DATE" % (index + 1), ord.get_date_object()) self.print_date("%d DATE" % (index + 1), ord.get_date_object())
if ord.get_family_handle(): if ord.get_family_handle():
self.writeln('%d FAMC @%s@' % (index+1,self.fid(ord.get_family_handle().get_handle()))) self.writeln('%d FAMC @%s@' % (index+1,self.fid(ord.get_family_handle().get_gramps_id())))
if ord.get_temple(): if ord.get_temple():
self.writeln('%d TEMP %s' % (index+1,ord.get_temple())) self.writeln('%d TEMP %s' % (index+1,ord.get_temple()))
if ord.get_place_handle(): if ord.get_place_handle():