From 943dbc97b4adfa5ea2db6f5d77e0be967184dfa0 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 16 Jan 2010 23:02:10 +0000 Subject: [PATCH] Added a yield occasionaly in main svn: r14083 --- src/plugins/gramplet/AgeStats.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/gramplet/AgeStats.py b/src/plugins/gramplet/AgeStats.py index d6da72e3f..96af416ff 100644 --- a/src/plugins/gramplet/AgeStats.py +++ b/src/plugins/gramplet/AgeStats.py @@ -87,9 +87,10 @@ class AgeStatsGramplet(Gramplet): mother_handles = [[] for age in range(self.max_mother_diff)] father_handles = [[] for age in range(self.max_father_diff)] text = "" - + count = 0 for p in self.dbstate.db.iter_people(): - yield True + if count % 300 == 0: + yield True # if birth_date and death_date, compute age birth_ref = p.get_birth_ref() birth_date = None @@ -158,6 +159,7 @@ class AgeStatsGramplet(Gramplet): # print "Mother diff out of range: %d for %s" % (diff, # p.get_primary_name().get_first_name() # + " " + p.get_primary_name().get_surname()) + count += 1 width = self.chart_width graph_width = width - 8 self.create_bargraph(age_dict, age_handles, _("Lifespan Age Distribution"), _("Age"), graph_width, 5, self.max_age)