Patches from Alexandre Duret-Lutz

svn: r1179
This commit is contained in:
Don Allingham 2002-11-11 13:28:36 +00:00
parent c8dc6063b5
commit 4d28689c85
3 changed files with 26 additions and 8 deletions

View File

@ -175,7 +175,8 @@ class AddSpouse:
self.person.addFamily(family)
spouse.addFamily(family)
if self.person.getGender() == RelLib.Person.male:
if (self.person.getGender() == RelLib.Person.male
or spouse.getGender() == RelLib.Person.female):
family.setMother(spouse)
family.setFather(self.person)
else:
@ -322,10 +323,17 @@ class SetSpouse:
return
Utils.modified()
if self.family.getFather() == self.person:
# Recompute the family relation. self.person is already
# a father or mother, but in case (s)he had an unknown
# gender, adding a spouse might swap roles.
if (self.person.getGender() == RelLib.Person.male
or spouse.getGender() == RelLib.Person.female):
self.family.setMother(spouse)
self.family.setFather(self.person)
else:
self.family.setFather(spouse)
self.family.setMother(self.person)
spouse.addFamily(self.family)

View File

@ -627,9 +627,19 @@ class LaTeXDoc(TextDoc):
def write_text(self,text):
"""Write the text to the file"""
if not self.in_listing:
# Quote unsafe characters.
text = string.replace(text,'\\','\\\\')
text = string.replace(text,'$','\\$')
text = string.replace(text,'&','\\&')
text = string.replace(text,'%','\\%')
text = string.replace(text,'#','\\#')
text = string.replace(text,'{','\\{')
text = string.replace(text,'}','\\}')
text = string.replace(text,'_','\\_')
text = string.replace(text,'^','\\verb+^+')
text = string.replace(text,'~','\\verb+~+')
if text == '\n':
text = '\\newline\n'
text = string.replace(text,'#','\#')
self.f.write(text)
if text:
self.last_char_written = text[-1]

View File

@ -121,8 +121,8 @@ class CheckIntegrity:
if father.getGender() == mother.getGender():
family.setRelationship("Partners")
self.fam_rel.append(family)
elif father.getGender() != RelLib.Person.male or \
mother.getGender() != RelLib.Person.female:
elif (father.getGender() == RelLib.Person.female or
mother.getGender() == RelLib.Person.male):
family.setFather(mother)
family.setMother(father)
self.fam_rel.append(family)