3292: register plugins, load on need, not on start of GRAMPS - GEPS 014

svn: r13400
This commit is contained in:
Benny Malengier
2009-10-24 13:53:20 +00:00
parent d1fbb2bff9
commit ed619cfdd6
195 changed files with 4123 additions and 3371 deletions

View File

@@ -37,11 +37,10 @@ from TransUtils import sgettext as _
#------------------------------------------------------------------------
from BasicUtils import name_displayer
from Errors import ReportError
from gen.plug import PluginManager
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
from gen.plug.menu import BooleanOption, NumberOption, TextOption, PersonOption
from ReportBase import Report, ReportUtils, CATEGORY_DRAW, MenuReportOptions
from ReportBase import Report, ReportUtils, MenuReportOptions
from SubstKeywords import SubstKeywords
pt2cm = ReportUtils.pt2cm
@@ -524,24 +523,3 @@ class AncestorTreeOptions(MenuReportOptions):
g = GraphicsStyle()
default_style.add_draw_style("AC2-line", g)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'ancestor_chart',
category = CATEGORY_DRAW,
report_class = AncestorTree,
options_class = AncestorTreeOptions,
modes = PluginManager.REPORT_MODE_GUI | \
PluginManager.REPORT_MODE_BKI | \
PluginManager.REPORT_MODE_CLI,
translated_name = _("Ancestor Tree"),
status = _("Stable"),
author_name = "Donald N. Allingham",
author_email = "don@gramps-project.org",
description = _("Produces a graphical ancestral tree"),
)

View File

@@ -44,7 +44,7 @@ from gen.plug.docgen.fontscale import string_trim
from gen.plug.menu import (BooleanOption, StringOption, NumberOption,
EnumeratedListOption, FilterOption, PersonOption)
from gui.utils import ProgressMeter
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_DRAW
from ReportBase import Report, ReportUtils, MenuReportOptions
from Utils import probably_alive
import GrampsLocale
import gen.lib
@@ -528,25 +528,3 @@ class CalendarOptions(MenuReportOptions):
_('Text at bottom, line 3'), 9)
self.make_my_style(default_style, "CAL-Border",
_('Borders'), borders=True)
#------------------------------------------------------------------------
#
# Register the plugins
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'calendar',
category = CATEGORY_DRAW,
report_class = Calendar,
options_class = CalendarOptions,
modes = PluginManager.REPORT_MODE_GUI | \
PluginManager.REPORT_MODE_BKI | \
PluginManager.REPORT_MODE_CLI,
translated_name = _("Calendar"),
status = _("Stable"),
author_name = "Douglas S. Blank",
author_email = "dblank@cs.brynmawr.edu",
description = _("Produces a graphical calendar"),
)

View File

@@ -31,11 +31,10 @@
#------------------------------------------------------------------------
from BasicUtils import name_displayer
from Errors import ReportError
from gen.plug import PluginManager
from gen.plug.docgen import (GraphicsStyle, FontStyle, ParagraphStyle,
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
from gen.plug.menu import TextOption, NumberOption, BooleanOption, PersonOption
from ReportBase import Report, MenuReportOptions, ReportUtils, CATEGORY_DRAW
from ReportBase import Report, MenuReportOptions, ReportUtils
from SubstKeywords import SubstKeywords
from TransUtils import sgettext as _
@@ -524,24 +523,3 @@ class DescendTreeOptions(MenuReportOptions):
g = GraphicsStyle()
default_style.add_draw_style("DC2-line", g)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'descend_chart',
category = CATEGORY_DRAW,
report_class = DescendTree,
options_class = DescendTreeOptions,
modes = PluginManager.REPORT_MODE_GUI | \
PluginManager.REPORT_MODE_BKI | \
PluginManager.REPORT_MODE_CLI,
translated_name = _("Descendant Tree"),
status = _("Stable"),
author_name = "Donald N. Allingham",
author_email = "don@gramps-project.org",
description = _("Produces a graphical descendant tree"),
)

View File

@@ -34,11 +34,10 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
from Errors import ReportError
from gen.plug import PluginManager
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
from gen.plug.menu import EnumeratedListOption, NumberOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_DRAW
from ReportBase import Report, ReportUtils, MenuReportOptions
from SubstKeywords import SubstKeywords
#------------------------------------------------------------------------
@@ -430,24 +429,3 @@ class FanChartOptions(MenuReportOptions):
g.set_fill_color((255,255,255))
g.set_paragraph_style('FC-Normal')
default_style.add_draw_style('background_style_white',g)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'fan_chart',
category = CATEGORY_DRAW,
report_class = FanChart,
options_class = FanChartOptions,
modes = PluginManager.REPORT_MODE_GUI | \
PluginManager.REPORT_MODE_BKI | \
PluginManager.REPORT_MODE_CLI,
translated_name = _("Fan Chart"),
status = _("Stable"),
author_name = "Donald N. Allingham",
author_email = "don@gramps-project.org",
description = _("Produces fan charts")
)

View File

@@ -7,8 +7,9 @@ pkgdatadir = $(datadir)/@PACKAGE@/plugins/drawreport
pkgdata_PYTHON = \
AncestorTree.py \
Calendar.py\
Calendar.py\
DescendTree.py \
drawplugins.gpr.py\
FanChart.py \
StatisticsChart.py \
TimeLine.py

View File

@@ -46,10 +46,9 @@ from gen.lib import Person, FamilyRelType, EventType
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
FONT_SANS_SERIF, FONT_SERIF,
PARA_ALIGN_CENTER, PARA_ALIGN_LEFT)
from gen.plug import PluginManager
from gen.plug.menu import BooleanOption, NumberOption, EnumeratedListOption, \
FilterOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_DRAW
from ReportBase import Report, ReportUtils, MenuReportOptions
import DateHandler
from gui.utils import ProgressMeter
@@ -882,26 +881,3 @@ class StatisticsChartOptions(MenuReportOptions):
g.set_fill_color((255,255,255))
g.set_line_width(0)
default_style.add_draw_style("SC-legend",g)
#------------------------------------------------------------------------
#
# Register report/options
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'statistics_chart',
category = CATEGORY_DRAW,
report_class = StatisticsChart,
options_class = StatisticsChartOptions,
modes = PluginManager.REPORT_MODE_GUI | \
PluginManager.REPORT_MODE_BKI | \
PluginManager.REPORT_MODE_CLI,
translated_name = _("Statistics Charts"),
status = _("Stable"),
author_name = "Eero Tamminen",
author_email = "",
description = _("Produces statistical bar and pie charts of the people "
"in the database"),
require_active = False,
)

View File

@@ -37,9 +37,8 @@ from TransUtils import sgettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from gen.plug import PluginManager
from gen.plug.menu import PersonOption, FilterOption, EnumeratedListOption
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_DRAW
from ReportBase import Report, ReportUtils, MenuReportOptions
pt2cm = ReportUtils.pt2cm
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
FONT_SANS_SERIF, DASHED, PARA_ALIGN_CENTER)
@@ -449,24 +448,3 @@ class TimeLineOptions(MenuReportOptions):
g.set_fill_color((255,255,255))
g.set_line_width(0)
default_style.add_draw_style("TLG-label",g)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'timeline',
category = CATEGORY_DRAW,
report_class = TimeLine,
options_class = TimeLineOptions,
modes = PluginManager.REPORT_MODE_GUI | \
PluginManager.REPORT_MODE_BKI | \
PluginManager.REPORT_MODE_CLI,
translated_name = _("Timeline Chart"),
status = _("Stable"),
author_name = "Donald N. Allingham",
author_email = "don@gramps-project.org",
description = _("Produces a timeline chart.")
)

View File

@@ -0,0 +1,128 @@
#------------------------------------------------------------------------
#
# Ancestor Tree
#
#------------------------------------------------------------------------
plg = newplugin()
plg.id = 'ancestor_chart'
plg.name = _("Ancestor Tree")
plg.description = _("Produces a graphical ancestral tree")
plg.version = '1.0'
plg.status = STABLE
plg.fname = 'AncestorTree.py'
plg.ptype = REPORT
plg.authors = ["Donald N. Allingham"]
plg.authors_email = ["don@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'AncestorTree'
plg.optionclass = 'AncestorTreeOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_BKI, REPORT_MODE_CLI]
#------------------------------------------------------------------------
#
# Calendar
#
#------------------------------------------------------------------------
plg = newplugin()
plg.id = 'calendar'
plg.name = _("Calendar")
plg.description = _("Produces a graphical calendar")
plg.version = '1.0'
plg.status = STABLE
plg.fname = 'Calendar.py'
plg.ptype = REPORT
plg.authors = ["Douglas S. Blank"]
plg.authors_email = ["dblank@cs.brynmawr.edu"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'Calendar'
plg.optionclass = 'CalendarOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_BKI, REPORT_MODE_CLI]
#------------------------------------------------------------------------
#
# Descendant Tree
#
#------------------------------------------------------------------------
plg = newplugin()
plg.id = 'descend_chart'
plg.name = _("Descendant Tree")
plg.description = _("Produces a graphical descendant tree")
plg.version = '1.0'
plg.status = STABLE
plg.fname = 'DescendTree.py'
plg.ptype = REPORT
plg.authors = ["Donald N. Allingham"]
plg.authors_email = ["don@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'DescendTree'
plg.optionclass = 'DescendTreeOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_BKI, REPORT_MODE_CLI]
#------------------------------------------------------------------------
#
# Fan Chart
#
#------------------------------------------------------------------------
plg = newplugin()
plg.id = 'fan_chart'
plg.name = _("Fan Chart")
plg.description = _("Produces fan charts")
plg.version = '1.0'
plg.status = STABLE
plg.fname = 'FanChart.py'
plg.ptype = REPORT
plg.authors = ["Donald N. Allingham"]
plg.authors_email = ["don@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'FanChart'
plg.optionclass = 'FanChartOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_BKI, REPORT_MODE_CLI]
#------------------------------------------------------------------------
#
# Statistics Charts
#
#------------------------------------------------------------------------
plg = newplugin()
plg.id = 'statistics_chart'
plg.name = _("Statistics Charts")
plg.description = _("Produces statistical bar and pie charts of the people "
"in the database")
plg.version = '1.0'
plg.status = STABLE
plg.fname = 'StatisticsChart.py'
plg.ptype = REPORT
plg.authors = ["Eero Tamminen"]
plg.authors_email = [""]
plg.category = CATEGORY_DRAW
plg.reportclass = 'StatisticsChart'
plg.optionclass = 'StatisticsChartOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_BKI, REPORT_MODE_CLI]
plg.require_active = False
#------------------------------------------------------------------------
#
# Timeline Chart
#
#------------------------------------------------------------------------
plg = newplugin()
plg.id = 'timeline'
plg.name = _("Timeline Chart")
plg.description = _("Produces a timeline chart.")
plg.version = '1.0'
plg.status = STABLE
plg.fname = 'TimeLine.py'
plg.ptype = REPORT
plg.authors = ["Donald N. Allingham"]
plg.authors_email = ["don@gramps-project.org"]
plg.category = CATEGORY_DRAW
plg.reportclass = 'TimeLine'
plg.optionclass = 'TimeLineOptions'
plg.report_modes = [REPORT_MODE_GUI, REPORT_MODE_BKI, REPORT_MODE_CLI]