retire the legacy "ReportUtils" class name
This commit is contained in:
parent
091caed234
commit
0972b69f89
@ -38,7 +38,7 @@ from gi.repository import Pango
|
||||
#-------------------------------------------------------------------------
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.display.name import displayer as name_displayer
|
||||
from gramps.gen.display.place import displayer as place_displayer
|
||||
from gramps.gen.const import URL_MANUAL_SECT3
|
||||
@ -230,14 +230,14 @@ class MergePerson(ManagedWindow):
|
||||
(fname, mname, pid) = self.get_parent_info(fid)
|
||||
family = self.database.get_family_from_handle(fid)
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('Family ID'), pid))
|
||||
spouse_id = ReportUtils.find_spouse(person, family)
|
||||
spouse_id = utils.find_spouse(person, family)
|
||||
if spouse_id:
|
||||
spouse = self.database.get_person_from_handle(spouse_id)
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Spouse'),
|
||||
name_of(spouse)))
|
||||
relstr = str(family.get_relationship())
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Type'), relstr))
|
||||
event = ReportUtils.find_marriage(self.database, family)
|
||||
event = utils.find_marriage(self.database, family)
|
||||
if event:
|
||||
self.add(tobj, indent, "%s:\t%s" % (
|
||||
_('Marriage'),
|
||||
|
@ -56,7 +56,7 @@ from gramps.gen.plug.docgen.fontscale import string_width
|
||||
from gramps.plugins.lib.libodfbackend import OdfBackend
|
||||
from gramps.gen.const import PROGRAM_NAME, URL_HOMEPAGE
|
||||
from gramps.version import VERSION
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.utils.image import (image_size, image_dpi, image_actual_size,
|
||||
crop_percentage_to_subpixel)
|
||||
from gramps.gen.errors import ReportError
|
||||
@ -1717,8 +1717,8 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
|
||||
width = 0
|
||||
for line in text:
|
||||
width = max(width, string_width(font, line))
|
||||
wcm = ReportUtils.pt2cm(width)
|
||||
hcm = ReportUtils.pt2cm(height)
|
||||
wcm = utils.pt2cm(width)
|
||||
hcm = utils.pt2cm(height)
|
||||
|
||||
rangle = radians(angle)
|
||||
xloc = x - (wcm / 2.0) * cos(rangle) + (hcm / 2.0) * sin(rangle)
|
||||
@ -1806,7 +1806,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
|
||||
para_name = box_style.get_paragraph_style()
|
||||
pstyle = style_sheet.get_paragraph_style(para_name)
|
||||
font = pstyle.get_font()
|
||||
sw = ReportUtils.pt2cm(string_width(font, text))*1.3
|
||||
sw = utils.pt2cm(string_width(font, text))*1.3
|
||||
|
||||
self._write_mark(mark, text)
|
||||
|
||||
@ -1816,7 +1816,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
|
||||
'draw:style-name="%s" ' % style +
|
||||
'svg:width="%.2fcm" ' % sw +
|
||||
'svg:height="%.2fcm" '
|
||||
% (ReportUtils.pt2cm(font.get_size() * 1.4)) +
|
||||
% (utils.pt2cm(font.get_size() * 1.4)) +
|
||||
'svg:x="%.2fcm" ' % float(x) +
|
||||
'svg:y="%.2fcm">' % float(y) +
|
||||
'<draw:text-box> ' +
|
||||
|
@ -42,15 +42,15 @@ from gramps.gen.plug.menu import (TextOption, NumberOption, BooleanOption,
|
||||
EnumeratedListOption, StringOption,
|
||||
PersonOption)
|
||||
from gramps.gen.plug.report import Report, MenuReportOptions, stdoptions
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
|
||||
from gramps.plugins.lib.libtreebase import *
|
||||
from gramps.plugins.lib.librecurse import AscendPerson
|
||||
from gramps.gen.proxy import CacheProxyDb
|
||||
|
||||
PT2CM = ReportUtils.pt2cm
|
||||
#cm2pt = ReportUtils.cm2pt
|
||||
PT2CM = utils.pt2cm
|
||||
#cm2pt = utils.cm2pt
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -47,7 +47,7 @@ from gramps.gen.plug.menu import (BooleanOption, StringOption, NumberOption,
|
||||
EnumeratedListOption, FilterOption,
|
||||
PersonOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.utils.alive import probably_alive
|
||||
@ -64,8 +64,8 @@ from gramps.plugins.lib.libholiday import g2iso
|
||||
# Constants
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
cm2pt = ReportUtils.cm2pt
|
||||
pt2cm = utils.pt2cm
|
||||
cm2pt = utils.cm2pt
|
||||
|
||||
# _T_ is a gramps-defined keyword -- see po/update_po.py and po/genpot.sh
|
||||
def _T_(value): # enable deferred translations (see Python docs 22.1.3.4)
|
||||
@ -324,7 +324,7 @@ class Calendar(Report):
|
||||
for person_handle in people:
|
||||
step()
|
||||
person = db.get_person_from_handle(person_handle)
|
||||
mark = ReportUtils.get_person_mark(db, person)
|
||||
mark = utils.get_person_mark(db, person)
|
||||
birth_ref = person.get_birth_ref()
|
||||
birth_date = None
|
||||
if birth_ref:
|
||||
@ -387,7 +387,7 @@ class Calendar(Report):
|
||||
if spouse_handle:
|
||||
spouse = db.get_person_from_handle(spouse_handle)
|
||||
if spouse:
|
||||
s_m = ReportUtils.get_person_mark(db, spouse)
|
||||
s_m = utils.get_person_mark(db, spouse)
|
||||
spouse_name = self.get_name(spouse)
|
||||
short_name = self.get_name(person)
|
||||
# TEMP: this will handle ordered events
|
||||
@ -560,7 +560,7 @@ class CalendarOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -39,13 +39,13 @@ from gramps.gen.plug.menu import (TextOption, NumberOption, BooleanOption,
|
||||
EnumeratedListOption, StringOption,
|
||||
PersonOption, FamilyOption)
|
||||
from gramps.gen.plug.report import Report, MenuReportOptions, stdoptions
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
|
||||
from gramps.plugins.lib.libtreebase import *
|
||||
from gramps.gen.proxy import CacheProxyDb
|
||||
|
||||
PT2CM = ReportUtils.pt2cm
|
||||
PT2CM = utils.pt2cm
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -533,7 +533,7 @@ class RecurseDown:
|
||||
person_handle, family_handle,
|
||||
father if s_level else myself)
|
||||
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if (self.max_spouses > s_level and
|
||||
spouse_handle and
|
||||
spouse_handle not in self.families_seen):
|
||||
@ -562,7 +562,7 @@ class RecurseDown:
|
||||
|
||||
if self.max_spouses > s_level and \
|
||||
spouse_handle not in self.families_seen:
|
||||
#spouse_handle = ReportUtils.find_spouse(person,family)
|
||||
#spouse_handle = utils.find_spouse(person,family)
|
||||
self.recurse(spouse_handle, x_level, s_level+1, spouse)
|
||||
|
||||
if s_level == 1:
|
||||
|
@ -54,7 +54,7 @@ from gramps.gen.plug.menu import (BooleanOption,
|
||||
EnumeratedListOption, NumberOption,
|
||||
FilterOption, PersonOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.datehandler import parser
|
||||
@ -184,7 +184,7 @@ def draw_legend(doc, start_x, start_y, data, title, label_style):
|
||||
gstyle = style_sheet.get_draw_style(label_style)
|
||||
pstyle_name = gstyle.get_paragraph_style()
|
||||
pstyle = style_sheet.get_paragraph_style(pstyle_name)
|
||||
size = ReportUtils.pt2cm(pstyle.get_font().get_size())
|
||||
size = utils.pt2cm(pstyle.get_font().get_size())
|
||||
doc.draw_text(label_style, title,
|
||||
start_x + (3*size), start_y - (size*0.25))
|
||||
start_y += size * 1.3
|
||||
@ -193,7 +193,7 @@ def draw_legend(doc, start_x, start_y, data, title, label_style):
|
||||
gstyle = style_sheet.get_draw_style(sformat)
|
||||
pstyle_name = gstyle.get_paragraph_style()
|
||||
pstyle = style_sheet.get_paragraph_style(pstyle_name)
|
||||
size = ReportUtils.pt2cm(pstyle.get_font().get_size())
|
||||
size = utils.pt2cm(pstyle.get_font().get_size())
|
||||
doc.draw_box(sformat, "", start_x, start_y, (2*size), size)
|
||||
doc.draw_text(label_style, legend,
|
||||
start_x + (3*size), start_y - (size*0.25))
|
||||
@ -869,9 +869,9 @@ class StatisticsChart(Report):
|
||||
pstyle = style_sheet.get_paragraph_style('SC-Title')
|
||||
mark = IndexMark(title1, INDEX_TYPE_TOC, 2)
|
||||
self.doc.center_text('SC-title', title1, middle_w, 0, mark)
|
||||
yoffset = ReportUtils.pt2cm(pstyle.get_font().get_size())
|
||||
yoffset = utils.pt2cm(pstyle.get_font().get_size())
|
||||
self.doc.center_text('SC-title', self.fil_name, middle_w, yoffset)
|
||||
yoffset = 2 * ReportUtils.pt2cm(pstyle.get_font().get_size())
|
||||
yoffset = 2 * utils.pt2cm(pstyle.get_font().get_size())
|
||||
self.doc.center_text('SC-title', self.living_desc, middle_w, yoffset)
|
||||
|
||||
# collect data for output
|
||||
@ -902,7 +902,7 @@ class StatisticsChart(Report):
|
||||
|
||||
def output_barchart(self, title1, typename, data, lookup):
|
||||
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
pt2cm = utils.pt2cm
|
||||
style_sheet = self.doc.get_style_sheet()
|
||||
pstyle = style_sheet.get_paragraph_style('SC-Text')
|
||||
font = pstyle.get_font()
|
||||
@ -1082,7 +1082,7 @@ class StatisticsChartOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -35,7 +35,7 @@ _ = glocale.translation.sgettext
|
||||
from gramps.gen.plug.menu import (PersonOption, FilterOption,
|
||||
EnumeratedListOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
@ -147,7 +147,7 @@ class TimeLine(Report):
|
||||
st_size = self.name_size()
|
||||
style_sheet = self.doc.get_style_sheet()
|
||||
font = style_sheet.get_paragraph_style('TLG-Name').get_font()
|
||||
incr = ReportUtils.pt2cm(font.get_size())
|
||||
incr = utils.pt2cm(font.get_size())
|
||||
pad = incr * 0.75
|
||||
_x1, _x2, _y1, _y2 = (0, 0, 0, 0)
|
||||
start = st_size + 0.5
|
||||
@ -188,7 +188,7 @@ class TimeLine(Report):
|
||||
dth = None
|
||||
|
||||
dname = self._name_display.display(person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
self.doc.draw_text('TLG-text', dname, incr + pad,
|
||||
self.header + (incr + pad) * index, mark)
|
||||
|
||||
@ -284,9 +284,9 @@ class TimeLine(Report):
|
||||
self.doc.center_text('TLG-title', title, width / 2.0, 0, mark)
|
||||
style_sheet = self.doc.get_style_sheet()
|
||||
title_font = style_sheet.get_paragraph_style('TLG-Title').get_font()
|
||||
title_y = 1.2 - (ReportUtils.pt2cm(title_font.get_size()) * 1.2)
|
||||
title_y = 1.2 - (utils.pt2cm(title_font.get_size()) * 1.2)
|
||||
self.doc.center_text('TLG-title', self.fil_name, width / 2.0, title_y)
|
||||
title_y = 1.8 - (ReportUtils.pt2cm(title_font.get_size()) * 1.2)
|
||||
title_y = 1.8 - (utils.pt2cm(title_font.get_size()) * 1.2)
|
||||
self.doc.center_text('TLG-title', title3, width / 2.0, title_y)
|
||||
|
||||
def draw_year_headings(self, year_low, year_high, start_pos, stop_pos):
|
||||
@ -295,7 +295,7 @@ class TimeLine(Report):
|
||||
"""
|
||||
style_sheet = self.doc.get_style_sheet()
|
||||
label_font = style_sheet.get_paragraph_style('TLG-Label').get_font()
|
||||
label_y = self.header - (ReportUtils.pt2cm(label_font.get_size()) * 1.2)
|
||||
label_y = self.header - (utils.pt2cm(label_font.get_size()) * 1.2)
|
||||
incr = (year_high - year_low) / 5
|
||||
delta = (stop_pos - start_pos) / 5
|
||||
for val in range(0, 6):
|
||||
@ -310,7 +310,7 @@ class TimeLine(Report):
|
||||
width = self.doc.get_usable_width()
|
||||
style_sheet = self.doc.get_style_sheet()
|
||||
label_font = style_sheet.get_paragraph_style('TLG-Label').get_font()
|
||||
label_y = self.header - (ReportUtils.pt2cm(label_font.get_size()) * 1.2)
|
||||
label_y = self.header - (utils.pt2cm(label_font.get_size()) * 1.2)
|
||||
self.doc.center_text('TLG-label', self._("No Date Information"),
|
||||
width / 2.0, label_y)
|
||||
|
||||
@ -390,7 +390,7 @@ class TimeLine(Report):
|
||||
person = self.database.get_person_from_handle(p_id)
|
||||
dname = self._name_display.display(person)
|
||||
size = max(self.doc.string_width(font, dname), size)
|
||||
return ReportUtils.pt2cm(size)
|
||||
return utils.pt2cm(size)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -447,7 +447,7 @@ class TimeLineOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -28,7 +28,7 @@
|
||||
from gramps.gen.lib import EventType, FamilyRelType
|
||||
from gramps.gen.plug import Gramplet
|
||||
from gramps.gen.display.name import displayer as name_displayer
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
|
||||
@ -522,7 +522,7 @@ class WhatNextGramplet(Gramplet):
|
||||
|
||||
def __get_spouse(self, person, family):
|
||||
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if not spouse_handle:
|
||||
if family.get_relationship() == FamilyRelType.MARRIED:
|
||||
return UnknownPerson
|
||||
|
@ -53,7 +53,7 @@ from gramps.gen.lib import EventRoleType, EventType, Person, PlaceType
|
||||
from gramps.gen.utils.file import media_path_full
|
||||
from gramps.gen.utils.thumbnails import get_thumbnail_path
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.plug.menu import (NumberOption, ColorOption, BooleanOption,
|
||||
@ -489,7 +489,7 @@ class FamilyLinesReport(Report):
|
||||
family = self._db.get_family_from_handle(family_handle)
|
||||
if not family:
|
||||
continue
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if spouse_handle:
|
||||
if (spouse_handle in self._people or
|
||||
spouse_handle in ancestors_not_yet_processed):
|
||||
@ -571,7 +571,7 @@ class FamilyLinesReport(Report):
|
||||
# now see how many spouses this person has
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = self._db.get_family_from_handle(family_handle)
|
||||
handle = ReportUtils.find_spouse(person, family)
|
||||
handle = utils.find_spouse(person, family)
|
||||
if handle in self._people:
|
||||
spouse_count += 1
|
||||
spouse = self._db.get_person_from_handle(handle)
|
||||
@ -725,7 +725,7 @@ class FamilyLinesReport(Report):
|
||||
self._families.add(family_handle)
|
||||
|
||||
# include the spouse from this person's family
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if spouse_handle:
|
||||
children_to_include.add(spouse_handle)
|
||||
self._families.add(family_handle)
|
||||
|
@ -43,7 +43,7 @@ from gramps.gen.errors import ReportError
|
||||
from gramps.gen.plug.menu import (PersonOption, BooleanOption, NumberOption,
|
||||
EnumeratedListOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
||||
@ -235,7 +235,7 @@ class HourGlassReport(Report):
|
||||
"""
|
||||
family_id = family.get_gramps_id()
|
||||
label = ""
|
||||
marriage = ReportUtils.find_marriage(self.__db, family)
|
||||
marriage = utils.find_marriage(self.__db, family)
|
||||
if marriage:
|
||||
label = self._get_date(marriage.get_date_object())
|
||||
if self.includeid == 1 and label: # same line
|
||||
|
@ -51,7 +51,7 @@ _ = glocale.translation.sgettext
|
||||
from gramps.gen.plug.menu import (BooleanOption, EnumeratedListOption,
|
||||
FilterOption, PersonOption, ColorOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.lib import ChildRefType, EventRoleType, EventType
|
||||
@ -825,7 +825,7 @@ class RelGraphOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -47,7 +47,7 @@ import re
|
||||
from gramps.gen.plug.docgen import (BaseDoc, TextDoc, DrawDoc, ParagraphStyle,
|
||||
TableCellStyle, SOLID, FONT_SANS_SERIF, FONT_SERIF,
|
||||
FONT_MONOSPACE, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT)
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.errors import PluginError
|
||||
from gramps.gen.plug.docbackend import CairoBackend
|
||||
from gramps.gen.utils.image import resize_to_buffer
|
||||
@ -767,7 +767,7 @@ class GtkDocParagraph(GtkDocBaseElement):
|
||||
x += f_indent
|
||||
# 3/4 of the spacing is added above the text, 1/4 is added below
|
||||
cr.move_to(x, t_margin + v_padding + spacing * 0.75)
|
||||
cr.set_source_rgb(*ReportUtils.rgb_color(font_style.get_color()))
|
||||
cr.set_source_rgb(*utils.rgb_color(font_style.get_color()))
|
||||
PangoCairo.show_layout(cr, layout)
|
||||
|
||||
# calculate the full paragraph height
|
||||
@ -1173,7 +1173,7 @@ class GtkDocLine(GtkDocBaseElement):
|
||||
def draw(self, cr, layout, width, dpi_x, dpi_y):
|
||||
start = (self._start[0] * dpi_x / 2.54, self._start[1] * dpi_y / 2.54)
|
||||
end = (self._end[0] * dpi_x / 2.54, self._end[1] * dpi_y / 2.54)
|
||||
line_color = ReportUtils.rgb_color(self._style.get_color())
|
||||
line_color = utils.rgb_color(self._style.get_color())
|
||||
|
||||
cr.save()
|
||||
cr.set_source_rgb(*line_color)
|
||||
@ -1202,8 +1202,8 @@ class GtkDocPolygon(GtkDocBaseElement):
|
||||
def draw(self, cr, layout, width, dpi_x, dpi_y):
|
||||
path = [(x * dpi_x / 2.54, y * dpi_y / 2.54) for (x, y) in self._path]
|
||||
path_start = path.pop(0)
|
||||
path_stroke_color = ReportUtils.rgb_color(self._style.get_color())
|
||||
path_fill_color = ReportUtils.rgb_color(self._style.get_fill_color())
|
||||
path_stroke_color = utils.rgb_color(self._style.get_color())
|
||||
path_fill_color = utils.rgb_color(self._style.get_fill_color())
|
||||
|
||||
cr.save()
|
||||
cr.move_to(*path_start)
|
||||
@ -1242,9 +1242,9 @@ class GtkDocBox(GtkDocBaseElement):
|
||||
box_width = self._width * dpi_x / 2.54
|
||||
box_height = self._height * dpi_y / 2.54
|
||||
|
||||
box_stroke_color = ReportUtils.rgb_color((0, 0, 0))
|
||||
box_fill_color = ReportUtils.rgb_color(self._style.get_fill_color())
|
||||
shadow_color = ReportUtils.rgb_color((192, 192, 192))
|
||||
box_stroke_color = utils.rgb_color((0, 0, 0))
|
||||
box_fill_color = utils.rgb_color(self._style.get_fill_color())
|
||||
shadow_color = utils.rgb_color((192, 192, 192))
|
||||
|
||||
cr.save()
|
||||
|
||||
@ -1355,7 +1355,7 @@ class GtkDocText(GtkDocBaseElement):
|
||||
cr.translate(text_x, text_y)
|
||||
cr.rotate(radians(self._angle))
|
||||
cr.move_to(align_x, align_y)
|
||||
cr.set_source_rgb(*ReportUtils.rgb_color(font_style.get_color()))
|
||||
cr.set_source_rgb(*utils.rgb_color(font_style.get_color()))
|
||||
PangoCairo.show_layout(cr, layout)
|
||||
cr.restore()
|
||||
|
||||
|
@ -41,7 +41,7 @@ from gramps.gen.lib.familyreltype import FamilyRelType
|
||||
from gramps.gen.display.name import displayer as _nd
|
||||
from gramps.gen.display.place import displayer as _pd
|
||||
from gramps.gen.utils.alive import probably_alive
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -1992,7 +1992,7 @@ class Narrator:
|
||||
place = self.__empty_place
|
||||
|
||||
spouse_name = None
|
||||
spouse_handle = ReportUtils.find_spouse(self.__person, family)
|
||||
spouse_handle = utils.find_spouse(self.__person, family)
|
||||
if spouse_handle:
|
||||
spouse = self.__db.get_person_from_handle(spouse_handle)
|
||||
if spouse:
|
||||
@ -2003,7 +2003,7 @@ class Narrator:
|
||||
if not spouse_name:
|
||||
spouse_name = self.__translate_text("Unknown") # not: _("Unknown")
|
||||
|
||||
event = ReportUtils.find_marriage(self.__db, family)
|
||||
event = utils.find_marriage(self.__db, family)
|
||||
if event:
|
||||
if self.__use_fulldate :
|
||||
mdate = self.__get_date(event.get_date_object())
|
||||
|
@ -21,7 +21,7 @@
|
||||
""" Recursive base classes for reports
|
||||
"""
|
||||
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.lib import ChildRefType
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@ class DescendPerson(_StopRecurse, _PersonSeen, _FamilySeen):
|
||||
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if self.max_spouses > s_level:
|
||||
self.__this_slevel = s_level + 1
|
||||
self._add_person((g_level, s_level + 1),
|
||||
@ -303,7 +303,7 @@ class DescendPerson(_StopRecurse, _PersonSeen, _FamilySeen):
|
||||
self.continue_recursion()
|
||||
|
||||
if self.max_spouses > s_level:
|
||||
#spouse_handle = ReportUtils.find_spouse(person,family)
|
||||
#spouse_handle = utils.find_spouse(person,family)
|
||||
self.recurse(spouse_handle, g_level, s_level + 1)
|
||||
|
||||
if s_level == 1:
|
||||
|
@ -28,11 +28,11 @@
|
||||
#------------------------------------------------------------------------
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.sgettext
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.plugins.lib.libsubstkeyword import SubstKeywords
|
||||
from gramps.gen.plug.docgen import (IndexMark, INDEX_TYPE_TOC)
|
||||
|
||||
PT2CM = ReportUtils.pt2cm
|
||||
PT2CM = utils.pt2cm
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -595,7 +595,7 @@ class BoxBase:
|
||||
self.height *= scale_amount
|
||||
|
||||
def add_mark(self, database, person):
|
||||
self.__mark = ReportUtils.get_person_mark(database, person)
|
||||
self.__mark = utils.get_person_mark(database, person)
|
||||
|
||||
def display(self):
|
||||
""" display the box accounting for page x, y offsets
|
||||
|
@ -44,7 +44,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
FONT_SANS_SERIF, INDEX_TYPE_TOC,
|
||||
PARA_ALIGN_CENTER)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.plugins.lib.libnarrate import Narrator
|
||||
@ -224,7 +224,7 @@ class AncestorReport(Report):
|
||||
if person is None:
|
||||
continue
|
||||
name = self._name_display.display(person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
|
||||
# write the name in bold
|
||||
self.doc.start_bold()
|
||||
|
@ -48,7 +48,7 @@ from gramps.gen.plug.menu import (BooleanOption, StringOption, NumberOption,
|
||||
EnumeratedListOption, FilterOption,
|
||||
PersonOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.utils.alive import probably_alive
|
||||
@ -210,7 +210,7 @@ class BirthdayReport(Report):
|
||||
if self.relationships:
|
||||
name = self.center_person.get_primary_name()
|
||||
self.doc.start_paragraph('BIR-Text3style')
|
||||
mark = ReportUtils.get_person_mark(self.database,
|
||||
mark = utils.get_person_mark(self.database,
|
||||
self.center_person)
|
||||
# feature request 2356: avoid genitive form
|
||||
self.doc.write_text(self._("Relationships shown are to %s") %
|
||||
@ -237,7 +237,7 @@ class BirthdayReport(Report):
|
||||
if thisday.month == month:
|
||||
list = self.calendar.get(month, {}).get(thisday.day, [])
|
||||
for p, p_obj in list:
|
||||
mark = ReportUtils.get_person_mark(self.database, p_obj)
|
||||
mark = utils.get_person_mark(self.database, p_obj)
|
||||
p = p.replace("\n", " ")
|
||||
if thisday not in started_day:
|
||||
self.doc.start_paragraph("BIR-Daystyle")
|
||||
@ -505,7 +505,7 @@ class BirthdayOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -48,7 +48,7 @@ from gramps.gen.plug.menu import (NumberOption, PersonOption, BooleanOption,
|
||||
EnumeratedListOption)
|
||||
from gramps.gen.errors import ReportError
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.utils.db import (get_birth_or_fallback, get_death_or_fallback,
|
||||
@ -133,7 +133,7 @@ class PrintMeurgey:
|
||||
if len(self.childnum) < level:
|
||||
self.childnum.append(1)
|
||||
|
||||
to_return = (ReportUtils.roman(level) + dash +
|
||||
to_return = (utils.roman(level) + dash +
|
||||
str(self.childnum[level-1]) + ".")
|
||||
|
||||
if level > 1:
|
||||
@ -217,7 +217,7 @@ class Printinfo:
|
||||
""" print the person """
|
||||
display_num = self.numbering.number(level)
|
||||
self.doc.start_paragraph("DR-Level%d" % min(level, 32), display_num)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
self.doc.write_text(self._name_display.display(person), mark)
|
||||
self.dump_string(person)
|
||||
self.doc.end_paragraph()
|
||||
@ -228,7 +228,7 @@ class Printinfo:
|
||||
#Currently print_spouses is the same for all numbering systems.
|
||||
if spouse_handle:
|
||||
spouse = self.database.get_person_from_handle(spouse_handle)
|
||||
mark = ReportUtils.get_person_mark(self.database, spouse)
|
||||
mark = utils.get_person_mark(self.database, spouse)
|
||||
self.doc.start_paragraph("DR-Spouse%d" % min(level, 32))
|
||||
name = self._name_display.display(spouse)
|
||||
self.doc.write_text(
|
||||
@ -246,7 +246,7 @@ class Printinfo:
|
||||
#Person and their family have already been printed so
|
||||
#print reference here
|
||||
if person:
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
self.doc.start_paragraph("DR-Spouse%d" % min(level, 32))
|
||||
name = self._name_display.display(person)
|
||||
self.doc.write_text(self._("sp. see %(reference)s: %(spouse)s"
|
||||
@ -298,7 +298,7 @@ class RecurseDown:
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
|
||||
if not self.showdups and spouse_handle in self.person_printed:
|
||||
# Just print a reference
|
||||
@ -464,8 +464,8 @@ class DescendantOptions(MenuReportOptions):
|
||||
pstyle = ParagraphStyle()
|
||||
pstyle.set_header_level(1)
|
||||
pstyle.set_bottom_border(1)
|
||||
pstyle.set_top_margin(ReportUtils.pt2cm(3))
|
||||
pstyle.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
pstyle.set_top_margin(utils.pt2cm(3))
|
||||
pstyle.set_bottom_margin(utils.pt2cm(3))
|
||||
pstyle.set_font(fstyle)
|
||||
pstyle.set_alignment(PARA_ALIGN_CENTER)
|
||||
pstyle.set_description(_("The style used for the title of the page."))
|
||||
@ -476,9 +476,9 @@ class DescendantOptions(MenuReportOptions):
|
||||
for i in range(1, 33):
|
||||
pstyle = ParagraphStyle()
|
||||
pstyle.set_font(fstyle)
|
||||
pstyle.set_top_margin(ReportUtils.pt2cm(fstyle.get_size()*0.125))
|
||||
pstyle.set_top_margin(utils.pt2cm(fstyle.get_size()*0.125))
|
||||
pstyle.set_bottom_margin(
|
||||
ReportUtils.pt2cm(fstyle.get_size()*0.125))
|
||||
utils.pt2cm(fstyle.get_size()*0.125))
|
||||
pstyle.set_first_indent(-0.5)
|
||||
pstyle.set_left_margin(min(10.0, float(i-0.5)))
|
||||
pstyle.set_description(
|
||||
@ -488,9 +488,9 @@ class DescendantOptions(MenuReportOptions):
|
||||
|
||||
pstyle = ParagraphStyle()
|
||||
pstyle.set_font(fstyle)
|
||||
pstyle.set_top_margin(ReportUtils.pt2cm(fstyle.get_size()*0.125))
|
||||
pstyle.set_top_margin(utils.pt2cm(fstyle.get_size()*0.125))
|
||||
pstyle.set_bottom_margin(
|
||||
ReportUtils.pt2cm(fstyle.get_size()*0.125))
|
||||
utils.pt2cm(fstyle.get_size()*0.125))
|
||||
pstyle.set_left_margin(min(10.0, float(i-0.5)))
|
||||
pstyle.set_description(
|
||||
_("The style used for the spouse level %d display.") % i)
|
||||
|
@ -54,7 +54,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
from gramps.gen.plug.menu import BooleanOption, NumberOption, PersonOption
|
||||
from gramps.gen.plug.report import Report, Bibliography
|
||||
from gramps.gen.plug.report import endnotes
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.plugins.lib.libnarrate import Narrator
|
||||
@ -277,14 +277,14 @@ class DetAncestorReport(Report):
|
||||
|
||||
if self.addimages and len(plist) > 0:
|
||||
photo = plist[0]
|
||||
ReportUtils.insert_image(self._db, self.doc, photo, self._user)
|
||||
utils.insert_image(self._db, self.doc, photo, self._user)
|
||||
|
||||
self.doc.start_paragraph("DAR-First-Entry", "%d." % self._get_s_s(key))
|
||||
|
||||
name = self._nd.display(person)
|
||||
if not name:
|
||||
name = self._("Unknown")
|
||||
mark = ReportUtils.get_person_mark(self._db, person)
|
||||
mark = utils.get_person_mark(self._db, person)
|
||||
|
||||
self.doc.start_bold()
|
||||
self.doc.write_text(name, mark)
|
||||
@ -389,7 +389,7 @@ class DetAncestorReport(Report):
|
||||
first = write_more_header(first, name)
|
||||
self.doc.start_paragraph('DAR-MoreDetails')
|
||||
|
||||
text = ReportUtils.get_address_str(addr)
|
||||
text = utils.get_address_str(addr)
|
||||
self.doc.write_text(self._('Address: '))
|
||||
|
||||
if self.fulldate:
|
||||
@ -513,14 +513,14 @@ class DetAncestorReport(Report):
|
||||
if mother_handle:
|
||||
mother = self._db.get_person_from_handle(mother_handle)
|
||||
mother_name = self._nd.display_name(mother.get_primary_name())
|
||||
mother_mark = ReportUtils.get_person_mark(self._db, mother)
|
||||
mother_mark = utils.get_person_mark(self._db, mother)
|
||||
else:
|
||||
mother_name = ""
|
||||
mother_mark = ""
|
||||
if father_handle:
|
||||
father = self._db.get_person_from_handle(father_handle)
|
||||
father_name = self._nd.display_name(father.get_primary_name())
|
||||
father_mark = ReportUtils.get_person_mark(self._db, father)
|
||||
father_mark = utils.get_person_mark(self._db, father)
|
||||
else:
|
||||
father_name = ""
|
||||
father_mark = ""
|
||||
@ -540,10 +540,10 @@ class DetAncestorReport(Report):
|
||||
is_first = True
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = self._db.get_family_from_handle(family_handle)
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if spouse_handle:
|
||||
spouse = self._db.get_person_from_handle(spouse_handle)
|
||||
spouse_mark = ReportUtils.get_person_mark(self._db, spouse)
|
||||
spouse_mark = utils.get_person_mark(self._db, spouse)
|
||||
else:
|
||||
spouse_mark = None
|
||||
|
||||
@ -593,14 +593,14 @@ class DetAncestorReport(Report):
|
||||
child_name = self._nd.display(child)
|
||||
if not child_name:
|
||||
child_name = self._("Unknown")
|
||||
child_mark = ReportUtils.get_person_mark(self._db, child)
|
||||
child_mark = utils.get_person_mark(self._db, child)
|
||||
|
||||
if self.childref and self.prev_gen_handles.get(child_handle):
|
||||
value = int(self.prev_gen_handles.get(child_handle))
|
||||
child_name += " [%d]" % self._get_s_s(value)
|
||||
|
||||
self.doc.start_paragraph("DAR-ChildList",
|
||||
ReportUtils.roman(cnt).lower() + ".")
|
||||
utils.roman(cnt).lower() + ".")
|
||||
cnt += 1
|
||||
|
||||
self.__narrator.set_subject(child)
|
||||
@ -690,13 +690,13 @@ class DetAncestorReport(Report):
|
||||
|
||||
if self.addimages and len(plist) > 0:
|
||||
photo = plist[0]
|
||||
ReportUtils.insert_image(self._db, self.doc,
|
||||
utils.insert_image(self._db, self.doc,
|
||||
photo, self._user)
|
||||
|
||||
name = self._nd.display(ind)
|
||||
if not name:
|
||||
name = self._("Unknown")
|
||||
mark = ReportUtils.get_person_mark(self._db, ind)
|
||||
mark = utils.get_person_mark(self._db, ind)
|
||||
|
||||
if family.get_relationship() == FamilyRelType.MARRIED:
|
||||
self.doc.write_text(self._("Spouse: %s"
|
||||
|
@ -54,7 +54,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
|
||||
from gramps.gen.plug.report import Report, Bibliography
|
||||
from gramps.gen.plug.report import endnotes
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.plugins.lib.libnarrate import Narrator
|
||||
@ -385,7 +385,7 @@ class DetDescendantReport(Report):
|
||||
name = self._name_display.display(person)
|
||||
if not name:
|
||||
name = self._("Unknown")
|
||||
mark = ReportUtils.get_person_mark(self._db, person)
|
||||
mark = utils.get_person_mark(self._db, person)
|
||||
|
||||
self.doc.start_bold()
|
||||
self.doc.write_text(name, mark)
|
||||
@ -511,7 +511,7 @@ class DetDescendantReport(Report):
|
||||
mother = self._db.get_person_from_handle(mother_handle)
|
||||
mother_name = self._name_display.display_name(
|
||||
mother.get_primary_name())
|
||||
mother_mark = ReportUtils.get_person_mark(self._db, mother)
|
||||
mother_mark = utils.get_person_mark(self._db, mother)
|
||||
else:
|
||||
mother_name = ""
|
||||
mother_mark = ""
|
||||
@ -519,7 +519,7 @@ class DetDescendantReport(Report):
|
||||
father = self._db.get_person_from_handle(father_handle)
|
||||
father_name = self._name_display.display_name(
|
||||
father.get_primary_name())
|
||||
father_mark = ReportUtils.get_person_mark(self._db, father)
|
||||
father_mark = utils.get_person_mark(self._db, father)
|
||||
else:
|
||||
father_name = ""
|
||||
father_mark = ""
|
||||
@ -538,10 +538,10 @@ class DetDescendantReport(Report):
|
||||
is_first = True
|
||||
for family_handle in person.get_family_handle_list():
|
||||
family = self._db.get_family_from_handle(family_handle)
|
||||
spouse_handle = ReportUtils.find_spouse(person, family)
|
||||
spouse_handle = utils.find_spouse(person, family)
|
||||
if spouse_handle:
|
||||
spouse = self._db.get_person_from_handle(spouse_handle)
|
||||
spouse_mark = ReportUtils.get_person_mark(self._db, spouse)
|
||||
spouse_mark = utils.get_person_mark(self._db, spouse)
|
||||
else:
|
||||
spouse_mark = None
|
||||
|
||||
@ -568,7 +568,7 @@ class DetDescendantReport(Report):
|
||||
name = self._name_display.display(mate)
|
||||
if not name:
|
||||
name = self._("Unknown")
|
||||
mark = ReportUtils.get_person_mark(self._db, mate)
|
||||
mark = utils.get_person_mark(self._db, mate)
|
||||
if family.get_relationship() == FamilyRelType.MARRIED:
|
||||
self.doc.write_text(self._("Spouse: %s"
|
||||
) % name,
|
||||
@ -642,7 +642,7 @@ class DetDescendantReport(Report):
|
||||
child_name = self._name_display.display(child)
|
||||
if not child_name:
|
||||
child_name = self._("Unknown")
|
||||
child_mark = ReportUtils.get_person_mark(self._db, child)
|
||||
child_mark = utils.get_person_mark(self._db, child)
|
||||
|
||||
if self.childref and self.prev_gen_handles.get(child_handle):
|
||||
value = str(self.prev_gen_handles.get(child_handle))
|
||||
@ -663,12 +663,12 @@ class DetDescendantReport(Report):
|
||||
prefix
|
||||
+ str(self.dnumber[child_handle])
|
||||
+ " "
|
||||
+ ReportUtils.roman(cnt).lower()
|
||||
+ utils.roman(cnt).lower()
|
||||
+ ".")
|
||||
else:
|
||||
self.doc.start_paragraph("DDR-ChildList",
|
||||
prefix
|
||||
+ ReportUtils.roman(cnt).lower()
|
||||
+ utils.roman(cnt).lower()
|
||||
+ ".")
|
||||
cnt += 1
|
||||
|
||||
@ -770,7 +770,7 @@ class DetDescendantReport(Report):
|
||||
plist = person.get_media_list()
|
||||
if self.addimages and len(plist) > 0:
|
||||
photo = plist[0]
|
||||
ReportUtils.insert_image(self._db, self.doc, photo, self._user)
|
||||
utils.insert_image(self._db, self.doc, photo, self._user)
|
||||
|
||||
self.doc.start_paragraph("DDR-Entry")
|
||||
|
||||
@ -854,7 +854,7 @@ class DetDescendantReport(Report):
|
||||
first = False
|
||||
self.doc.start_paragraph('DDR-MoreDetails')
|
||||
|
||||
text = ReportUtils.get_address_str(addr)
|
||||
text = utils.get_address_str(addr)
|
||||
|
||||
if self.fulldate:
|
||||
date = self._get_date(addr.get_date_object())
|
||||
|
@ -42,7 +42,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
PARA_ALIGN_CENTER)
|
||||
from gramps.gen.plug.menu import PersonOption
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.proxy import CacheProxyDb
|
||||
@ -193,7 +193,7 @@ class EndOfLineReport(Report):
|
||||
person = self.database.get_person_from_handle(person_handle)
|
||||
|
||||
name = self._name_display.display(person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
birth_date = ""
|
||||
birth_ref = person.get_birth_ref()
|
||||
if birth_ref:
|
||||
@ -281,7 +281,7 @@ class EndOfLineOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(1)
|
||||
para.set_bottom_border(1)
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(8))
|
||||
para.set_bottom_margin(utils.pt2cm(8))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_("The style used for the title of the page."))
|
||||
@ -290,7 +290,7 @@ class EndOfLineOptions(MenuReportOptions):
|
||||
font = FontStyle()
|
||||
font.set(face=FONT_SANS_SERIF, size=12, italic=1)
|
||||
para = ParagraphStyle()
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(6))
|
||||
para.set_bottom_margin(utils.pt2cm(6))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_('The style used for the section headers.'))
|
||||
@ -300,8 +300,8 @@ class EndOfLineOptions(MenuReportOptions):
|
||||
font.set_size(10)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(6))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(6))
|
||||
para.set_top_margin(utils.pt2cm(6))
|
||||
para.set_bottom_margin(utils.pt2cm(6))
|
||||
para.set_description(_('The basic style used for the text display.'))
|
||||
default_style.add_paragraph_style("EOL-Normal", para)
|
||||
|
||||
@ -310,7 +310,7 @@ class EndOfLineOptions(MenuReportOptions):
|
||||
font.set_italic(True)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(6))
|
||||
para.set_top_margin(utils.pt2cm(6))
|
||||
para.set_description(
|
||||
_('The basic style used for generation headings.'))
|
||||
default_style.add_paragraph_style("EOL-Generation", para)
|
||||
@ -320,7 +320,7 @@ class EndOfLineOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(0)
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(6))
|
||||
para.set_bottom_margin(utils.pt2cm(6))
|
||||
para.set_description(_('The basic style used for the text display.'))
|
||||
default_style.add_paragraph_style("EOL-Pedigree", para)
|
||||
|
||||
|
@ -41,7 +41,7 @@ _ = glocale.translation.sgettext
|
||||
from gramps.gen.lib import EventRoleType, EventType, NoteType, Person
|
||||
from gramps.gen.plug.menu import BooleanOption, FamilyOption, FilterOption
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
@ -229,7 +229,7 @@ class FamilyGroup(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.start_cell("FGR-TextContentsEnd", 2)
|
||||
self.doc.start_paragraph('FGR-Normal')
|
||||
mark = ReportUtils.get_person_mark(self.db, father)
|
||||
mark = utils.get_person_mark(self.db, father)
|
||||
self.doc.write_text(father_name, mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
@ -246,7 +246,7 @@ class FamilyGroup(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.start_cell("FGR-TextContentsEnd", 2)
|
||||
self.doc.start_paragraph('FGR-Normal')
|
||||
mark = ReportUtils.get_person_mark(self.db, mother)
|
||||
mark = utils.get_person_mark(self.db, mother)
|
||||
self.doc.write_text(mother_name, mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
@ -296,7 +296,7 @@ class FamilyGroup(Report):
|
||||
self.doc.start_row()
|
||||
self.doc.start_cell('FGR-ParentHead', 3)
|
||||
self.doc.start_paragraph('FGR-ParentName')
|
||||
mark = ReportUtils.get_person_mark(self.db, person)
|
||||
mark = utils.get_person_mark(self.db, person)
|
||||
# translators: needed for French, ignore otherwise
|
||||
self.doc.write_text(self._("%(str1)s: %(str2)s"
|
||||
) % {'str1' : title,
|
||||
@ -338,7 +338,7 @@ class FamilyGroup(Report):
|
||||
if self.inc_par_addr:
|
||||
addrlist = person.get_address_list()[:]
|
||||
for addr in addrlist:
|
||||
location = ReportUtils.get_address_str(addr)
|
||||
location = utils.get_address_str(addr)
|
||||
date = self._get_date(addr.get_date_object())
|
||||
|
||||
self.doc.start_row()
|
||||
@ -508,7 +508,7 @@ class FamilyGroup(Report):
|
||||
self.doc.end_cell()
|
||||
|
||||
name = self._name_display.display(person)
|
||||
mark = ReportUtils.get_person_mark(self.db, person)
|
||||
mark = utils.get_person_mark(self.db, person)
|
||||
self.doc.start_cell('FGR-ChildName', 3)
|
||||
self.doc.start_paragraph('FGR-ChildText')
|
||||
self.doc.write_text(name, mark)
|
||||
@ -591,7 +591,7 @@ class FamilyGroup(Report):
|
||||
fid = family.get_gramps_id()
|
||||
if fid:
|
||||
spouse_name += " (%s)" % fid
|
||||
mark = ReportUtils.get_person_mark(self.db, spouse)
|
||||
mark = utils.get_person_mark(self.db, spouse)
|
||||
self.doc.write_text(spouse_name, mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
@ -799,7 +799,7 @@ class FamilyGroupOptions(MenuReportOptions):
|
||||
fid = self.__fid.get_value()
|
||||
family = self.__db.get_family_from_gramps_id(fid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_family_filters(self.__db, family,
|
||||
filter_list = utils.get_family_filters(self.__db, family,
|
||||
include_single=True,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -51,7 +51,7 @@ from gramps.gen.display.place import displayer as place_displayer
|
||||
from gramps.gen.plug.menu import (BooleanOption, FilterOption, PersonOption,
|
||||
BooleanListOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import Bibliography
|
||||
from gramps.gen.plug.report import endnotes as Endnotes
|
||||
@ -304,7 +304,7 @@ class IndivCompleteReport(Report):
|
||||
if father_handle:
|
||||
father = self._db.get_person_from_handle(father_handle)
|
||||
fname = self._name_display.display(father)
|
||||
mark = ReportUtils.get_person_mark(self._db, father)
|
||||
mark = utils.get_person_mark(self._db, father)
|
||||
self.write_p_entry(self._('Father'), fname, frel, mark)
|
||||
else:
|
||||
self.write_p_entry(self._('Father'), '', '')
|
||||
@ -313,7 +313,7 @@ class IndivCompleteReport(Report):
|
||||
if mother_handle:
|
||||
mother = self._db.get_person_from_handle(mother_handle)
|
||||
mname = self._name_display.display(mother)
|
||||
mark = ReportUtils.get_person_mark(self._db, mother)
|
||||
mark = utils.get_person_mark(self._db, mother)
|
||||
self.write_p_entry(self._('Mother'), mname, mrel, mark)
|
||||
else:
|
||||
self.write_p_entry(self._('Mother'), '', '')
|
||||
@ -373,7 +373,7 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_row()
|
||||
|
||||
for addr in alist:
|
||||
text = ReportUtils.get_address_str(addr)
|
||||
text = utils.get_address_str(addr)
|
||||
date = self._get_date(addr.get_date_object())
|
||||
endnotes = self._cite_endnote(addr)
|
||||
self.doc.start_row()
|
||||
@ -560,7 +560,7 @@ class IndivCompleteReport(Report):
|
||||
self.doc.start_row()
|
||||
self.doc.start_cell('IDS-NormalCell')
|
||||
self.write_paragraph(description, style='IDS-ImageCaptionCenter')
|
||||
ReportUtils.insert_image(self._db, self.doc, media_ref, self._user,
|
||||
utils.insert_image(self._db, self.doc, media_ref, self._user,
|
||||
align='center', w_cm=5.0, h_cm=5.0)
|
||||
self.do_attributes(media.get_attribute_list() +
|
||||
media_ref.get_attribute_list())
|
||||
@ -604,7 +604,7 @@ class IndivCompleteReport(Report):
|
||||
if spouse_id:
|
||||
spouse = self._db.get_person_from_handle(spouse_id)
|
||||
text = self.get_name(spouse)
|
||||
mark = ReportUtils.get_person_mark(self._db, spouse)
|
||||
mark = utils.get_person_mark(self._db, spouse)
|
||||
else:
|
||||
spouse = None
|
||||
text = self._("unknown")
|
||||
@ -627,7 +627,7 @@ class IndivCompleteReport(Report):
|
||||
for child_ref in child_ref_list:
|
||||
child = self._db.get_person_from_handle(child_ref.ref)
|
||||
name = self.get_name(child)
|
||||
mark = ReportUtils.get_person_mark(self._db, child)
|
||||
mark = utils.get_person_mark(self._db, child)
|
||||
endnotes = self._cite_endnote(child_ref)
|
||||
self.write_paragraph(name, endnotes=endnotes, mark=mark)
|
||||
self.doc.end_cell()
|
||||
@ -802,7 +802,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
name = self.person.get_primary_name()
|
||||
text = self.get_name(self.person)
|
||||
mark = ReportUtils.get_person_mark(self._db, self.person)
|
||||
mark = utils.get_person_mark(self._db, self.person)
|
||||
endnotes = self._cite_endnote(self.person)
|
||||
endnotes = self._cite_endnote(name, prior=endnotes)
|
||||
|
||||
@ -814,7 +814,7 @@ class IndivCompleteReport(Report):
|
||||
father_inst = self._db.get_person_from_handle(
|
||||
father_inst_id)
|
||||
father = self.get_name(father_inst)
|
||||
fmark = ReportUtils.get_person_mark(self._db, father_inst)
|
||||
fmark = utils.get_person_mark(self._db, father_inst)
|
||||
else:
|
||||
father = ""
|
||||
fmark = None
|
||||
@ -822,7 +822,7 @@ class IndivCompleteReport(Report):
|
||||
if mother_inst_id:
|
||||
mother_inst = self._db.get_person_from_handle(mother_inst_id)
|
||||
mother = self.get_name(mother_inst)
|
||||
mmark = ReportUtils.get_person_mark(self._db, mother_inst)
|
||||
mmark = utils.get_person_mark(self._db, mother_inst)
|
||||
else:
|
||||
mother = ""
|
||||
mmark = None
|
||||
@ -1077,7 +1077,7 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=True,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
@ -1114,8 +1114,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
font.set_size(16)
|
||||
para = ParagraphStyle()
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_top_margin(ReportUtils.pt2cm(8))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(8))
|
||||
para.set_top_margin(utils.pt2cm(8))
|
||||
para.set_bottom_margin(utils.pt2cm(8))
|
||||
para.set_font(font)
|
||||
para.set_description(_("The style used for the title of the page."))
|
||||
default_style.add_paragraph_style("IDS-Title", para)
|
||||
@ -1127,8 +1127,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
font.set_italic(1)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_("The style used for category labels."))
|
||||
default_style.add_paragraph_style("IDS-TableTitle", para)
|
||||
|
||||
@ -1138,8 +1138,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
font.set_size(12)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_("The style used for the spouse's name."))
|
||||
default_style.add_paragraph_style("IDS-Spouse", para)
|
||||
|
||||
@ -1147,8 +1147,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
font.set_size(12)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('The basic style used for the text display.'))
|
||||
default_style.add_paragraph_style("IDS-Normal", para)
|
||||
|
||||
@ -1157,8 +1157,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
font.set_italic(1)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('The style used for the section headers.'))
|
||||
default_style.add_paragraph_style("IDS-Section", para)
|
||||
|
||||
@ -1167,8 +1167,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_alignment(PARA_ALIGN_RIGHT)
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('A style used for image facts.'))
|
||||
default_style.add_paragraph_style("IDS-ImageNote", para)
|
||||
|
||||
@ -1177,8 +1177,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('A style used for image captions.'))
|
||||
default_style.add_paragraph_style("IDS-ImageCaptionCenter", para)
|
||||
|
||||
|
@ -44,7 +44,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
PARA_ALIGN_CENTER)
|
||||
from gramps.gen.plug.menu import NumberOption, BooleanOption, PersonOption
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
|
||||
@ -304,7 +304,7 @@ class KinshipReport(Report):
|
||||
person = self.database.get_person_from_handle(person_handle)
|
||||
|
||||
name = self._name_display.display(person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
birth_date = ""
|
||||
birth = get_birth_or_fallback(self.database, person)
|
||||
if birth:
|
||||
@ -386,7 +386,7 @@ class KinshipOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(1)
|
||||
para.set_bottom_border(1)
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(8))
|
||||
para.set_bottom_margin(utils.pt2cm(8))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_("The style used for the title of the page."))
|
||||
@ -398,7 +398,7 @@ class KinshipOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(3)
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(6))
|
||||
para.set_top_margin(utils.pt2cm(6))
|
||||
para.set_description(_('The basic style used for sub-headings.'))
|
||||
default_style.add_paragraph_style("KIN-Subtitle", para)
|
||||
|
||||
|
@ -41,7 +41,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER,
|
||||
INDEX_TYPE_TOC)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.simple import SimpleAccess
|
||||
@ -166,8 +166,8 @@ class NoteLinkOptions(MenuReportOptions):
|
||||
p = ParagraphStyle()
|
||||
p.set_header_level(1)
|
||||
p.set_bottom_border(1)
|
||||
p.set_top_margin(ReportUtils.pt2cm(3))
|
||||
p.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
p.set_top_margin(utils.pt2cm(3))
|
||||
p.set_bottom_margin(utils.pt2cm(3))
|
||||
p.set_font(f)
|
||||
p.set_alignment(PARA_ALIGN_CENTER)
|
||||
p.set_description(_("The style used for the title of the page."))
|
||||
@ -188,8 +188,8 @@ class NoteLinkOptions(MenuReportOptions):
|
||||
p = ParagraphStyle()
|
||||
p.set(first_indent=-0.75, lmargin=.75)
|
||||
p.set_font(font)
|
||||
p.set_top_margin(ReportUtils.pt2cm(3))
|
||||
p.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
p.set_top_margin(utils.pt2cm(3))
|
||||
p.set_bottom_margin(utils.pt2cm(3))
|
||||
p.set_description(_('The basic style used for the text display.'))
|
||||
default_style.add_paragraph_style("NoteLink-Normal", p)
|
||||
|
||||
@ -199,8 +199,8 @@ class NoteLinkOptions(MenuReportOptions):
|
||||
p = ParagraphStyle()
|
||||
p.set(first_indent=-0.75, lmargin=.75)
|
||||
p.set_font(font)
|
||||
p.set_top_margin(ReportUtils.pt2cm(3))
|
||||
p.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
p.set_top_margin(utils.pt2cm(3))
|
||||
p.set_bottom_margin(utils.pt2cm(3))
|
||||
p.set_description(_('The basic style used for table headings.'))
|
||||
default_style.add_paragraph_style("NoteLink-Normal-Bold", p)
|
||||
|
||||
|
@ -45,7 +45,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER,
|
||||
INDEX_TYPE_TOC)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
|
||||
@ -212,7 +212,7 @@ class NumberOfAncestorsOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(1)
|
||||
para.set_bottom_border(1)
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(8))
|
||||
para.set_bottom_margin(utils.pt2cm(8))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_("The style used for the title of the page."))
|
||||
|
@ -46,7 +46,7 @@ from gramps.gen.plug.menu import (BooleanOption, EnumeratedListOption,
|
||||
FilterOption, NumberOption,
|
||||
PersonOption, StringOption)
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.lib import Span
|
||||
@ -144,7 +144,7 @@ class RecordsReport(Report):
|
||||
mark = None
|
||||
if handletype == 'Person':
|
||||
person = self.database.get_person_from_handle(handle)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
elif handletype == 'Family':
|
||||
family = self.database.get_family_from_handle(handle)
|
||||
# librecords.py checks that the family has both
|
||||
@ -153,10 +153,10 @@ class RecordsReport(Report):
|
||||
# have to do any similar checking here, it's been done
|
||||
f_handle = family.get_father_handle()
|
||||
dad = self.database.get_person_from_handle(f_handle)
|
||||
f_mark = ReportUtils.get_person_mark(self.database, dad)
|
||||
f_mark = utils.get_person_mark(self.database, dad)
|
||||
m_handle = family.get_mother_handle()
|
||||
mom = self.database.get_person_from_handle(m_handle)
|
||||
m_mark = ReportUtils.get_person_mark(self.database, mom)
|
||||
m_mark = utils.get_person_mark(self.database, mom)
|
||||
else:
|
||||
raise ReportError(_(
|
||||
"Option '%(opt_name)s' is present "
|
||||
@ -262,7 +262,7 @@ class RecordsReportOptions(MenuReportOptions):
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = ReportUtils.get_person_filters(person,
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
@ -308,7 +308,7 @@ class RecordsReportOptions(MenuReportOptions):
|
||||
font.set_bold(True)
|
||||
para = ParagraphStyle()
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(6))
|
||||
para.set_top_margin(utils.pt2cm(6))
|
||||
para.set_description(_('The style used for headings.'))
|
||||
default_style.add_paragraph_style('REC-Heading', para)
|
||||
|
||||
@ -326,6 +326,6 @@ class RecordsReportOptions(MenuReportOptions):
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_top_border(True)
|
||||
para.set_top_margin(ReportUtils.pt2cm(8))
|
||||
para.set_top_margin(utils.pt2cm(8))
|
||||
para.set_description(_('The style used for the footer.'))
|
||||
default_style.add_paragraph_style('REC-Footer', para)
|
||||
|
@ -41,7 +41,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
from gramps.gen.lib import Person
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
@ -300,8 +300,8 @@ class SummaryOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(1)
|
||||
para.set_bottom_border(1)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_("The style used for the title of the page."))
|
||||
@ -321,7 +321,7 @@ class SummaryOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set(first_indent=-0.75, lmargin=.75)
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('The basic style used for the text display.'))
|
||||
default_style.add_paragraph_style("SR-Normal", para)
|
||||
|
@ -39,7 +39,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
from gramps.gen.plug.menu import EnumeratedListOption
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
@ -187,7 +187,7 @@ class TagReport(Report):
|
||||
self.doc.end_cell()
|
||||
|
||||
name = self._name_display.display(person)
|
||||
mark = ReportUtils.get_person_mark(self.database, person)
|
||||
mark = utils.get_person_mark(self.database, person)
|
||||
self.doc.start_cell('TR-TableCell')
|
||||
self.doc.start_paragraph('TR-Normal')
|
||||
self.doc.write_text(name, mark)
|
||||
@ -279,7 +279,7 @@ class TagReport(Report):
|
||||
father_handle = family.get_father_handle()
|
||||
if father_handle:
|
||||
father = self.database.get_person_from_handle(father_handle)
|
||||
mark = ReportUtils.get_person_mark(self.database, father)
|
||||
mark = utils.get_person_mark(self.database, father)
|
||||
self.doc.write_text(self._name_display.display(father), mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
@ -289,7 +289,7 @@ class TagReport(Report):
|
||||
mother_handle = family.get_mother_handle()
|
||||
if mother_handle:
|
||||
mother = self.database.get_person_from_handle(mother_handle)
|
||||
mark = ReportUtils.get_person_mark(self.database, mother)
|
||||
mark = utils.get_person_mark(self.database, mother)
|
||||
self.doc.write_text(self._name_display.display(mother), mark)
|
||||
self.doc.end_paragraph()
|
||||
self.doc.end_cell()
|
||||
@ -922,8 +922,8 @@ class TagOptions(MenuReportOptions):
|
||||
font.set_bold(1)
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(1)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_("The style used for the title of the page."))
|
||||
@ -933,8 +933,8 @@ class TagOptions(MenuReportOptions):
|
||||
font.set(face=FONT_SANS_SERIF, size=12, bold=1)
|
||||
para = ParagraphStyle()
|
||||
para.set_header_level(1)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_font(font)
|
||||
para.set_alignment(PARA_ALIGN_CENTER)
|
||||
para.set_description(_('The style used for the subtitle.'))
|
||||
@ -955,8 +955,8 @@ class TagOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set(first_indent=-0.75, lmargin=.75)
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('The basic style used for the text display.'))
|
||||
default_style.add_paragraph_style("TR-Normal", para)
|
||||
|
||||
@ -966,15 +966,15 @@ class TagOptions(MenuReportOptions):
|
||||
para = ParagraphStyle()
|
||||
para.set(first_indent=-0.75, lmargin=.75)
|
||||
para.set_font(font)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('The basic style used for table headings.'))
|
||||
default_style.add_paragraph_style("TR-Normal-Bold", para)
|
||||
|
||||
para = ParagraphStyle()
|
||||
para.set(first_indent=-0.75, lmargin=.75)
|
||||
para.set_top_margin(ReportUtils.pt2cm(3))
|
||||
para.set_bottom_margin(ReportUtils.pt2cm(3))
|
||||
para.set_top_margin(utils.pt2cm(3))
|
||||
para.set_bottom_margin(utils.pt2cm(3))
|
||||
para.set_description(_('The basic style used for the note display.'))
|
||||
default_style.add_paragraph_style("TR-Note", para)
|
||||
|
||||
|
@ -52,7 +52,7 @@ from gramps.gen.errors import WindowActiveError
|
||||
from gramps.gen.datehandler import get_date
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
from gramps.gui.plug import tool
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gui.display import display_help
|
||||
from gramps.gui.managedwindow import ManagedWindow
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
@ -448,7 +448,7 @@ class EventComparisonOptions(tool.ToolOptions):
|
||||
self.options_dict = {
|
||||
'filter' : 0,
|
||||
}
|
||||
filters = ReportUtils.get_person_filters(None)
|
||||
filters = utils.get_person_filters(None)
|
||||
self.options_help = {
|
||||
'filter' : ("=num","Filter number.",
|
||||
[ filt.get_name() for filt in filters ],
|
||||
|
@ -41,7 +41,7 @@ _ = glocale.translation.sgettext
|
||||
ngettext = glocale.translation.ngettext # else "nearby" comments are ignored
|
||||
from gramps.gen.const import URL_MANUAL_PAGE
|
||||
from gramps.gui.plug import tool
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gui.editors import EditPerson, EditFamily
|
||||
from gramps.gui.managedwindow import ManagedWindow
|
||||
from gramps.gui.utils import ProgressMeter
|
||||
@ -332,7 +332,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
|
||||
# step 1 -- spouses
|
||||
for familyHandle in person.get_family_handle_list():
|
||||
family = self.db.get_family_from_handle(familyHandle)
|
||||
spouseHandle = ReportUtils.find_spouse(person, family)
|
||||
spouseHandle = utils.find_spouse(person, family)
|
||||
if spouseHandle and \
|
||||
spouseHandle not in self.handlesOfPeopleAlreadyProcessed:
|
||||
self.handlesOfPeopleToBeProcessed.add(spouseHandle)
|
||||
|
@ -37,7 +37,7 @@ _ = glocale.translation.gettext
|
||||
from gramps.gen.sort import Sort
|
||||
from gramps.gen.db import DbTxn
|
||||
from gramps.gui.plug import MenuToolOptions, PluginWindows
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.menu import FilterOption, PersonOption, \
|
||||
EnumeratedListOption, BooleanOption
|
||||
|
||||
@ -210,5 +210,5 @@ class SortEventOptions(MenuToolOptions):
|
||||
"""
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
filter_list = ReportUtils.get_person_filters(person, False)
|
||||
filter_list = utils.get_person_filters(person, False)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -109,7 +109,7 @@ from gramps.gen.plug.menu import (PersonOption, NumberOption, StringOption,
|
||||
FilterOption, NoteOption, MediaOption,
|
||||
DestinationOption)
|
||||
from gramps.gen.plug.report import (Report, Bibliography)
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
|
||||
@ -718,7 +718,7 @@ class BasePage:
|
||||
table += trow
|
||||
# find the spouse of the principal individual and
|
||||
# display that person
|
||||
sp_hdl = ReportUtils.find_spouse(individual, family)
|
||||
sp_hdl = utils.find_spouse(individual, family)
|
||||
if sp_hdl:
|
||||
spouse = self.r_db.get_person_from_handle(sp_hdl)
|
||||
if spouse:
|
||||
@ -3331,7 +3331,7 @@ class SurnamePage(BasePage):
|
||||
fam_count += 1
|
||||
family = self.r_db.get_family_from_handle(
|
||||
family_handle)
|
||||
partner_handle = ReportUtils.find_spouse(
|
||||
partner_handle = utils.find_spouse(
|
||||
person, family)
|
||||
if partner_handle:
|
||||
link = self.new_person_link(partner_handle,
|
||||
@ -6184,7 +6184,7 @@ class PersonPages(BasePage):
|
||||
for family_handle in family_list:
|
||||
family = self.r_db.get_family_from_handle(
|
||||
family_handle)
|
||||
partner_handle = ReportUtils.find_spouse(
|
||||
partner_handle = utils.find_spouse(
|
||||
person, family)
|
||||
if partner_handle:
|
||||
if not first_family:
|
||||
@ -7550,7 +7550,7 @@ class PersonPages(BasePage):
|
||||
ped = []
|
||||
for family_handle in self.person.get_family_handle_list():
|
||||
rel_family = self.r_db.get_family_from_handle(family_handle)
|
||||
spouse_handle = ReportUtils.find_spouse(self.person, rel_family)
|
||||
spouse_handle = utils.find_spouse(self.person, rel_family)
|
||||
if spouse_handle:
|
||||
spouse = self.r_db.get_person_from_handle(spouse_handle)
|
||||
pedsp = (Html("li", class_="spouse") +
|
||||
@ -9798,7 +9798,7 @@ class NavWebOptions(MenuReportOptions):
|
||||
"""
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
filter_list = ReportUtils.get_person_filters(person, False)
|
||||
filter_list = utils.get_person_filters(person, False)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
@ -9982,7 +9982,7 @@ def __get_person_keyname(dbase, handle):
|
||||
def __get_place_keyname(dbase, handle):
|
||||
""" ... """
|
||||
|
||||
return ReportUtils.place_name(dbase, handle)
|
||||
return utils.place_name(dbase, handle)
|
||||
|
||||
# See : http://www.gramps-project.org/bugs/view.php?id = 4423
|
||||
|
||||
|
@ -55,7 +55,7 @@ from gramps.version import VERSION
|
||||
from gramps.gen.constfunc import win
|
||||
from gramps.gen.config import config
|
||||
from gramps.gen.plug.report import Report
|
||||
from gramps.gen.plug.report import utils as ReportUtils
|
||||
from gramps.gen.plug.report import utils
|
||||
from gramps.gen.plug.report import MenuReportOptions
|
||||
from gramps.gen.plug.report import stdoptions
|
||||
from gramps.gen.plug.menu import (BooleanOption, NumberOption, StringOption,
|
||||
@ -1832,7 +1832,7 @@ class WebCalOptions(MenuReportOptions):
|
||||
"""
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
filter_list = ReportUtils.get_person_filters(person, False)
|
||||
filter_list = utils.get_person_filters(person, False)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
|
Loading…
Reference in New Issue
Block a user