Skip to content

Commit

Permalink
cleanup on spouses indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
romjerome authored Apr 19, 2023
1 parent 44a8567 commit d14ad26
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions GeneanetForGramps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,13 +1347,13 @@ def random_headers():
sosa = a.find('img')
if sosa is None:
try:
sname.append(str(a.xpath('text()')[s]).title())
sname.append(str(a.xpath('text()')[0]).title())
if verbosity >= 2:
print(_("Spouse name:"), sname[s])
except:
sname.append("")
try:
sref.append(str(a.xpath('attribute::href')[s]))
sref.append(str(a.xpath('attribute::href')[0]))
if verbosity >= 2:
print(_("Spouse ref:"), ROOTURL+sref[s])
except:
Expand All @@ -1364,24 +1364,24 @@ def random_headers():
s = s + 1
continue
try:
marriage.append(str(spouse.xpath('em/text()')[s]))
marriage.append(str(spouse.xpath('em/text()')[0]))
except:
marriage.append(None)
try:
ld = convert_date(marriage[s].split(',')[s].split()[1:])
ld = convert_date(marriage[s].split(',')[0].split()[1:])
if verbosity >= 2:
print(_("Married:"), ld)
self.marriagedate.append(format_ca(ld))
except:
self.marriagedate.append(None)
try:
self.marriageplace.append(str(marriage[s].split(',')[1][1:]).title())
self.marriageplace.append(str(marriage[0].split(',')[1][1:]).title())
if verbosity >= 2:
print(_("Married place:"), self.marriageplace[s])
except:
self.marriageplace.append(str(marriage[s]))
self.marriageplace.append(str(marriage[0]))
try:
marriageplacecode = str(marriage[s].split(',')[2][1:])
marriageplacecode = str(marriage[0].split(',')[2][1:])
match = re.search(r'\d\d\d\d\d', marriageplacecode)
if not match:
self.marriageplacecode.append(_("not match"))
Expand Down

0 comments on commit d14ad26

Please sign in to comment.