Add ChildRef class, reorganize RelLib.

svn: r6320
This commit is contained in:
Alex Roitman
2006-04-13 03:15:22 +00:00
parent 0eb3838f92
commit 7a61396025
38 changed files with 696 additions and 469 deletions

View File

@@ -248,8 +248,8 @@ class GraphViz:
family = self.database.get_family_from_handle(family_handle)
father_handle = family.get_father_handle()
mother_handle = family.get_mother_handle()
fadopted = frel != RelLib.Person.CHILD_BIRTH
madopted = mrel != RelLib.Person.CHILD_BIRTH
fadopted = frel != RelLib.ChildRef.CHILD_BIRTH
madopted = mrel != RelLib.ChildRef.CHILD_BIRTH
famid = family.get_gramps_id().replace('-','_')
if (self.show_families and
(father_handle and person_dict.has_key(father_handle) or

View File

@@ -263,7 +263,10 @@ class GeneWebParser:
if child:
self.current_family.add_child_handle(child.get_handle())
self.db.commit_family(self.current_family,self.trans)
child.add_parent_family_handle(self.current_family.get_handle(),RelLib.Person.CHILD_REL_BIRTH,RelLib.Person.CHILD_REL_BIRTH)
child.add_parent_family_handle(
self.current_family.get_handle(),
RelLib.ChildRef.CHILD_REL_BIRTH,
RelLib.ChildRef.CHILD_REL_BIRTH)
if self.current_child_birthplace_handle:
birth_handle = child.get_birth_handle()
birth = self.db.get_event_from_handle(birth_handle)

View File

@@ -1764,7 +1764,7 @@ class IndividualPage(BasePage):
val)
else:
of.write(nameof(person,self.exclude_private))
if rel != RelLib.Person.CHILD_BIRTH:
if rel != RelLib.ChildRef.CHILD_BIRTH:
of.write('   (%s)' % Utils.format_child_relation(rel))
of.write('</td>\n')

View File

@@ -520,7 +520,7 @@ class TestcaseGenerator(Tool.Tool):
person2.add_family_handle(fam_h)
self.db.commit_person(person2,self.trans)
child = self.db.get_person_from_handle(child_h)
child.add_parent_family_handle(fam_h,(RelLib.Person.CHILD_BIRTH,''),(RelLib.Person.CHILD_BIRTH,''))
child.add_parent_family_handle(fam_h,(RelLib.ChildRef.CHILD_BIRTH,''),(RelLib.ChildRef.CHILD_BIRTH,''))
self.db.commit_person(child,self.trans)
self.commit_transaction() # COMMIT TRANSACTION STEP
@@ -901,10 +901,10 @@ class TestcaseGenerator(Tool.Tool):
fam.add_child_handle(child_h)
self.db.commit_family(fam,self.trans)
child = self.db.get_person_from_handle(child_h)
rel1 = (RelLib.Person.CHILD_BIRTH,'')
rel1 = (RelLib.ChildRef.CHILD_BIRTH,'')
if randint(0,2) == 1:
rel1 = self.rand_type(Utils.child_relations)
rel2 = (RelLib.Person.CHILD_BIRTH,'')
rel2 = (RelLib.ChildRef.CHILD_BIRTH,'')
if randint(0,2) == 1:
rel2 = self.rand_type(Utils.child_relations)
child.add_parent_family_handle(fam_h, rel1, rel2)
@@ -952,10 +952,10 @@ class TestcaseGenerator(Tool.Tool):
person2 = self.db.get_person_from_handle(person2_h)
person2.add_family_handle(fam_h)
self.db.commit_person(person2,self.trans)
rel1 = (RelLib.Person.CHILD_BIRTH,'')
rel1 = (RelLib.ChildRef.CHILD_BIRTH,'')
if randint(0,2) == 1:
rel1 = self.rand_type(Utils.child_relations)
rel2 = (RelLib.Person.CHILD_BIRTH,'')
rel2 = (RelLib.ChildRef.CHILD_BIRTH,'')
if randint(0,2) == 1:
rel2 = self.rand_type(Utils.child_relations)
child.add_parent_family_handle(fam_h, rel1, rel2)