Some pylint improvements
This commit is contained in:
parent
fb886c5954
commit
29b0e824a2
@ -61,6 +61,7 @@ from gramps.gen.datehandler import parser
|
||||
from gramps.gen.display.place import displayer as _pd
|
||||
from gramps.gen.proxy import CacheProxyDb
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Private Functions
|
||||
@ -159,6 +160,7 @@ def draw_pie_chart(doc, center_x, center_y, radius, data, start=0):
|
||||
start, start + incr)
|
||||
start += incr
|
||||
|
||||
|
||||
def draw_legend(doc, start_x, start_y, data, title, label_style):
|
||||
"""
|
||||
Draws a legend for a graph in the specified document. The data passed is
|
||||
@ -199,9 +201,11 @@ def draw_legend(doc, start_x, start_y, data, title, label_style):
|
||||
start_x + (3 * size), start_y - (size * 0.25))
|
||||
start_y += size * 1.3
|
||||
|
||||
|
||||
_TTT = time.localtime(time.time())
|
||||
_TODAY = parser.parse("%04d-%02d-%02d" % _TTT[:3])
|
||||
|
||||
|
||||
def estimate_age(dbase, person,
|
||||
end_handle=None, start_handle=None, today=_TODAY):
|
||||
"""
|
||||
@ -292,6 +296,7 @@ def estimate_age(dbase, person,
|
||||
age = (lower, upper)
|
||||
return age
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Global options and their names
|
||||
@ -317,6 +322,7 @@ def _T_(value): # enable deferred translations (see Python docs 22.1.3.4)
|
||||
return value
|
||||
# _T_ is a gramps-defined keyword -- see po/update_po.py and po/genpot.sh
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Data extraction methods from the database
|
||||
@ -647,7 +653,6 @@ class Extract:
|
||||
else:
|
||||
chart[1][key] = 1
|
||||
|
||||
|
||||
def collect_data(self, dbase, people, menu, genders,
|
||||
year_from, year_to, no_years, cb_progress, rlocale):
|
||||
"""goes through the database and collects the selected personal
|
||||
@ -722,10 +727,12 @@ class Extract:
|
||||
self.get_person_data(person, data)
|
||||
return data
|
||||
|
||||
|
||||
# GLOBAL: required so that we get access to _Extract.extractors[]
|
||||
# Unfortunately class variables cannot reference instance methods :-/
|
||||
_Extract = Extract()
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Statistics report
|
||||
@ -862,7 +869,6 @@ class StatisticsChart(Report):
|
||||
self._user.step_progress()
|
||||
self._user.end_progress()
|
||||
|
||||
|
||||
def output_piechart(self, title1, typename, data, lookup):
|
||||
|
||||
# set layout variables
|
||||
@ -905,7 +911,6 @@ class StatisticsChart(Report):
|
||||
text = self._("%s (persons):") % self._(typename)
|
||||
draw_legend(self.doc, legendx, yoffset, chart_data, text, 'SC-legend')
|
||||
|
||||
|
||||
def output_barchart(self, title1, typename, data, lookup):
|
||||
|
||||
pt2cm = utils.pt2cm
|
||||
@ -974,6 +979,7 @@ class StatisticsChart(Report):
|
||||
|
||||
return
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# StatisticsChartOptions
|
||||
|
Loading…
x
Reference in New Issue
Block a user