* src/plugins/vaious: upgrade to new report interface

svn: r6838
This commit is contained in:
Brian Matherly 2006-06-01 04:39:40 +00:00
parent bf7247c5e4
commit f99fbb9fda
25 changed files with 220 additions and 167 deletions

View File

@ -1,3 +1,6 @@
2006-05-31 Brian Matherly <brian@gramps-project.org>
* src/plugins/vaious: upgrade to new report interface
2006-05-31 Don Allingham <don@gramps-project.org> 2006-05-31 Don Allingham <don@gramps-project.org>
* src/DataViews/_PersonView.py: call FilterEditor * src/DataViews/_PersonView.py: call FilterEditor
* src/FilterEditor/__init__.py: added * src/FilterEditor/__init__.py: added

View File

@ -42,7 +42,10 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import BaseDoc import BaseDoc
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
from SubstKeywords import SubstKeywords from SubstKeywords import SubstKeywords
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
@ -59,7 +62,7 @@ _DIED = _('d.')
# AncestorChart # AncestorChart
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class AncestorChart(Report.Report): class AncestorChart(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -78,7 +81,7 @@ class AncestorChart(Report.Report):
pagebbg - Whether to include page breaks between generations. pagebbg - Whether to include page breaks between generations.
dispf - Display format for the output box. dispf - Display format for the output box.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.get_report_generations() = options_class.get_report_generations()
@ -216,14 +219,14 @@ class AncestorChart(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class AncestorChartOptions(ReportOptions.ReportOptions): class AncestorChartOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def enable_options(self): def enable_options(self):
# Semi-common options that should be enabled for this report # Semi-common options that should be enabled for this report
@ -262,10 +265,10 @@ class AncestorChartOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'ancestor_chart', name = 'ancestor_chart',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = AncestorChart, report_class = AncestorChart,
options_class = AncestorChartOptions, options_class = AncestorChartOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Ancestor Chart"), translated_name = _("Ancestor Chart"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",

View File

@ -44,7 +44,9 @@ import gtk
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import BaseDoc import BaseDoc
from SubstKeywords import SubstKeywords from SubstKeywords import SubstKeywords
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
cm2pt = ReportUtils.cm2pt cm2pt = ReportUtils.cm2pt
@ -161,7 +163,7 @@ class GenChart:
# AncestorChart # AncestorChart
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class AncestorChart(Report.Report): class AncestorChart(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -183,7 +185,7 @@ class AncestorChart(Report.Report):
compress - Whether to compress chart. compress - Whether to compress chart.
title - Title of the report displayed on top. title - Title of the report displayed on top.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.get_report_generations() = options_class.get_report_generations()
@ -417,14 +419,14 @@ class AncestorChart(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class AncestorChartOptions(ReportOptions.ReportOptions): class AncestorChartOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -513,10 +515,10 @@ class AncestorChartOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'ancestor_chart2', name = 'ancestor_chart2',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = AncestorChart, report_class = AncestorChart,
options_class = AncestorChartOptions, options_class = AncestorChartOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Ancestor Graph"), translated_name = _("Ancestor Graph"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",

View File

@ -42,8 +42,10 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import const import const
from PluginUtils import Report, ReportOptions, ReportUtils, \ from PluginUtils import register_report , relationship_class
register_report, relationship_class from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
import RelLib import RelLib
from DateHandler import displayer as _dd from DateHandler import displayer as _dd
@ -54,7 +56,7 @@ from NameDisplay import displayer as _nd
# ComprehensiveAncestorsReport # ComprehensiveAncestorsReport
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class ComprehensiveAncestorsReport (Report.Report): class ComprehensiveAncestorsReport (Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -74,7 +76,7 @@ class ComprehensiveAncestorsReport (Report.Report):
cites - Whether or not to include source informaiton. cites - Whether or not to include source informaiton.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.map = {} self.map = {}
@ -854,14 +856,14 @@ class ComprehensiveAncestorsReport (Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class ComprehensiveAncestorsOptions(ReportOptions.ReportOptions): class ComprehensiveAncestorsOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -959,10 +961,10 @@ class ComprehensiveAncestorsOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'ancestors_report', name = 'ancestors_report',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = ComprehensiveAncestorsReport, report_class = ComprehensiveAncestorsReport,
options_class = ComprehensiveAncestorsOptions, options_class = ComprehensiveAncestorsOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Comprehensive Ancestors Report"), translated_name = _("Comprehensive Ancestors Report"),
status = _("Beta"), status = _("Beta"),
description= _("Produces a detailed ancestral report."), description= _("Produces a detailed ancestral report."),

View File

@ -37,7 +37,9 @@ import locale
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import BaseDoc import BaseDoc
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
from Filters import CustomFilters, GenericFilter, ParamFilter, Rules from Filters import CustomFilters, GenericFilter, ParamFilter, Rules
import GrampsLocale import GrampsLocale
@ -88,7 +90,7 @@ def easter(year):
# Calendar # Calendar
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class Calendar(Report.Report): class Calendar(Report):
""" """
Creates the Calendar object that produces the report. Creates the Calendar object that produces the report.
""" """
@ -551,7 +553,7 @@ class FilterWidget(Widget):
# it would be ok to put there, because self.widgets would be empty. # it would be ok to put there, because self.widgets would be empty.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
class NewReportOptions(ReportOptions.ReportOptions): class NewReportOptions(ReportOptions):
""" """
Defines options and provides code to handling the interface. Defines options and provides code to handling the interface.
This is free of any graphics specifics. This is free of any graphics specifics.
@ -910,10 +912,10 @@ class Holidays:
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'calendar', name = 'calendar',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = Calendar, report_class = Calendar,
options_class = CalendarOptions, options_class = CalendarOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Calendar"), translated_name = _("Calendar"),
status = _("Experimental"), status = _("Experimental"),
author_name = "Douglas S. Blank", author_name = "Douglas S. Blank",

View File

@ -37,7 +37,8 @@ from gettext import gettext as _
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from PluginUtils import Tool, Report, cl_list, cli_tool_list, register_tool from PluginUtils import Tool, cl_list, cli_tool_list, register_tool
from ReportBase import Report, CATEGORY_BOOK, CATEGORY_CODE, CATEGORY_WEB
import Utils import Utils
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -102,9 +103,9 @@ class CmdRef(Tool.Tool):
for item in cl_list: for item in cl_list:
category = item[1] category = item[1]
if category in (Report.CATEGORY_BOOK, if category in (CATEGORY_BOOK,
Report.CATEGORY_CODE, CATEGORY_CODE,
Report.CATEGORY_WEB): CATEGORY_WEB):
self.write_ref(f,item,level+2,id_counter,category) self.write_ref(f,item,level+2,id_counter,category)
else: else:
self.write_ref(f,item,level+2,id_counter,None) self.write_ref(f,item,level+2,id_counter,None)
@ -157,13 +158,13 @@ class CmdRef(Tool.Tool):
# Instantiate options class # Instantiate options class
if category == None: if category == None:
oclass = item[3]( item[0]) oclass = item[3]( item[0])
elif category == Report.CATEGORY_BOOK: elif category == CATEGORY_BOOK:
import BookReport import BookReport
oclass = BookReport.BookOptions(item[0]) oclass = BookReport.BookOptions(item[0])
elif category == Report.CATEGORY_CODE: elif category == CATEGORY_CODE:
import GraphViz import GraphViz
oclass = GraphViz.GraphVizOptions(item[0]) oclass = GraphViz.GraphVizOptions(item[0])
elif category == Report.CATEGORY_WEB: elif category == CATEGORY_WEB:
if item[0] == "webpage": if item[0] == "webpage":
import WebPage import WebPage
oclass = WebPage.WebReportOptions(item[0]) oclass = WebPage.WebReportOptions(item[0])

View File

@ -46,7 +46,8 @@ import gtk.glade
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import Utils import Utils
from PluginUtils import Report, register_report from PluginUtils import register_report
from ReportBase import Report, CATEGORY_VIEW, MODE_GUI
from ManagedWindow import set_titles from ManagedWindow import set_titles
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -126,10 +127,10 @@ class CountAncestors:
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
register_report( register_report(
name = 'count_ancestors', name = 'count_ancestors',
category = Report.CATEGORY_VIEW, category = CATEGORY_VIEW,
report_class = CountAncestors, report_class = CountAncestors,
options_class = None, options_class = None,
modes = Report.MODE_GUI, modes = MODE_GUI,
translated_name = _("Number of ancestors"), translated_name = _("Number of ancestors"),
status = _("Beta"), status = _("Beta"),
description= _("Counts number of ancestors of selected person") description= _("Counts number of ancestors of selected person")

View File

@ -41,7 +41,8 @@ import gtk
# gramps modules # gramps modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, register_report from PluginUtils import register_report
from ReportBase import Report, ReportOptions, CATEGORY_TEXT, MODE_BKI
import BaseDoc import BaseDoc
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -49,7 +50,7 @@ import BaseDoc
# CustomText # CustomText
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class CustomText(Report.Report): class CustomText(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -68,7 +69,7 @@ class CustomText(Report.Report):
mid - Text in the middle. mid - Text in the middle.
bot - Text on the bottom. bot - Text on the bottom.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.top_text = options_class.handler.options_dict['top'] self.top_text = options_class.handler.options_dict['top']
self.middle_text = options_class.handler.options_dict['mid'] self.middle_text = options_class.handler.options_dict['mid']
@ -92,14 +93,14 @@ class CustomText(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class CustomTextOptions(ReportOptions.ReportOptions): class CustomTextOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -210,9 +211,9 @@ class CustomTextOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'custom_text', name = 'custom_text',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = CustomText, report_class = CustomText,
options_class = CustomTextOptions, options_class = CustomTextOptions,
modes = Report.MODE_BKI, modes = MODE_BKI,
translated_name = _("Custom Text"), translated_name = _("Custom Text"),
) )

View File

@ -41,7 +41,10 @@ import gtk
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
import BaseDoc import BaseDoc
from SubstKeywords import SubstKeywords from SubstKeywords import SubstKeywords
@ -127,7 +130,7 @@ class DescendLine(GraphLayout):
# DescendantGraph # DescendantGraph
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DescendantGraph(Report.Report): class DescendantGraph(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -144,7 +147,7 @@ class DescendantGraph(Report.Report):
dispf - Display format for the output box. dispf - Display format for the output box.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.display = options_class.handler.options_dict['dispf'] self.display = options_class.handler.options_dict['dispf']
@ -359,14 +362,14 @@ class DescendantGraph(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DescendantGraphOptions(ReportOptions.ReportOptions): class DescendantGraphOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def enable_options(self): def enable_options(self):
# Semi-common options that should be enabled for this report # Semi-common options that should be enabled for this report
@ -403,10 +406,10 @@ class DescendantGraphOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'descendant_graph', name = 'descendant_graph',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = DescendantGraph, report_class = DescendantGraph,
options_class = DescendantGraphOptions, options_class = DescendantGraphOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Descendant Graph"), translated_name = _("Descendant Graph"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",

View File

@ -43,7 +43,9 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import BaseDoc import BaseDoc
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportOptions, ReportUtils, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
cm2pt = ReportUtils.cm2pt cm2pt = ReportUtils.cm2pt
from SubstKeywords import SubstKeywords from SubstKeywords import SubstKeywords
@ -103,7 +105,7 @@ class GenChart:
# DescendChart # DescendChart
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DescendChart(Report.Report): class DescendChart(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -123,7 +125,7 @@ class DescendChart(Report.Report):
title - Title of the report displayed on top. title - Title of the report displayed on top.
maxgen - Maximum number of generations to include. maxgen - Maximum number of generations to include.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.get_report_generations() = options_class.get_report_generations()
@ -372,14 +374,14 @@ class DescendChart(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DescendChartOptions(ReportOptions.ReportOptions): class DescendChartOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -465,10 +467,10 @@ class DescendChartOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'descend_chart2', name = 'descend_chart2',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = DescendChart, report_class = DescendChart,
options_class = DescendChartOptions, options_class = DescendChartOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Descendant Chart"), translated_name = _("Descendant Chart"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",

View File

@ -35,7 +35,9 @@ from gettext import gettext as _
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
import Errors import Errors
import Sort import Sort
@ -58,7 +60,7 @@ _DIED = _('d.')
# DescendantReport # DescendantReport
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DescendantReport(Report.Report): class DescendantReport(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -78,7 +80,7 @@ class DescendantReport(Report.Report):
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.get_report_generations() = options_class.get_report_generations()
@ -186,14 +188,14 @@ class DescendantReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DescendantOptions(ReportOptions.ReportOptions): class DescendantOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def enable_options(self): def enable_options(self):
# Semi-common options that should be enabled for this report # Semi-common options that should be enabled for this report
@ -247,10 +249,10 @@ class DescendantOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'descend_report', name = 'descend_report',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = DescendantReport, report_class = DescendantReport,
options_class = DescendantOptions, options_class = DescendantOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Descendant Report"), translated_name = _("Descendant Report"),
status=(_("Stable")), status=(_("Stable")),
description=_("Generates a list of descendants of the active person"), description=_("Generates a list of descendants of the active person"),

View File

@ -44,7 +44,10 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import RelLib import RelLib
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
import Utils import Utils
import DateHandler import DateHandler
@ -63,7 +66,7 @@ EMPTY_ENTRY = "_____________"
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DetAncestorReport(Report.Report): class DetAncestorReport(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -91,7 +94,7 @@ class DetAncestorReport(Report.Report):
childRef - Whether to add descendant references in child list. childRef - Whether to add descendant references in child list.
addImages - Whether to include images. addImages - Whether to include images.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.map = {} self.map = {}
@ -579,14 +582,14 @@ class DetAncestorReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DetAncestorOptions(ReportOptions.ReportOptions): class DetAncestorOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -858,10 +861,10 @@ class DetAncestorOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'det_ancestor_report', name = 'det_ancestor_report',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = DetAncestorReport, report_class = DetAncestorReport,
options_class = DetAncestorOptions, options_class = DetAncestorOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Detailed Ancestral Report"), translated_name = _("Detailed Ancestral Report"),
status=(_("Beta")), status=(_("Beta")),
description= _("Produces a detailed ancestral report"), description= _("Produces a detailed ancestral report"),

View File

@ -46,7 +46,9 @@ import gtk
import RelLib import RelLib
import Utils import Utils
import Errors import Errors
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
import const import const
import DateHandler import DateHandler
@ -66,7 +68,7 @@ HENRY = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DetDescendantReport(Report.Report): class DetDescendantReport(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -95,7 +97,7 @@ class DetDescendantReport(Report.Report):
childRef - Whether to add descendant references in child list. childRef - Whether to add descendant references in child list.
addImages - Whether to include images. addImages - Whether to include images.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.map = {} self.map = {}
@ -611,14 +613,14 @@ class DetDescendantReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class DetDescendantOptions(ReportOptions.ReportOptions): class DetDescendantOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -898,10 +900,10 @@ class DetDescendantOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'det_descendant_report', name = 'det_descendant_report',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = DetDescendantReport, report_class = DetDescendantReport,
options_class = DetDescendantOptions, options_class = DetDescendantOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Detailed Descendant Report"), translated_name = _("Detailed Descendant Report"),
status=(_("Beta")), status=(_("Beta")),
description= _("Produces a detailed descendant report"), description= _("Produces a detailed descendant report"),

View File

@ -35,7 +35,9 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import RelLib import RelLib
from PluginUtils import Report, ReportOptions, register_report, ReportUtils from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
import DateHandler import DateHandler
import Utils import Utils
@ -46,7 +48,7 @@ from TransUtils import sgettext as _
# FamilyGroup # FamilyGroup
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FamilyGroup(Report.Report): class FamilyGroup(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -63,7 +65,7 @@ class FamilyGroup(Report.Report):
family_handle - Handle of the family to write report on. family_handle - Handle of the family to write report on.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.family_handle = None self.family_handle = None
@ -662,14 +664,14 @@ class FamilyGroup(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FamilyGroupOptions(ReportOptions.ReportOptions): class FamilyGroupOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -901,10 +903,10 @@ class FamilyGroupOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'family_group', name = 'family_group',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = FamilyGroup, report_class = FamilyGroup,
options_class = FamilyGroupOptions, options_class = FamilyGroupOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Family Group Report"), translated_name = _("Family Group Report"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",

View File

@ -40,7 +40,9 @@ import gtk
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import BaseDoc import BaseDoc
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
from SubstKeywords import SubstKeywords from SubstKeywords import SubstKeywords
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
@ -49,7 +51,7 @@ pt2cm = ReportUtils.pt2cm
# FanChart # FanChart
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FanChart(Report.Report): class FanChart(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -66,7 +68,7 @@ class FanChart(Report.Report):
display - display -
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.height = 0 self.height = 0
self.lines = 0 self.lines = 0
@ -278,14 +280,14 @@ class FanChart(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FanChartOptions(ReportOptions.ReportOptions): class FanChartOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def make_default_style(self,default_style): def make_default_style(self,default_style):
@ -316,10 +318,10 @@ class FanChartOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'fan_chart', name = 'fan_chart',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = FanChart, report_class = FanChart,
options_class = FanChartOptions, options_class = FanChartOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Fan Chart"), translated_name = _("Fan Chart"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",

View File

@ -38,14 +38,16 @@ import BaseDoc
import RelLib import RelLib
import DateHandler import DateHandler
import const import const
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# AncestorReport # AncestorReport
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FtmAncestorReport(Report.Report): class FtmAncestorReport(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -63,7 +65,7 @@ class FtmAncestorReport(Report.Report):
gen - Maximum number of generations to include. gen - Maximum number of generations to include.
pagebgg - Whether to include page breaks between generations. pagebgg - Whether to include page breaks between generations.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.map = {} self.map = {}
@ -349,14 +351,14 @@ class FtmAncestorReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FtmAncestorOptions(ReportOptions.ReportOptions): class FtmAncestorOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def enable_options(self): def enable_options(self):
# Semi-common options that should be enabled for this report # Semi-common options that should be enabled for this report
@ -414,10 +416,10 @@ class FtmAncestorOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'ftm_ancestor_report', name = 'ftm_ancestor_report',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = FtmAncestorReport, report_class = FtmAncestorReport,
options_class = FtmAncestorOptions, options_class = FtmAncestorOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("FTM Style Ancestor Report"), translated_name = _("FTM Style Ancestor Report"),
status=(_("Beta")), status=(_("Beta")),
description= _("Produces a textual ancestral report similar to Family Tree Maker."), description= _("Produces a textual ancestral report similar to Family Tree Maker."),

View File

@ -37,7 +37,9 @@ from gettext import gettext as _
# gramps modules # gramps modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
import RelLib import RelLib
import DateHandler import DateHandler
@ -48,7 +50,7 @@ import const
# DescendantReport # DescendantReport
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FtmDescendantReport(Report.Report): class FtmDescendantReport(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -67,7 +69,7 @@ class FtmDescendantReport(Report.Report):
pagebbg - Whether to include page breaks between generations. pagebbg - Whether to include page breaks between generations.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.anc_map = {} self.anc_map = {}
self.gen_map = {} self.gen_map = {}
@ -492,14 +494,14 @@ class FtmDescendantReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FtmDescendantOptions(ReportOptions.ReportOptions): class FtmDescendantOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def enable_options(self): def enable_options(self):
# Semi-common options that should be enabled for this report # Semi-common options that should be enabled for this report
@ -562,10 +564,10 @@ class FtmDescendantOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'ftm_descendant_report', name = 'ftm_descendant_report',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = FtmDescendantReport, report_class = FtmDescendantReport,
options_class = FtmDescendantOptions, options_class = FtmDescendantOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("FTM Style Descendant Report"), translated_name = _("FTM Style Descendant Report"),
status = _("Beta"), status = _("Beta"),
description= _("Produces a textual descendant report similar to Family Tree Maker."), description= _("Produces a textual descendant report similar to Family Tree Maker."),

View File

@ -52,7 +52,11 @@ import gtk
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_CODE, CATEGORY_DRAW, MODE_GUI, MODE_CLI
from ReportBase._ReportDialog import ReportDialog
from ReportBase._CommandLineReport import CommandLineReport
from Filters import GenericFilter, CustomFilters, Rules from Filters import GenericFilter, CustomFilters, Rules
import RelLib import RelLib
import DateHandler import DateHandler
@ -545,14 +549,14 @@ just use iconv:
# Options class # Options class
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class GraphVizOptions(ReportOptions.ReportOptions): class GraphVizOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -922,7 +926,7 @@ class GraphVizOptions(ReportOptions.ReportOptions):
# Dialog class # Dialog class
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class GraphVizDialog(Report.ReportDialog): class GraphVizDialog(ReportDialog):
def __init__(self,database,person): def __init__(self,database,person):
self.database = database self.database = database
@ -930,8 +934,8 @@ class GraphVizDialog(Report.ReportDialog):
name = "rel_graph" name = "rel_graph"
translated_name = _("Relationship Graph") translated_name = _("Relationship Graph")
self.options_class = GraphVizOptions(name) self.options_class = GraphVizOptions(name)
self.category = Report.CATEGORY_CODE self.category = CATEGORY_CODE
Report.ReportDialog.__init__(self,database,person,self.options_class, ReportDialog.__init__(self,database,person,self.options_class,
name,translated_name) name,translated_name)
response = self.window.run() response = self.window.run()
if response == gtk.RESPONSE_OK: if response == gtk.RESPONSE_OK:
@ -1102,7 +1106,7 @@ class EmptyDoc:
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def cl_report(database,name,category,options_str_dict): def cl_report(database,name,category,options_str_dict):
clr = Report.CommandLineReport(database,name,category,GraphVizOptions, clr = CommandLineReport(database,name,category,GraphVizOptions,
options_str_dict) options_str_dict)
# Exit here if show option was given # Exit here if show option was given
@ -1116,7 +1120,7 @@ def cl_report(database,name,category,options_str_dict):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class GraphVizGraphics(Report.Report): class GraphVizGraphics(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
self.database = database self.database = database
self.start_person = person self.start_person = person
@ -1202,10 +1206,10 @@ def get_description_graphics():
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'rel_graph', name = 'rel_graph',
category = Report.CATEGORY_CODE, category = CATEGORY_CODE,
report_class = GraphVizDialog, report_class = GraphVizDialog,
options_class = cl_report, options_class = cl_report,
modes = Report.MODE_GUI | Report.MODE_CLI, modes = MODE_GUI | MODE_CLI,
translated_name = _("Relationship Graph"), translated_name = _("Relationship Graph"),
status = _("Stable"), status = _("Stable"),
description= get_description(), description= get_description(),
@ -1216,10 +1220,10 @@ register_report(
if _dot_found: if _dot_found:
register_report( register_report(
name = 'rel_graph2', name = 'rel_graph2',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = GraphVizGraphics, report_class = GraphVizGraphics,
options_class = GraphVizOptions, options_class = GraphVizOptions,
modes = Report.MODE_GUI | Report.MODE_CLI, modes = MODE_GUI | MODE_CLI,
translated_name = _("Relationship Graph"), translated_name = _("Relationship Graph"),
status = _("Stable"), status = _("Stable"),
description= get_description_graphics(), description= get_description_graphics(),

View File

@ -46,14 +46,16 @@ import Utils
import BaseDoc import BaseDoc
from Filters import GenericFilter, Rules, CustomFilters from Filters import GenericFilter, Rules, CustomFilters
import DateHandler import DateHandler
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# IndivComplete # IndivComplete
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class IndivCompleteReport(Report.Report): class IndivCompleteReport(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -74,7 +76,7 @@ class IndivCompleteReport(Report.Report):
cites - Whether or not to include source informaiton. cites - Whether or not to include source informaiton.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.use_srcs = options_class.handler.options_dict['cites'] self.use_srcs = options_class.handler.options_dict['cites']
@ -509,14 +511,14 @@ class IndivCompleteReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class IndivCompleteOptions(ReportOptions.ReportOptions): class IndivCompleteOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -635,10 +637,10 @@ class IndivCompleteOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'indiv_complete', name = 'indiv_complete',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = IndivCompleteReport, report_class = IndivCompleteReport,
options_class = IndivCompleteOptions, options_class = IndivCompleteOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Complete Individual Report"), translated_name = _("Complete Individual Report"),
status=(_("Stable")), status=(_("Stable")),
author_name="Donald N. Allingham", author_name="Donald N. Allingham",

View File

@ -45,7 +45,9 @@ import gtk
import RelLib import RelLib
import const import const
import BaseDoc import BaseDoc
from PluginUtils import Report, ReportOptions, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import DateHandler import DateHandler
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -53,7 +55,7 @@ import DateHandler
# IndivSummary # IndivSummary
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class IndivSummary(Report.Report): class IndivSummary(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -67,7 +69,7 @@ class IndivSummary(Report.Report):
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
def define_table_styles(self): def define_table_styles(self):
tbl = BaseDoc.TableStyle() tbl = BaseDoc.TableStyle()
@ -326,14 +328,14 @@ class IndivSummary(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class IndivSummaryOptions(ReportOptions.ReportOptions): class IndivSummaryOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def make_default_style(self,default_style): def make_default_style(self,default_style):
"""Make the default output style for the Individual Summary Report.""" """Make the default output style for the Individual Summary Report."""
@ -380,10 +382,10 @@ class IndivSummaryOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'individual_summary', name = 'individual_summary',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = IndivSummary, report_class = IndivSummary,
options_class = IndivSummaryOptions, options_class = IndivSummaryOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Individual Summary"), translated_name = _("Individual Summary"),
status=(_("Stable")), status=(_("Stable")),
description=_("Produces a detailed report on the selected person."), description=_("Produces a detailed report on the selected person."),

View File

@ -69,7 +69,11 @@ import const
from GrampsCfg import get_researcher from GrampsCfg import get_researcher
from Filters import GenericFilter, Rules, CustomFilters from Filters import GenericFilter, Rules, CustomFilters
import Sort import Sort
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_WEB, MODE_GUI, MODE_CLI
from ReportBase._ReportDialog import ReportDialog
from ReportBase._CommandLineReport import CommandLineReport
import Errors import Errors
import Utils import Utils
import ImgManip import ImgManip
@ -1957,7 +1961,7 @@ class IndividualPage(BasePage):
# WebReport # WebReport
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class WebReport(Report.Report): class WebReport(Report):
def __init__(self,database,person,options): def __init__(self,database,person,options):
""" """
Creates WebReport object that produces the report. Creates WebReport object that produces the report.
@ -2296,14 +2300,14 @@ class WebReport(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class WebReportOptions(ReportOptions.ReportOptions): class WebReportOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,database=None,person_id=None): def __init__(self,name,database=None,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
self.db = database self.db = database
def set_new_options(self): def set_new_options(self):
@ -2585,7 +2589,7 @@ class WebReportOptions(ReportOptions.ReportOptions):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class WebReportDialog(Report.ReportDialog): class WebReportDialog(ReportDialog):
def __init__(self,database,person): def __init__(self,database,person):
self.database = database self.database = database
@ -2593,8 +2597,8 @@ class WebReportDialog(Report.ReportDialog):
name = "navwebpage" name = "navwebpage"
translated_name = _("Generate Web Site") translated_name = _("Generate Web Site")
self.options = WebReportOptions(name,database) self.options = WebReportOptions(name,database)
self.category = Report.CATEGORY_WEB self.category = CATEGORY_WEB
Report.ReportDialog.__init__(self,database,person,self.options, ReportDialog.__init__(self,database,person,self.options,
name,translated_name) name,translated_name)
self.style_name = None self.style_name = None
@ -2742,7 +2746,7 @@ def sort_people(db,handle_list):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def cl_report(database,name,category,options_str_dict): def cl_report(database,name,category,options_str_dict):
clr = Report.CommandLineReport(database,name,category,WebReportOptions, clr = CommandLineReport(database,name,category,WebReportOptions,
options_str_dict) options_str_dict)
# Exit here if show option was given # Exit here if show option was given
@ -2841,10 +2845,10 @@ def sort_nameof(person, private):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
register_report( register_report(
name = 'navwebpage', name = 'navwebpage',
category = Report.CATEGORY_WEB, category = CATEGORY_WEB,
report_class = WebReportDialog, report_class = WebReportDialog,
options_class = cl_report, options_class = cl_report,
modes = Report.MODE_GUI | Report.MODE_CLI, modes = MODE_GUI | MODE_CLI,
translated_name = _("Narrative Web Site"), translated_name = _("Narrative Web Site"),
status = _("Stable"), status = _("Stable"),
author_name="Donald N. Allingham", author_name="Donald N. Allingham",

View File

@ -40,7 +40,8 @@ import gtk
# gramps modules # gramps modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, register_report from PluginUtils import register_report
from ReportBase import Report, ReportOptions, CATEGORY_TEXT, MODE_BKI
import BaseDoc import BaseDoc
from Selectors import selector_factory from Selectors import selector_factory
SelectObject = selector_factory('MediaObject') SelectObject = selector_factory('MediaObject')
@ -52,7 +53,7 @@ import ImgManip
# SimpleBookTitle # SimpleBookTitle
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class SimpleBookTitle(Report.Report): class SimpleBookTitle(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -74,7 +75,7 @@ class SimpleBookTitle(Report.Report):
footer - Footer string. footer - Footer string.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
self.title_string = options_class.handler.options_dict['title'] self.title_string = options_class.handler.options_dict['title']
self.image_size = options_class.handler.options_dict['imgsize'] self.image_size = options_class.handler.options_dict['imgsize']
@ -112,14 +113,14 @@ class SimpleBookTitle(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class SimpleBookTitleOptions(ReportOptions.ReportOptions): class SimpleBookTitleOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -292,9 +293,9 @@ class SimpleBookTitleOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'simple_book_title', name = 'simple_book_title',
category = Report.CATEGORY_TEXT, category = CATEGORY_TEXT,
report_class = SimpleBookTitle, report_class = SimpleBookTitle,
options_class = SimpleBookTitleOptions, options_class = SimpleBookTitleOptions,
modes = Report.MODE_BKI, modes = MODE_BKI,
translated_name = _("Title Page"), translated_name = _("Title Page"),
) )

View File

@ -53,7 +53,9 @@ import gtk
from RelLib import Person, FamilyRelType, EventType from RelLib import Person, FamilyRelType, EventType
# gender and report type names # gender and report type names
import BaseDoc import BaseDoc
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
from Filters import GenericFilter, Rules, CustomFilters from Filters import GenericFilter, Rules, CustomFilters
import DateHandler import DateHandler
from Utils import ProgressMeter from Utils import ProgressMeter
@ -468,7 +470,7 @@ _Extract = Extract()
# Statistics report # Statistics report
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class StatisticsChart(Report.Report): class StatisticsChart(Report):
def __init__(self, database, person, options_class): def __init__(self, database, person, options_class):
""" """
@ -483,7 +485,7 @@ class StatisticsChart(Report.Report):
To see what the options are, check the options help in the options class. To see what the options are, check the options help in the options class.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
filter_num = options_class.get_filter_number() filter_num = options_class.get_filter_number()
filters = options_class.get_report_filters(person) filters = options_class.get_report_filters(person)
@ -756,12 +758,12 @@ class StatisticsChart(Report.Report):
# Statistics report options # Statistics report options
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class StatisticsChartOptions(ReportOptions.ReportOptions): class StatisticsChartOptions(ReportOptions):
""" """
Defines options and provides their handling interface. Defines options and provides their handling interface.
""" """
def __init__(self,name, person_id=None): def __init__(self,name, person_id=None):
ReportOptions.ReportOptions.__init__(self, name, person_id) ReportOptions.__init__(self, name, person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -971,10 +973,10 @@ class StatisticsChartOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'statistics_chart', name = 'statistics_chart',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = StatisticsChart, report_class = StatisticsChart,
options_class = StatisticsChartOptions, options_class = StatisticsChartOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Statistics Chart"), translated_name = _("Statistics Chart"),
status = (_("Stable")), status = (_("Stable")),
author_name="Eero Tamminen", author_name="Eero Tamminen",

View File

@ -45,7 +45,8 @@ import gtk.glade
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import Utils import Utils
import RelLib import RelLib
from PluginUtils import Report, register_report from PluginUtils import register_report
from ReportBase import Report, CATEGORY_VIEW, MODE_GUI
import DateHandler import DateHandler
from ManagedWindow import set_titles from ManagedWindow import set_titles
@ -169,10 +170,10 @@ class SummaryReport:
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
register_report( register_report(
name = 'summary', name = 'summary',
category = Report.CATEGORY_VIEW, category = CATEGORY_VIEW,
report_class = SummaryReport, report_class = SummaryReport,
options_class = None, options_class = None,
modes = Report.MODE_GUI, modes = MODE_GUI,
translated_name = _("Summary of the database"), translated_name = _("Summary of the database"),
status = _("Beta"), status = _("Beta"),
description= _("Provides a summary of the current database"), description= _("Provides a summary of the current database"),

View File

@ -43,7 +43,9 @@ import gtk
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import Report, ReportOptions, ReportUtils, register_report from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
pt2cm = ReportUtils.pt2cm pt2cm = ReportUtils.pt2cm
import BaseDoc import BaseDoc
from Filters import GenericFilter, Rules, CustomFilters from Filters import GenericFilter, Rules, CustomFilters
@ -55,7 +57,7 @@ from QuestionDialog import ErrorDialog
# TimeLine # TimeLine
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class TimeLine(Report.Report): class TimeLine(Report):
def __init__(self,database,person,options_class): def __init__(self,database,person,options_class):
""" """
@ -80,7 +82,7 @@ class TimeLine(Report.Report):
returning the list of sort functions. returning the list of sort functions.
""" """
Report.Report.__init__(self,database,person,options_class) Report.__init__(self,database,person,options_class)
filter_num = options_class.get_filter_number() filter_num = options_class.get_filter_number()
filters = options_class.get_report_filters(person) filters = options_class.get_report_filters(person)
@ -347,14 +349,14 @@ class TimeLine(Report.Report):
# #
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class TimeLineOptions(ReportOptions.ReportOptions): class TimeLineOptions(ReportOptions):
""" """
Defines options and provides handling interface. Defines options and provides handling interface.
""" """
def __init__(self,name,person_id=None): def __init__(self,name,person_id=None):
ReportOptions.ReportOptions.__init__(self,name,person_id) ReportOptions.__init__(self,name,person_id)
def set_new_options(self): def set_new_options(self):
# Options specific for this report # Options specific for this report
@ -476,10 +478,10 @@ class TimeLineOptions(ReportOptions.ReportOptions):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
register_report( register_report(
name = 'timeline', name = 'timeline',
category = Report.CATEGORY_DRAW, category = CATEGORY_DRAW,
report_class = TimeLine, report_class = TimeLine,
options_class = TimeLineOptions, options_class = TimeLineOptions,
modes = Report.MODE_GUI | Report.MODE_BKI | Report.MODE_CLI, modes = MODE_GUI | MODE_BKI | MODE_CLI,
translated_name = _("Timeline Graph"), translated_name = _("Timeline Graph"),
status = _("Stable"), status = _("Stable"),
author_name = "Donald N. Allingham", author_name = "Donald N. Allingham",