2007-10-26 Benny Malengier <benny.malengier@gramps-project.org>
* src/plugins/rel_nl.py: various improvements svn: r9249
This commit is contained in:
parent
8220a39d65
commit
224c185a24
@ -1,3 +1,6 @@
|
|||||||
|
2007-10-26 Benny Malengier <benny.malengier@gramps-project.org>
|
||||||
|
* src/plugins/rel_nl.py: various improvements
|
||||||
|
|
||||||
2007-10-22 Benny Malengier <benny.malengier@gramps-project.org>
|
2007-10-22 Benny Malengier <benny.malengier@gramps-project.org>
|
||||||
* src/DisplayTabs/_GalleryTab.py: remove edit_callback, works via signals now
|
* src/DisplayTabs/_GalleryTab.py: remove edit_callback, works via signals now
|
||||||
|
|
||||||
|
@ -40,13 +40,13 @@ from PluginUtils import register_relcalc
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
_removed_level = [ " ",
|
_removed_level = [ " ",
|
||||||
" eerste graad",
|
" eerste",
|
||||||
" tweede graad",
|
" tweede",
|
||||||
" derde graad",
|
" derde",
|
||||||
" vierde graad",
|
" vierde",
|
||||||
" vijfde graad",
|
" vijfde",
|
||||||
" zesde graad",
|
" zesde",
|
||||||
" zevende graad",
|
" zevende",
|
||||||
" achtste",
|
" achtste",
|
||||||
" negende",
|
" negende",
|
||||||
" tiende",
|
" tiende",
|
||||||
@ -81,7 +81,7 @@ _parents_level = [ "",
|
|||||||
"oudovergrootouders",
|
"oudovergrootouders",
|
||||||
"oudbetovergrootouders",
|
"oudbetovergrootouders",
|
||||||
"stamouders",
|
"stamouders",
|
||||||
"stamgrootouders",
|
"stamgrootouders", # gen 10
|
||||||
"stamovergrootouders",
|
"stamovergrootouders",
|
||||||
"stambetovergrootouders",
|
"stambetovergrootouders",
|
||||||
"stamoudouders",
|
"stamoudouders",
|
||||||
@ -91,7 +91,7 @@ _parents_level = [ "",
|
|||||||
"edelouders",
|
"edelouders",
|
||||||
"edelgrootoders",
|
"edelgrootoders",
|
||||||
"edelovergrootoudouders",
|
"edelovergrootoudouders",
|
||||||
"edelbetovergrootouders",
|
"edelbetovergrootouders", # gen 20
|
||||||
"edeloudouders",
|
"edeloudouders",
|
||||||
"edeloudgrootouders",
|
"edeloudgrootouders",
|
||||||
"edeloudvergrootouders",
|
"edeloudvergrootouders",
|
||||||
@ -103,66 +103,66 @@ _parents_level = [ "",
|
|||||||
"edelstamoudouders" ]
|
"edelstamoudouders" ]
|
||||||
|
|
||||||
_father_level = [ "",
|
_father_level = [ "",
|
||||||
"vader (graad 1)",
|
"vader",
|
||||||
"grootvader (graad 2)",
|
"grootvader",
|
||||||
"overgrootvader (graad 3)",
|
"overgrootvader",
|
||||||
"betovergrootvader (graad 4)",
|
"betovergrootvader",
|
||||||
"oudvader (graad 5)",
|
"oudvader (generatie 5)",
|
||||||
"oudgrootvader (graad 6)",
|
"oudgrootvader (generatie 6)",
|
||||||
"oudovergrootvader(graad 7)",
|
"oudovergrootvader (generatie 7)",
|
||||||
"oudbetovergrootvader (graad 8)",
|
"oudbetovergrootvader (generatie 8)",
|
||||||
"stamvader graad 9)",
|
"stamvader (generatie 9)",
|
||||||
"stamgrootvader",
|
"stamgrootvader (generatie 10)",
|
||||||
"stamovergrootvader",
|
"stamovergrootvader (generatie 11)",
|
||||||
"stambetovergrootvader",
|
"stambetovergrootvader (generatie 12)",
|
||||||
"stamoudvader",
|
"stamoudvader (generatie 13)",
|
||||||
"stamoudgrootvader",
|
"stamoudgrootvader (generatie 14)",
|
||||||
"stamoudovergrootvader",
|
"stamoudovergrootvader (generatie 15)",
|
||||||
"stamoudbetovergrootvader",
|
"stamoudbetovergrootvader (generatie 16)",
|
||||||
"edelvader",
|
"edelvader (generatie 17)",
|
||||||
"edelgrootvader",
|
"edelgrootvader (generatie 18)",
|
||||||
"edelovergrootoudvader",
|
"edelovergrootoudvader (generatie 19)",
|
||||||
"edelbetovergrootvader",
|
"edelbetovergrootvader (generatie 20)",
|
||||||
"edeloudvader",
|
"edeloudvader (generatie 21)",
|
||||||
"edeloudgrootvader",
|
"edeloudgrootvader (generatie 22)",
|
||||||
"edeloudvergrootvader",
|
"edeloudvergrootvader (generatie 23)",
|
||||||
"edeloudbetovergrootvader",
|
"edeloudbetovergrootvader (generatie 24)",
|
||||||
"edelstamvader",
|
"edelstamvader (generatie 25)",
|
||||||
"edelstamgrootvader",
|
"edelstamgrootvader (generatie 26)",
|
||||||
"edelstamovergrootvader",
|
"edelstamovergrootvader (generatie 27)",
|
||||||
"edelstambetovergrootvader",
|
"edelstambetovergrootvader (generatie 28)",
|
||||||
"edelstamoudvader" ]
|
"edelstamoudvader (generatie 29)" ]
|
||||||
|
|
||||||
_mother_level = [ "",
|
_mother_level = [ "",
|
||||||
"moeder (graad 1)",
|
"moeder ",
|
||||||
"grootmoeder (graad 2)",
|
"grootmoeder",
|
||||||
"overgrootmoeder (graad 3)",
|
"overgrootmoeder",
|
||||||
"betovergrootmoeder (graad 4)",
|
"betovergrootmoeder",
|
||||||
"oudmoeder",
|
"oudmoeder (generatie 5)",
|
||||||
"oudgrootmoeder",
|
"oudgrootmoeder (generatie 6)",
|
||||||
"oudovergrootmoeder",
|
"oudovergrootmoeder (generatie 7)",
|
||||||
"oudbetovergrootmoeder",
|
"oudbetovergrootmoeder (generatie 8)",
|
||||||
"stammoeder",
|
"stammoeder (generatie 9)",
|
||||||
"stamgrootmoeder",
|
"stamgrootmoeder (generatie 10)",
|
||||||
"stamovergrootmoeder",
|
"stamovergrootmoeder (generatie 11)",
|
||||||
"stambetovergrootmoeder",
|
"stambetovergrootmoeder (generatie 12)",
|
||||||
"stamoudmoeder",
|
"stamoudmoeder (generatie 13)",
|
||||||
"stamoudgrootmoeder",
|
"stamoudgrootmoeder (generatie 14)",
|
||||||
"stamoudovergrootmoeder",
|
"stamoudovergrootmoeder (generatie 15)",
|
||||||
"stamoudbetovergrootmoeder",
|
"stamoudbetovergrootmoeder (generatie 16)",
|
||||||
"edelmoeder",
|
"edelmoeder (generatie 17)",
|
||||||
"edelgrootmoeder",
|
"edelgrootmoeder (generatie 18)",
|
||||||
"edelovergrootoudmoeder",
|
"edelovergrootoudmoeder (generatie 19)",
|
||||||
"edelbetovergrootmoeder",
|
"edelbetovergrootmoeder (generatie 20)",
|
||||||
"edeloudmoeder",
|
"edeloudmoeder (generatie 21)",
|
||||||
"edeloudgrootmoeder",
|
"edeloudgrootmoeder (generatie 22)",
|
||||||
"edeloudvergrootmoeder",
|
"edeloudvergrootmoeder (generatie 23)",
|
||||||
"edeloudbetovergrootmoeder",
|
"edeloudbetovergrootmoeder (generatie 24)",
|
||||||
"edelstammoeder",
|
"edelstammoeder (generatie 25)",
|
||||||
"edelstamgrootmoeder",
|
"edelstamgrootmoeder (generatie 26)",
|
||||||
"edelstamovergrootmoeder",
|
"edelstamovergrootmoeder (generatie 27)",
|
||||||
"edelstambetovergrootmoeder",
|
"edelstambetovergrootmoeder (generatie 28)",
|
||||||
"edelstamoudmoeder" ]
|
"edelstamoudmoeder (generatie 29)" ]
|
||||||
|
|
||||||
_son_level = [ "",
|
_son_level = [ "",
|
||||||
"zoon",
|
"zoon",
|
||||||
@ -178,22 +178,6 @@ _daughter_level = [ "",
|
|||||||
"achterachterkleindochter",
|
"achterachterkleindochter",
|
||||||
"achterachterachterkleindochter"]
|
"achterachterachterkleindochter"]
|
||||||
|
|
||||||
##_sister_level = [ "",
|
|
||||||
## "zuster",
|
|
||||||
## "tante",
|
|
||||||
## "groottante",
|
|
||||||
## "overgroottante" ,
|
|
||||||
## "betovergroottante",
|
|
||||||
## "oudtante"]
|
|
||||||
|
|
||||||
##_brother_level = [ "",
|
|
||||||
## "broer",
|
|
||||||
## "oom",
|
|
||||||
## "grootoom",
|
|
||||||
## "overgrootoom",
|
|
||||||
## "betovergrootoom",
|
|
||||||
## "oudoom" ]
|
|
||||||
|
|
||||||
_nephew_level = [ "",
|
_nephew_level = [ "",
|
||||||
"neef",
|
"neef",
|
||||||
"achterneef",
|
"achterneef",
|
||||||
@ -202,19 +186,20 @@ _nephew_level = [ "",
|
|||||||
_niece_level = [ "",
|
_niece_level = [ "",
|
||||||
"nicht",
|
"nicht",
|
||||||
"achternicht",
|
"achternicht",
|
||||||
"achterachtenicht"]
|
"achterachternicht"]
|
||||||
_aunt_level = [ "",
|
_aunt_level = [ "",
|
||||||
"tante",
|
"tante",
|
||||||
"groottante",
|
"groottante",
|
||||||
"overgroottante",
|
"overgroottante",
|
||||||
"betovergroottante",
|
"betovergroottante",
|
||||||
"oudtante"]
|
"oudtante (generatie 5)"]
|
||||||
|
|
||||||
_uncle_level = [ "",
|
_uncle_level = [ "",
|
||||||
"oom",
|
"oom",
|
||||||
"grootoom",
|
"grootoom",
|
||||||
"overgrootoom",
|
"overgrootoom",
|
||||||
"betovergrootoom"]
|
"betovergrootoom",
|
||||||
|
"oudoom (generatie 5)"]
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -226,72 +211,103 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
|||||||
Relationship.RelationshipCalculator.__init__(self,db)
|
Relationship.RelationshipCalculator.__init__(self,db)
|
||||||
|
|
||||||
def get_parents(self, level):
|
def get_parents(self, level):
|
||||||
if level>len(_parents_level)-1:
|
if level > len(_parents_level)-1:
|
||||||
return "verre voorouders"
|
return "verre voorouders (%d generaties)" % level
|
||||||
else:
|
else:
|
||||||
return _parents_level[level]
|
return _parents_level[level]
|
||||||
def get_father(self, level):
|
def get_father(self, level):
|
||||||
if level>len(_father_level)-1:
|
if level > len(_father_level)-1:
|
||||||
return "verre voorouder"
|
return "verre voorvader (%d generaties)" % level
|
||||||
else:
|
else:
|
||||||
return _father_level[level]
|
return _father_level[level]
|
||||||
|
|
||||||
def get_son(self, level):
|
def get_son(self, level):
|
||||||
if level>len(_son_level)-1:
|
if level < len(_son_level):
|
||||||
return "verre afstammeling"
|
|
||||||
else:
|
|
||||||
return _son_level[level]
|
return _son_level[level]
|
||||||
|
else:
|
||||||
|
return "verre achterkleinzoon (%d generaties)" % level
|
||||||
|
|
||||||
def get_mother(self,level):
|
def get_mother(self,level):
|
||||||
if level>len(_mother_level)-1:
|
if level > len(_mother_level)-1:
|
||||||
return "verre voorouder"
|
return "verre voormoeder (%d generaties)" % level
|
||||||
else:
|
else:
|
||||||
return _mother_level[level]
|
return _mother_level[level]
|
||||||
|
|
||||||
def get_daughter(self, level):
|
def get_daughter(self, level):
|
||||||
if level>len(_daughter_level)-1:
|
if level > len(_daughter_level)-1:
|
||||||
return "verre afstammelinge"
|
return "verre achterkleindochter (%d generaties)" % level
|
||||||
else:
|
else:
|
||||||
return _daughter_level[level]
|
return _daughter_level[level]
|
||||||
|
|
||||||
def get_aunt(self, level, removed):
|
def get_aunt(self, level, removed):
|
||||||
if level>len(_aunt_level)-1 or removed > len(_removed_level) -1:
|
if removed == 1 and level < len(_aunt_level):
|
||||||
return "verre voorouder"
|
return _aunt_level[level]
|
||||||
|
elif level > len(_aunt_level)-1 or removed > len(_removed_level) -1:
|
||||||
|
return "verre tante (%d generaties, %d graden)" % (level, removed)
|
||||||
|
elif level > len(_aunt_level)-1:
|
||||||
|
return "verre tante van de%s graad (%d generaties)" \
|
||||||
|
% (_removed_level[removed], level)
|
||||||
else:
|
else:
|
||||||
return _aunt_level[level] + _removed_level[removed]
|
return _aunt_level[level] + _removed_level[removed] + " graad"
|
||||||
|
|
||||||
def get_uncle(self, level, removed):
|
def get_uncle(self, level, removed):
|
||||||
if level>len(_uncle_level)-1 or removed > len(_removed_level) -1:
|
if removed == 1 and level < len(_uncle_level):
|
||||||
return "verre voorouder"
|
return _uncle_level[level]
|
||||||
|
elif level > len(_uncle_level)-1 or removed > len(_removed_level) -1:
|
||||||
|
return "verre oom (%d generaties, %d graden)" % (level, removed)
|
||||||
|
elif level > len(_uncle_level)-1:
|
||||||
|
return "verre oom van de%s graad (%d generaties)" \
|
||||||
|
% (_removed_level[removed], level)
|
||||||
else:
|
else:
|
||||||
return _uncle_level[level] + _removed_level[removed]
|
return _uncle_level[level] + _removed_level[removed] + " graad"
|
||||||
|
|
||||||
def get_nephew(self,level, removed):
|
def get_nephew(self, level, removed=1):
|
||||||
if level>len(_nephew_level)-1 or removed > len(_removed_level) -1:
|
if removed == 1 and level < len(_nephew_level):
|
||||||
return "verre voorouder"
|
return _nephew_level[level]
|
||||||
|
elif level > len(_nephew_level)-1 or removed > len(_removed_level) -1:
|
||||||
|
return "verre neef (%d generaties, %d graden)" % (level, removed)
|
||||||
|
elif level > len(_nephew_level)-1:
|
||||||
|
return "verre neef van de%s graad (%d generaties)" \
|
||||||
|
% (_removed_level[removed], level)
|
||||||
else:
|
else:
|
||||||
return _nephew_level[level] + _removed_level[removed]
|
return _nephew_level[level] + _removed_level[removed] + " graad"
|
||||||
|
|
||||||
def get_niece(self,level, removed):
|
def get_niece(self, level, removed=1):
|
||||||
if level>len(_niece_level)-1 or removed > len(_removed_level) -1:
|
if removed == 1 and level < len(_niece_level):
|
||||||
return "verre afstammelinge"
|
return _niece_level[level]
|
||||||
|
if level > len(_niece_level)-1 or removed > len(_removed_level) -1:
|
||||||
|
return "verre nicht (%d generaties, %d graden)" % (level, removed)
|
||||||
|
elif level > len(_niece_level)-1:
|
||||||
|
return "verre nicht van de%s graad (%d generaties)" \
|
||||||
|
% (_removed_level[removed], level)
|
||||||
else:
|
else:
|
||||||
return _niece_level[level] + _removed_level[removed]
|
return _niece_level[level] + _removed_level[removed] + " graad"
|
||||||
|
|
||||||
def get_male_cousin(self,removed):
|
def get_male_cousin(self,removed):
|
||||||
if removed>len(_removed_level)-1:
|
"""Specific Dutch thing, the nieces/nephews on same level are called
|
||||||
return "verre afstammeling"
|
going sideways in a branch as the nieces/newphews going downward
|
||||||
|
from your brother/sisters. This used to be called "kozijn"
|
||||||
|
"""
|
||||||
|
removed = removed - 1
|
||||||
|
if removed > len(_removed_level)-1:
|
||||||
|
return "verre neef (kozijn, %d graden)" % removed
|
||||||
elif removed == 0:
|
elif removed == 0:
|
||||||
return "broer"
|
return "broer"
|
||||||
else:
|
else:
|
||||||
return "neef "+_removed_level[removed]
|
return "neef (kozijn)"+_removed_level[removed] + " graad"
|
||||||
|
|
||||||
def get_female_cousin(self,removed):
|
def get_female_cousin(self,removed):
|
||||||
if removed>len(_removed_level)-1:
|
"""Specific Dutch thing, the nieces/nephews on same level are called
|
||||||
return "verre afstammelinge"
|
going sideways in a branch as the nieces/newphews going downward
|
||||||
elif removed == 0:
|
from your brother/sisters. This used to be called "kozijn"
|
||||||
return " zus"
|
"""
|
||||||
|
removed = removed - 1
|
||||||
|
if removed > len(_removed_level)-1:
|
||||||
|
return "verre nicht (kozijn, %d graden)" % removed
|
||||||
|
elif removed == 0:
|
||||||
|
return "zus"
|
||||||
else:
|
else:
|
||||||
return "nicht "+ _removed_level[removed]
|
return "nicht (kozijn)"+ _removed_level[removed] + " graad"
|
||||||
|
|
||||||
def get_relationship(self,orig_person,other_person):
|
def get_relationship(self,orig_person,other_person):
|
||||||
"""
|
"""
|
||||||
@ -323,6 +339,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
|||||||
secondRel = len(secondRel)
|
secondRel = len(secondRel)
|
||||||
|
|
||||||
if firstRel == 0:
|
if firstRel == 0:
|
||||||
|
#other person is ancestor
|
||||||
if secondRel == 0:
|
if secondRel == 0:
|
||||||
return ('',common)
|
return ('',common)
|
||||||
elif other_person.get_gender() == RelLib.Person.MALE:
|
elif other_person.get_gender() == RelLib.Person.MALE:
|
||||||
@ -330,51 +347,31 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
|
|||||||
else:
|
else:
|
||||||
return (self.get_mother(secondRel), common)
|
return (self.get_mother(secondRel), common)
|
||||||
elif secondRel == 0:
|
elif secondRel == 0:
|
||||||
|
#other person is descendant
|
||||||
if other_person.get_gender() == RelLib.Person.MALE:
|
if other_person.get_gender() == RelLib.Person.MALE:
|
||||||
return (self.get_son(firstRel), common)
|
return (self.get_son(firstRel), common)
|
||||||
else:
|
else:
|
||||||
return (self.get_daughter(firstRel), common)
|
return (self.get_daughter(firstRel), common)
|
||||||
elif secondRel > firstRel:
|
elif secondRel > firstRel:
|
||||||
|
#other person is higher in the branch, in english uncle/aunt or
|
||||||
|
#cousin up, in dutch always 'oom/tante'
|
||||||
if other_person.get_gender() == RelLib.Person.MALE:
|
if other_person.get_gender() == RelLib.Person.MALE:
|
||||||
return (self.get_uncle(secondRel - firstRel,firstRel), common)
|
return (self.get_uncle(secondRel - firstRel,firstRel), common)
|
||||||
else:
|
else:
|
||||||
return (self.get_aunt(secondRel - firstRel, firstRel), common)
|
return (self.get_aunt(secondRel - firstRel, firstRel), common)
|
||||||
elif secondRel < firstRel:
|
elif secondRel < firstRel:
|
||||||
|
#other person is lower in the branch, in english niece/nephew or
|
||||||
|
#cousin down, in dutch always 'neef/nicht'
|
||||||
if other_person.get_gender() == RelLib.Person.MALE:
|
if other_person.get_gender() == RelLib.Person.MALE:
|
||||||
return (self.get_nephew(firstRel - secondRel, secondRel), common)
|
return (self.get_nephew(firstRel - secondRel, secondRel), common)
|
||||||
else:
|
else:
|
||||||
return (self.get_niece(firstRel - secondRel, secondRel), common)
|
return (self.get_niece(firstRel - secondRel, secondRel), common)
|
||||||
else:
|
else:
|
||||||
if other_person.get_gender() == RelLib.Person.MALE:
|
# people on the same level secondRel == firstRel
|
||||||
return (self.get_male_cousin(firstRel -1), common)
|
if other_person.get_gender() == RelLib.Person.MALE:
|
||||||
else:
|
return (self.get_male_cousin(firstRel), common)
|
||||||
return (self.get_female_cousin(firstRel -1), common)
|
else:
|
||||||
## elif firstRel == 2 and secondRel == 2:
|
return (self.get_female_cousin(firstRel), common)
|
||||||
## if other_person.get_gender() == RelLib.Person.MALE:
|
|
||||||
## return ('de neef',common)
|
|
||||||
## else:
|
|
||||||
## return ('de nicht',common)
|
|
||||||
## elif firstRel == 3 and secondRel == 2:
|
|
||||||
## if other_person.get_gender() == RelLib.Person.MALE:
|
|
||||||
## return ('neef',common)
|
|
||||||
## else:
|
|
||||||
## return ('nicht',common)
|
|
||||||
## elif firstRel == 2 and secondRel == 3:
|
|
||||||
## if other_person.get_gender() == RelLib.Person.MALE:
|
|
||||||
## return ('de oom',common)
|
|
||||||
## else:
|
|
||||||
## return ('de tante',common)
|
|
||||||
## else:
|
|
||||||
## if other_person.get_gender() == RelLib.Person.MALE:
|
|
||||||
## if firstRel+secondRel>len(_level_name)-1:
|
|
||||||
## return (self.get_male_cousin(firstRel+secondRel),common)
|
|
||||||
## else:
|
|
||||||
## return ('verre neef',common)
|
|
||||||
## else:
|
|
||||||
## if firstRel+secondRel>len(_level_name)-1:
|
|
||||||
## return (self.get_female_cousin(firstRel+secondRel),common)
|
|
||||||
## else:
|
|
||||||
## return ('verre nicht',common)
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user