Issue 5218, fix of deadlock in StatisticsChart on Windows XP and Win7.
svn: r18614
This commit is contained in:
parent
5a28c86ae7
commit
4992228399
@ -643,6 +643,11 @@ class Extract(object):
|
|||||||
data.append((ext[name][1], {}, ext[name][2], ext[name][3]))
|
data.append((ext[name][1], {}, ext[name][2], ext[name][3]))
|
||||||
|
|
||||||
# go through the people and collect data
|
# go through the people and collect data
|
||||||
|
self.progress = ProgressMeter(_('Statistics Charts'))
|
||||||
|
self.progress.set_pass(total=100,
|
||||||
|
mode=ProgressMeter.MODE_ACTIVITY,
|
||||||
|
header=_('Collecting data...'))
|
||||||
|
|
||||||
for person_handle in filter_func.apply(db, db.iter_person_handles()):
|
for person_handle in filter_func.apply(db, db.iter_person_handles()):
|
||||||
|
|
||||||
person = db.get_person_from_handle(person_handle)
|
person = db.get_person_from_handle(person_handle)
|
||||||
@ -674,6 +679,8 @@ class Extract(object):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
self.get_person_data(person, data)
|
self.get_person_data(person, data)
|
||||||
|
self.progress.step()
|
||||||
|
self.progress.close()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
# GLOBAL: required so that we get access to _Extract.extractors[]
|
# GLOBAL: required so that we get access to _Extract.extractors[]
|
||||||
@ -727,16 +734,12 @@ class StatisticsChart(Report):
|
|||||||
'year_from': year_from,
|
'year_from': year_from,
|
||||||
'year_to': year_to
|
'year_to': year_to
|
||||||
}
|
}
|
||||||
self.progress = ProgressMeter(_('Statistics Charts'))
|
|
||||||
|
|
||||||
# extract requested items from the database and count them
|
# extract requested items from the database and count them
|
||||||
self.progress.set_pass(_('Collecting data...'), 1)
|
|
||||||
tables = _Extract.collect_data(database, self.filter, menu,
|
tables = _Extract.collect_data(database, self.filter, menu,
|
||||||
gender, year_from, year_to,
|
gender, year_from, year_to,
|
||||||
get_value('no_years'))
|
get_value('no_years'))
|
||||||
self.progress.step()
|
|
||||||
|
|
||||||
self.progress.set_pass(_('Sorting data...'), len(tables))
|
|
||||||
self.data = []
|
self.data = []
|
||||||
sortby = get_value('sortby')
|
sortby = get_value('sortby')
|
||||||
reverse = get_value('reverse')
|
reverse = get_value('reverse')
|
||||||
@ -750,7 +753,6 @@ class StatisticsChart(Report):
|
|||||||
else:
|
else:
|
||||||
heading = _("Persons born %(year_from)04d-%(year_to)04d: %(chart_title)s") % mapping
|
heading = _("Persons born %(year_from)04d-%(year_to)04d: %(chart_title)s") % mapping
|
||||||
self.data.append((heading, table[0], table[1], lookup))
|
self.data.append((heading, table[0], table[1], lookup))
|
||||||
self.progress.step()
|
|
||||||
#DEBUG
|
#DEBUG
|
||||||
#print heading
|
#print heading
|
||||||
#print table[1]
|
#print table[1]
|
||||||
@ -777,7 +779,8 @@ class StatisticsChart(Report):
|
|||||||
return index
|
return index
|
||||||
|
|
||||||
def write_report(self):
|
def write_report(self):
|
||||||
"output the selected statistics..."
|
"""output the selected statistics..."""
|
||||||
|
self.progress = ProgressMeter(_('Statistics Charts'))
|
||||||
|
|
||||||
self.progress.set_pass(_('Saving charts...'), len(self.data))
|
self.progress.set_pass(_('Saving charts...'), len(self.data))
|
||||||
for data in self.data:
|
for data in self.data:
|
||||||
|
Loading…
Reference in New Issue
Block a user