From d02640b6d1619beb6bc0d13cd2611b291bede899 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 10 Aug 2015 19:36:49 -0400 Subject: [PATCH] DictionaryDb: genderStats needs to be dict of TUPLES --- gramps/plugins/database/dictionarydb.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gramps/plugins/database/dictionarydb.py b/gramps/plugins/database/dictionarydb.py index 090bd6be8..9a5576c19 100644 --- a/gramps/plugins/database/dictionarydb.py +++ b/gramps/plugins/database/dictionarydb.py @@ -915,13 +915,19 @@ class DictionaryDb(DbGeneric): if person.primary_name: first_name = person.primary_name.first_name if first_name not in gstats: - gstats[first_name] = [0, 0, 0] + gstats[first_name] = (0, 0, 0) if person.gender == Person.MALE: - gstats[first_name][0] += 1 + gstats[first_name] = (gstats[first_name][0] + 1, + gstats[first_name][1], + gstats[first_name][2]) elif person.gender == Person.FEMALE: - gstats[first_name][1] += 1 + gstats[first_name] = (gstats[first_name][0], + gstats[first_name][1] + 1, + gstats[first_name][2]) else: - gstats[first_name][2] += 1 + gstats[first_name] = (gstats[first_name][0], + gstats[first_name][1], + gstats[first_name][2] + 1) return gstats def save_gender_stats(self, gstats):