Put all the plugin management and registration stuff into a class. This new class is named PluginManager. It is a Singleton so that everyone gets access to the same plugin information.

svn: r10741
This commit is contained in:
Brian Matherly 2008-05-18 19:24:28 +00:00
parent f0b1808c71
commit 3afbd461c0
116 changed files with 1058 additions and 835 deletions

View File

@ -5,6 +5,7 @@
# Copyright (C) 2007-2008 B. Malengier
# Copyright (C) 2008 Lukasz Rymarczyk
# Copyright (C) 2008 Raphael Ackermann
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -60,7 +61,7 @@ import Utils
import gen.db.exceptions as GX
from DbManager import CLIDbManager, NAME_FILE, find_locker_name
from PluginUtils import Tool, cl_list, cli_tool_list
from PluginUtils import Tool, PluginManager
from ReportBase import CATEGORY_BOOK, CATEGORY_CODE, CATEGORY_WEB, cl_report
IMPORT_TYPES = (const.APP_GRAMPS_XML, const.APP_GEDCOM,
@ -721,6 +722,7 @@ class ArgHandler:
"""
Command-line action routine. Try to perform specified action.
"""
pmgr = PluginManager.get_instance()
if action == 'check':
import Check
checker = Check.CheckIntegrity(self.state.db, None, None)
@ -744,8 +746,9 @@ class ArgHandler:
print "Ignoring invalid options string."
name = options_str_dict.pop('name', None)
_cl_list = pmgr.get_cl_list()
if name:
for item in cl_list:
for item in _cl_list:
if name == item[0]:
category = item[1]
report_class = item[2]
@ -763,7 +766,7 @@ class ArgHandler:
msg = "Report name not given. Please use -p name=reportname."
print "%s\n Available names are:" % msg
for item in cl_list:
for item in _cl_list:
# Print cli report name ([item[0]) and GUI report name (item[4])
if len(item[0]) <= 25:
print " %s%s- %s" % (item[0],
@ -780,8 +783,9 @@ class ArgHandler:
print "Ignoring invalid options string."
name = options_str_dict.pop('name', None)
_cli_tool_list = pmgr.get_cl_tool_list()
if name:
for item in cli_tool_list:
for item in _cli_tool_list:
if name == item[0]:
category = item[1]
tool_class = item[2]
@ -794,7 +798,7 @@ class ArgHandler:
msg = "Tool name not given. Please use -p name=toolname."
print "%s\n Available names are:" % msg
for item in cli_tool_list:
for item in _cli_tool_list:
print " %s" % item[0]
else:
print "Unknown action: %s." % action

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -59,7 +60,7 @@ import Mime
import gen.db
import GrampsDbUtils
import Utils
from PluginUtils import import_list
from PluginUtils import PluginManager
from QuestionDialog import (DBErrorDialog, ErrorDialog, QuestionDialog2,
WarningDialog)
import Errors
@ -106,7 +107,9 @@ class DbLoader:
self.uistate.window)
if not warn_dialog.run():
return False
pmgr = PluginManager.get_instance()
choose_db_dialog = gtk.FileChooserDialog(_('GRAMPS: Import database'),
self.uistate.window,
gtk.FILE_CHOOSER_ACTION_OPEN,
@ -123,7 +126,7 @@ class DbLoader:
format_list = OPEN_FORMATS[:]
# Add more data type selections if opening existing db
for data in import_list:
for data in pmgr.get_import_list():
mime_filter = data[1]
mime_types = data[2]
native_format = data[3]
@ -178,7 +181,7 @@ class DbLoader:
Config.set(Config.RECENT_IMPORT_DIR, the_path)
# Then we try all the known plugins
for (importData, mime_filter, mime_types, native_format,
format_name) in import_list:
format_name) in pmgr.get_import_list():
if filetype in mime_types:
self.do_import(choose_db_dialog, importData, filename)
return True

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ import Config
from BasicUtils import name_displayer
import const
import ManagedWindow
from PluginUtils import _PluginMgr
from PluginUtils import PluginManager
DISABLED = -1
@ -299,7 +300,6 @@ class DisplayState(gen.utils.Callback):
'filters-changed' : (str, ),
'filter-name-changed' : (str, unicode, unicode),
'nameformat-changed' : None,
'plugins-reloaded' : (list, list),
}
def __init__(self, window, status, progress, warnbtn, uimanager,
@ -344,7 +344,8 @@ class DisplayState(gen.utils.Callback):
"""method that rebinds the relationship to the current rel calc
Should be called after load or reload of plugins
"""
self.relationship = _PluginMgr.relationship_class()
pmgr = PluginManager.get_instance()
self.relationship = pmgr.get_relationship_calculator()
def set_gendepth(self, value):
""" Set the generations we search back for showing relationships

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -51,7 +52,7 @@ import gtk
import const
import Config
from PluginUtils import export_list
from PluginUtils import PluginManager
import Utils
import ManagedWindow
@ -509,11 +510,12 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
"""
This method builds its own list of available exports.
The list is built from the PluginMgr.export_list list and from the
locally defined exports (i.e. native export defined here).
The list is built from the list of exporters in the PluginManager and
from the locally defined exports (i.e. native export defined here).
"""
self.exportformats = [item for item in export_list]
pmgr = PluginManager.get_instance()
self.exportformats = [item for item in pmgr.get_export_list()]
def get_intro_text(self):
return _('Under normal circumstances, GRAMPS does not require you '

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -43,7 +44,7 @@ import logging
log = logging.getLogger(".GrampDb")
from gen.db import GrampsDbException
from PluginUtils import import_list
from PluginUtils import PluginManager
def gramps_db_reader_factory(db_type):
"""Factory class for obtaining a Gramps database importer.
@ -65,7 +66,8 @@ def gramps_db_reader_factory(db_type):
else:
#see if registered importer
found = False
for data in import_list:
pmgr = PluginManager.get_instance()
for data in pmgr.get_import_list():
if db_type in data[2]:
print "Found import plugin for %s" % data[4]
found = True

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -1474,5 +1475,6 @@ DESCRIPTION = _('GEDCOM is used to transfer data between genealogy programs. '
CONFIG = (_('GEDCOM export options'), ExportOptions.WriterOptionBox)
FILENAME = 'ged'
from PluginUtils import register_export
register_export(export_data, TITLE, DESCRIPTION, CONFIG, FILENAME)
from PluginUtils import PluginManager
pmgr = PluginManager.get_instance()
pmgr.register_export(export_data, TITLE, DESCRIPTION, CONFIG, FILENAME)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -133,5 +134,6 @@ DESCRIPTION = _('The GRAMPS XML database is a text version of a family tree. '
CONFIG = (_('GRAMPS XML export options'), ExportOptions.WriterOptionBox)
FILENAME = 'gramps'
from PluginUtils import register_export
register_export(export_data, TITLE, DESCRIPTION, CONFIG, FILENAME)
from PluginUtils import PluginManager
pmgr = PluginManager.get_instance()
pmgr.register_export(export_data, TITLE, DESCRIPTION, CONFIG, FILENAME)

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -44,7 +45,7 @@ import gobject
#-------------------------------------------------------------------------
import ManagedWindow
import Errors
import _PluginMgr as PluginMgr
from PluginUtils import PluginManager
import _Tool as Tool
#-------------------------------------------------------------------------
@ -61,6 +62,7 @@ class PluginStatus(ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self, uistate, track,
self.__class__)
self.__pmgr = PluginManager.get_instance()
self.set_window(gtk.Dialog("", uistate.window,
gtk.DIALOG_DESTROY_WITH_PARENT,
(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)),
@ -102,7 +104,9 @@ class PluginStatus(ManagedWindow.ManagedWindow):
def __populate_list(self):
""" Build the list of plugins """
for i in PluginMgr.failmsg_list:
fail_list = self.__pmgr.get_fail_list()
for i in fail_list:
err = i[1][0]
if err == Errors.UnavailableError:
@ -114,9 +118,10 @@ class PluginStatus(ManagedWindow.ManagedWindow):
'<span weight="bold" color="red">%s</span>' % _('Fail'),
i[0], str(i[1][1]), i[1]])
for i in PluginMgr.success_list:
success_list = self.__pmgr.get_success_list()
for i in success_list:
modname = i[1].__name__
descr = PluginMgr.mod2text.get(modname,'')
descr = self.__pmgr.get_module_description(modname)
self.model.append(row=[
'<span weight="bold" color="#267726">%s</span>' % _("OK"),
i[0], descr, None])
@ -135,9 +140,7 @@ class PluginStatus(ManagedWindow.ManagedWindow):
def __reload(self, obj):
""" Callback function from the "Reload" button """
PluginMgr.reload_plugins()
self.__uistate.emit('plugins-reloaded',
(PluginMgr.tool_list, PluginMgr.report_list))
self.__pmgr.reload_plugins()
self.model.clear()
self.__populate_list()

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -51,7 +52,7 @@ from gettext import gettext as _
import const
from ReportBase import report, standalone_categories
import _Tool
import _PluginMgr
from PluginUtils import PluginManager
import ManagedWindow
#-------------------------------------------------------------------------
@ -131,10 +132,9 @@ class PluginDialog(ManagedWindow.ManagedWindow):
self.item = None
self.build_plugin_tree(item_list, categories)
uistate.connect('plugins-reloaded', self.rebuild)
self.show()
def rebuild(self, tool_list, report_list):
def rebuild(self):
# This method needs to be overridden in the subclass
assert False, "This method needs to be overridden in the subclass."
@ -254,20 +254,24 @@ class ReportPlugins(PluginDialog):
"""Display the dialog box, and build up the list of available
reports. This is used to build the selection tree on the left
hand side of the dailog box."""
self.__pmgr = PluginManager.get_instance()
PluginDialog.__init__(
self,
dbstate,
uistate,
track,
_PluginMgr.report_list,
self.__pmgr.get_report_list(),
standalone_categories,
_("Report Selection"),
_("Select a report from those available on the left."),
_("_Generate"), _("Generate selected report"),
REPORTS)
self.__pmgr.connect('plugins-reloaded', self.rebuild)
def rebuild(self, tool_list, report_list):
def rebuild(self):
report_list = self.__pmgr.get_report_list()
self.build_plugin_tree(report_list, standalone_categories)
#-------------------------------------------------------------------------
@ -279,20 +283,18 @@ class ToolPlugins(PluginDialog):
"""Displays the dialog box that allows the user to select the tool
that is desired."""
__signals__ = {
'plugins-reloaded' : (list,list),
}
def __init__(self, dbstate, uistate, track):
"""Display the dialog box, and build up the list of available
reports. This is used to build the selection tree on the left
hand side of the dailog box."""
self.__pmgr = PluginManager.get_instance()
PluginDialog.__init__(
self,
dbstate,
uistate,
track,
_PluginMgr.tool_list,
self.__pmgr.get_tool_list(),
_Tool.tool_categories,
_("Tool Selection"),
_("Select a tool from those available on the left."),
@ -300,5 +302,6 @@ class ToolPlugins(PluginDialog):
_("Run selected tool"),
TOOLS)
def rebuild(self, tool_list, report_list):
def rebuild(self):
tool_list = self.__pmgr.get_tool_list()
self.build_plugin_tree(tool_list, _Tool.tool_categories)

View File

@ -18,33 +18,18 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
#The following is bad, we import lists here, and obtain pointers to them
#If in _PluginMgr the list changes, that is ok, if however the list is
#assigned to another pointer eg export_list = then in this module we
#still retain the old pointer! ==> all actions may not change the pointer
#Better would be to do: import _PluginMgr as PluginMgr and then access
# the list as PluginUtils.PluginMgr, or use a function that returns the pointer
# of the list.
#
from _MenuOptions import (NumberOption, BooleanOption, TextOption,
EnumeratedListOption, FilterOption, StringOption,
ColourOption, PersonOption, PersonListOption,
SurnameColourOption, FamilyOption, DestinationOption,
NoteOption, MediaOption, StyleOption)
from _GuiOptions import GuiMenuOptions, make_gui_option
from _PluginMgr import (register_export, register_import, register_tool,
register_report, register_relcalc, relationship_class,
textdoc_list, drawdoc_list, bookdoc_list,
bkitems_list, cl_list, cli_tool_list, load_plugins,
import_list, export_list, report_list,
quick_report_list, tool_list, register_text_doc,
register_draw_doc, register_book_doc,
register_quick_report)
from _Options import Options, OptionListCollection, OptionList, OptionHandler
from _PluginMgr import PluginManager
import _Tool as Tool
import _Plugins as Plugins
import _PluginWindows as PluginWindows

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 B. Malengier
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -53,15 +54,13 @@ import gtk
#
#-------------------------------------------------------------------------
#from PluginUtils import Plugins
from PluginUtils import PluginManager
from ReportBase import (CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY,
CATEGORY_QR_EVENT, CATEGORY_QR_SOURCE, CATEGORY_QR_MISC,
CATEGORY_QR_PLACE, CATEGORY_QR_REPOSITORY)
def create_quickreport_menu(category,dbstate,uistate, handle) :
#import present version of the
from PluginUtils import quick_report_list
""" This functions querries the registered quick reports with
quick_report_list of _PluginMgr.py
It collects the reports of the requested category, which must be one of
@ -86,7 +85,8 @@ def create_quickreport_menu(category,dbstate,uistate, handle) :
#select the reports to show
showlst = []
for item in quick_report_list:
pmgr = PluginManager.get_instance()
for item in pmgr.get_quick_report_list():
if not item[8] and item[2] == category :
#add tuple function, translated name, name, status
showlst.append((item[0], item[1], item[3], item[5]))
@ -109,14 +109,14 @@ def make_quick_report_callback(lst, category, dbstate, uistate, handle):
return lambda x: run_report(dbstate, uistate, category, handle, lst[0])
def run_quick_report_by_name(dbstate, uistate, report_name, handle, **kwargs):
from PluginUtils import quick_report_list
# [0] - function
# [1] - translated name
# [2] - category
# [3] - name
# [5] - status
report = None
for item in quick_report_list:
pmgr = PluginManager.get_instance()
for item in pmgr.get_quick_report_list():
if item[3] == report_name:
report = item
break
@ -129,11 +129,11 @@ def run_quick_report_by_name_direct(report_name, database, document, handle):
"""
Useful for running one quick report from another
"""
from PluginUtils import quick_report_list
from docgen import TextBufDoc
from Simple import make_basic_stylesheet
report = None
for item in quick_report_list:
pmgr = PluginManager.get_instance()
for item in pmgr.get_quick_report_list():
if item[3] == report_name:
report = item
break

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -43,6 +44,12 @@ import PluginUtils
#-------------------------------------------------------------------------
class BookFormatComboBox(gtk.ComboBox):
def __init__(self):
pmgr = PluginUtils.PluginManager.get_instance()
self.__book_doc_list = pmgr.get_book_doc_list()
self.__book_doc_list.sort()
gtk.ComboBox.__init__(self)
def set(self,tables,callback, obj=None,active=None):
self.store = gtk.ListStore(gobject.TYPE_STRING)
self.set_model(self.store)
@ -52,10 +59,9 @@ class BookFormatComboBox(gtk.ComboBox):
out_pref = Config.get(Config.OUTPUT_PREFERENCE)
index = 0
PluginUtils.drawdoc_list.sort()
active_index = 0
self.data = []
for item in PluginUtils.bookdoc_list:
for item in self.__book_doc_list:
if tables and item[2] == 0:
continue
self.data.append(item)

View File

@ -4,6 +4,7 @@
# Copyright (C) 2001-2007 Donald N. Allingham
# Copyright (C) 2008 Lukasz Rymarczyk
# Copyright (C) 2008 Raphael Ackermann
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -124,6 +125,11 @@ class CommandLineReport:
"""
Initialize the options that are hard-coded into the report system.
"""
pmgr = PluginUtils.PluginManager.get_instance()
_textdoc_list = pmgr.get_text_doc_list()
_drawdoc_list = pmgr.get_draw_doc_list()
_bookdoc_list = pmgr.get_book_doc_list()
self.options_dict = {
'of' : self.option_class.handler.module_name,
'off' : self.option_class.handler.get_format_name(),
@ -151,34 +157,34 @@ class CommandLineReport:
"whatever_name"))
if self.category == CATEGORY_TEXT:
for item in PluginUtils.textdoc_list:
for item in _textdoc_list:
if item[7] == self.options_dict['off']:
self.format = item[1]
if self.format is None:
# Pick the first one as the default.
self.format = PluginUtils.textdoc_list[0][1]
self.format = _textdoc_list[0][1]
self.options_help['off'][2] = \
[ item[7] for item in PluginUtils.textdoc_list ]
[ item[7] for item in _textdoc_list ]
self.options_help['off'][3] = False
elif self.category == CATEGORY_DRAW:
for item in PluginUtils.drawdoc_list:
for item in _drawdoc_list:
if item[6] == self.options_dict['off']:
self.format = item[1]
if self.format is None:
# Pick the first one as the default.
self.format = PluginUtils.drawdoc_list[0][1]
self.format = _drawdoc_list[0][1]
self.options_help['off'][2] = \
[ item[6] for item in PluginUtils.drawdoc_list ]
[ item[6] for item in _drawdoc_list ]
self.options_help['off'][3] = False
elif self.category == CATEGORY_BOOK:
for item in PluginUtils.bookdoc_list:
for item in _bookdoc_list:
if item[6] == self.options_dict['off']:
self.format = item[1]
if self.format is None:
# Pick the first one as the default.
self.format = PluginUtils.bookdoc_list[0][1]
self.format = _bookdoc_list[0][1]
self.options_help['off'][2] = \
[ item[6] for item in PluginUtils.bookdoc_list ]
[ item[6] for item in _bookdoc_list ]
self.options_help['off'][3] = False
else:
self.format = None

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -32,6 +33,12 @@ import PluginUtils
#-------------------------------------------------------------------------
class DrawFormatComboBox(gtk.ComboBox):
def __init__(self):
pmgr = PluginUtils.PluginManager.get_instance()
self.__draw_doc_list = pmgr.get_draw_doc_list()
self.__draw_doc_list.sort()
gtk.ComboBox.__init__(self)
def set(self,tables,callback, obj=None,active=None):
self.store = gtk.ListStore(gobject.TYPE_STRING)
self.set_model(self.store)
@ -41,9 +48,8 @@ class DrawFormatComboBox(gtk.ComboBox):
out_pref = Config.get(Config.OUTPUT_PREFERENCE)
index = 0
PluginUtils.drawdoc_list.sort()
active_index = 0
for item in PluginUtils.drawdoc_list:
for item in self.__drawdoc_list:
if tables and item[2] == 0:
continue
name = item[0]
@ -58,22 +64,22 @@ class DrawFormatComboBox(gtk.ComboBox):
self.set_active(active_index)
def get_reference(self):
return PluginUtils.drawdoc_list[self.get_active()][1]
return self.__drawdoc_list[self.get_active()][1]
def get_label(self):
return PluginUtils.drawdoc_list[self.get_active()][0]
return self.__drawdoc_list[self.get_active()][0]
def get_paper(self):
return PluginUtils.drawdoc_list[self.get_active()][2]
return self.__drawdoc_list[self.get_active()][2]
def get_styles(self):
return PluginUtils.drawdoc_list[self.get_active()][3]
return self.__drawdoc_list[self.get_active()][3]
def get_ext(self):
return PluginUtils.drawdoc_list[self.get_active()][4]
return self.__drawdoc_list[self.get_active()][4]
def get_printable(self):
return PluginUtils.drawdoc_list[self.get_active()][5]
return self.__drawdoc_list[self.get_active()][5]
def get_clname(self):
return PluginUtils.drawdoc_list[self.get_active()][6]
return self.__drawdoc_list[self.get_active()][6]

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -32,6 +33,12 @@ import PluginUtils
#-------------------------------------------------------------------------
class TextFormatComboBox(gtk.ComboBox):
def __init__(self):
pmgr = PluginUtils.PluginManager.get_instance()
self.__text_doc_list = pmgr.get_text_doc_list()
self.__text_doc_list.sort()
gtk.ComboBox.__init__(self)
def set(self,tables,callback, obj=None,active=None):
self.store = gtk.ListStore(gobject.TYPE_STRING)
self.set_model(self.store)
@ -41,9 +48,8 @@ class TextFormatComboBox(gtk.ComboBox):
out_pref = Config.get(Config.OUTPUT_PREFERENCE)
index = 0
PluginUtils.textdoc_list.sort()
active_index = 0
for item in PluginUtils.textdoc_list:
for item in self.__text_doc_list:
if tables and item[2] == 0:
continue
name = item[0]
@ -56,22 +62,22 @@ class TextFormatComboBox(gtk.ComboBox):
self.set_active(active_index)
def get_label(self):
return PluginUtils.textdoc_list[self.get_active()][0]
return self.__text_doc_list[self.get_active()][0]
def get_reference(self):
return PluginUtils.textdoc_list[self.get_active()][1]
return self.__text_doc_list[self.get_active()][1]
def get_paper(self):
return PluginUtils.textdoc_list[self.get_active()][3]
return self.__text_doc_list[self.get_active()][3]
def get_styles(self):
return PluginUtils.textdoc_list[self.get_active()][4]
return self.__text_doc_list[self.get_active()][4]
def get_ext(self):
return PluginUtils.textdoc_list[self.get_active()][5]
return self.__text_doc_list[self.get_active()][5]
def get_printable(self):
return PluginUtils.textdoc_list[self.get_active()][6]
return self.__text_doc_list[self.get_active()][6]
def get_clname(self):
return PluginUtils.textdoc_list[self.get_active()][7]
return self.__text_doc_list[self.get_active()][7]

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -54,9 +55,7 @@ import gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
from PluginUtils import Plugins, Tool, PluginWindows, \
relationship_class, load_plugins, \
tool_list, report_list
from PluginUtils import Plugins, Tool, PluginWindows, PluginManager
import ReportBase
import DisplayState
@ -223,6 +222,8 @@ class ViewManager:
self.show_sidebar = Config.get(Config.VIEW)
self.show_toolbar = Config.get(Config.TOOLBAR_ON)
self.show_filter = Config.get(Config.FILTER)
self.__pmgr = PluginManager.get_instance()
self.__build_main_window()
self.__connect_signals()
@ -239,7 +240,7 @@ class ViewManager:
self.window.set_icon_from_file(const.ICON)
self.window.set_default_size(width, height)
self.rel_class = relationship_class
self.rel_class = self.__pmgr.get_relationship_calculator()
vbox = gtk.VBox()
self.window.add(vbox)
@ -538,10 +539,10 @@ class ViewManager:
self.actiongroup.set_visible(False)
self.readonlygroup.set_visible(False)
self.fileactions.set_sensitive(False)
self.__build_tools_menu(tool_list)
self.__build_report_menu(report_list)
self.__build_tools_menu(self.__pmgr.get_tool_list())
self.__build_report_menu(self.__pmgr.get_report_list())
self.uistate.set_relationship_class()
self.uistate.connect('plugins-reloaded',
self.__pmgr.connect('plugins-reloaded',
self.__rebuild_report_and_tool_menus)
self.fileactions.set_sensitive(True)
self.uistate.widget.set_sensitive(True)
@ -589,16 +590,15 @@ class ViewManager:
generators and the plugins. The plugin status window is opened
on an error if the user has requested.
"""
# load document generators
self.uistate.status_text(_('Loading document formats...'))
error = load_plugins(const.DOCGEN_DIR)
error |= load_plugins(const.USER_DOCGEN)
error = self.__pmgr.load_plugins(const.DOCGEN_DIR)
error |= self.__pmgr.load_plugins(const.USER_DOCGEN)
# load plugins
self.uistate.status_text(_('Loading plugins...'))
error |= load_plugins(const.PLUGINS_DIR)
error |= load_plugins(const.USER_PLUGINS)
error |= self.__pmgr.load_plugins(const.PLUGINS_DIR)
error |= self.__pmgr.load_plugins(const.USER_PLUGINS)
# get to ssee if we need to open the plugin status window
if error and Config.get(Config.POP_PLUGIN_STATUS):
@ -1311,10 +1311,12 @@ class ViewManager:
except Errors.WindowActiveError:
return
def __rebuild_report_and_tool_menus(self, tool_menu_list, report_menu_list):
def __rebuild_report_and_tool_menus(self):
"""
Callback that rebuilds the tools and reports menu
"""
tool_menu_list = self.__pmgr.get_tool_list()
report_menu_list = self.__pmgr.get_report_list()
self.__build_tools_menu(tool_menu_list)
self.__build_report_menu(report_menu_list)
self.uistate.set_relationship_class()

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,7 +34,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import BaseDoc
from PluginUtils import register_text_doc
from PluginUtils import PluginManager
import Errors
import Mime
import Utils
@ -374,6 +374,7 @@ class AsciiDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc):
#
#------------------------------------------------------------------------
print_label = None
pmgr = PluginManager.get_instance()
try:
mprog = Mime.get_application("text/plain")
mtype = Mime.get_description('text/plain')
@ -383,7 +384,7 @@ try:
else:
print_label=None
register_text_doc(mtype,AsciiDoc,1,1,1,".txt", print_label)
pmgr.register_text_doc(mtype, AsciiDoc, 1, 1, 1, ".txt", print_label)
except:
register_text_doc(_("Plain Text"),AsciiDoc,1,1,1,".txt", None)
pmgr.register_text_doc(_("Plain Text"), AsciiDoc, 1, 1, 1, ".txt", None)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 Zsolt Foldvari
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -43,7 +44,7 @@ import os
#------------------------------------------------------------------------
import BaseDoc
from CairoDoc import CairoDoc
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
from PluginUtils import PluginManager
import Errors
#------------------------------------------------------------------------
@ -618,6 +619,7 @@ class GtkPrint(CairoDoc):
# Register the document generator with the GRAMPS plugin system
#
#------------------------------------------------------------------------
register_text_doc(_('Print...'), GtkPrint, 1, 1, 1, "", None)
register_draw_doc(_('Print...'), GtkPrint, 1, 1, "", None)
register_book_doc(_('Print...'), GtkPrint, 1, 1, 1, "", None)
pmgr = PluginManager.get_instance()
pmgr.register_text_doc(_('Print...'), GtkPrint, 1, 1, 1, "", None)
pmgr.register_draw_doc(_('Print...'), GtkPrint, 1, 1, "", None)
pmgr.register_book_doc(_('Print...'), GtkPrint, 1, 1, 1, "", None)

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -36,7 +36,7 @@ from gettext import gettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_text_doc
from PluginUtils import PluginManager
import ImgManip
import tarfile
import const
@ -481,6 +481,7 @@ class HtmlDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc):
#
#------------------------------------------------------------------------
print_label = None
pmgr = PluginManager.get_instance()
try:
prog = Mime.get_application("text/html")
mtype = Mime.get_description("text/html")
@ -493,6 +494,6 @@ try:
if mtype == _("unknown"):
mtype = _('HTML')
register_text_doc(mtype,HtmlDoc,1,0,1,".html", print_label)
pmgr.register_text_doc(mtype, HtmlDoc, 1, 0, 1, ".html", print_label)
except:
register_text_doc(_('HTML'),HtmlDoc,1,0,1,".html", None)
pmgr.register_text_doc(_('HTML'), HtmlDoc, 1, 0, 1, ".html", None)

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Raphael Ackermann
#
# Modifications and feature additions:
@ -43,7 +43,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import BaseDoc
from PluginUtils import register_text_doc
from PluginUtils import PluginManager
import ImgManip
import Errors
import Mime
@ -522,6 +522,7 @@ class LaTeXDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc):
#
#------------------------------------------------------------------------
print_label = None
pmgr = PluginManager.get_instance()
try:
mprog = Mime.get_application(_apptype)
@ -533,4 +534,4 @@ try:
except:
print_label = None
register_text_doc(_('LaTex'), LaTeXDoc, 1, 1, 0, ".tex", print_label)
pmgr.register_text_doc(_('LaTex'), LaTeXDoc, 1, 1, 0, ".tex", print_label)

View File

@ -3,7 +3,7 @@
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2005-2006 Serge Noiraud
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -43,7 +43,7 @@ from xml.sax.saxutils import escape
#-------------------------------------------------------------------------
import BaseDoc
import const
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
from PluginUtils import PluginManager
from ReportBase import ReportUtils
import ImgManip
import FontScale
@ -1145,6 +1145,7 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
#
#--------------------------------------------------------------------------
print_label = None
pmgr = PluginManager.get_instance()
try:
mprog = Mime.get_application(_apptype)
@ -1156,6 +1157,9 @@ try:
except:
print_label = None
register_text_doc(_('Open Document Text'), ODFDoc, 1, 1, 1, ".odt", print_label)
register_book_doc(_("Open Document Text"), ODFDoc, 1, 1, 1, ".odt", print_label)
register_draw_doc(_("Open Document Text"), ODFDoc, 1, 1, ".odt", print_label);
pmgr.register_text_doc(_('Open Document Text'),
ODFDoc, 1, 1, 1, ".odt", print_label)
pmgr.register_book_doc(_("Open Document Text"),
ODFDoc, 1, 1, 1, ".odt", print_label)
pmgr.register_draw_doc(_("Open Document Text"),
ODFDoc, 1, 1, ".odt", print_label);

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -32,7 +32,7 @@ from gettext import gettext as _
#Gramps modules
#-------------------------------------------------------------------------
from ReportBase import ReportUtils, run_print_dialog, get_print_dialog_app
from PluginUtils import register_draw_doc
from PluginUtils import PluginManager
import BaseDoc
import Errors
@ -367,4 +367,5 @@ class PSDrawDoc(BaseDoc.BaseDoc,BaseDoc.DrawDoc):
self.f.write("(%s) show\n" % lines[i])
self.f.write('grestore\n')
register_draw_doc(_("PostScript"),PSDrawDoc,1,1,".ps", print_label);
pmgr = PluginManager.get_instance()
pmgr.register_draw_doc(_("PostScript"), PSDrawDoc, 1, 1, ".ps", print_label);

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
from CairoDoc import CairoDoc
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
from PluginUtils import PluginManager
import Utils
import Mime
@ -149,8 +149,9 @@ def register_docgen():
mtype = _('PDF document')
print_label = None
register_text_doc(mtype, PdfDoc, 1, 1, 1, ".pdf", print_label)
register_draw_doc(mtype, PdfDoc, 1, 1, ".pdf", print_label)
register_book_doc(mtype, PdfDoc, 1, 1, 1, ".pdf", print_label)
pmgr = PluginManager.get_instance()
pmgr.register_text_doc(mtype, PdfDoc, 1, 1, 1, ".pdf", print_label)
pmgr.register_draw_doc(mtype, PdfDoc, 1, 1, ".pdf", print_label)
pmgr.register_book_doc(mtype, PdfDoc, 1, 1, 1, ".pdf", print_label)
register_docgen()

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,7 +34,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import BaseDoc
from PluginUtils import register_text_doc
from PluginUtils import PluginManager
import ImgManip
import Errors
import Mime
@ -440,6 +440,7 @@ class RTFDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc):
# Register the document generator with the GRAMPS plugin system
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
try:
mprog = Mime.get_application(mime_type)
mtype = Mime.get_description(mime_type)
@ -448,6 +449,6 @@ try:
print_label=_("Open in %s") % mprog[1]
else:
print_label=None
register_text_doc(mtype, RTFDoc, 1, 1, 1, ".rtf", print_label)
pmgr.register_text_doc(mtype, RTFDoc, 1, 1, 1, ".rtf", print_label)
except:
register_text_doc(_('RTF document'), RTFDoc, 1, 1, 1, ".rtf", None)
pmgr.register_text_doc(_('RTF document'), RTFDoc, 1, 1, 1, ".rtf", None)

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,7 +34,7 @@ import StringIO
# Gramps modules
#
#-------------------------------------------------------------------------
from PluginUtils import register_draw_doc
from PluginUtils import PluginManager
import BaseDoc
import Errors
@ -262,4 +262,6 @@ def units(val):
# Register document generator
#
#-------------------------------------------------------------------------
register_draw_doc(_("SVG (Scalable Vector Graphics)"),SvgDrawDoc,1,1,".svg");
pmgr = PluginManager.get_instance()
pmgr.register_draw_doc(_("SVG (Scalable Vector Graphics)"),
SvgDrawDoc, 1, 1, ".svg");

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -36,7 +36,6 @@ import pango
#
#------------------------------------------------------------------------
import BaseDoc
from PluginUtils import register_text_doc
import ManagedWindow
try:

View File

@ -25,7 +25,7 @@ Display references for any object
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
from ReportBase import CATEGORY_QR_DATE
import DateHandler
import gen.lib
@ -94,7 +94,8 @@ def get_event_date_from_ref(database, ref):
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'ageondate',
category = CATEGORY_QR_DATE,
run_func = run,

View File

@ -36,7 +36,7 @@ from gettext import gettext as _
# gramps modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, NumberOption, \
from PluginUtils import PluginManager, NumberOption, \
BooleanOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
@ -334,7 +334,8 @@ class AncestorOptions(MenuReportOptions):
# Register the plugin
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'ancestor_report',
category = CATEGORY_TEXT,
report_class = AncestorReport,

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@ from gettext import gettext as _
#------------------------------------------------------------------------
import BaseDoc
from SubstKeywords import SubstKeywords
from PluginUtils import register_report, \
from PluginUtils import PluginManager, \
NumberOption, BooleanOption, TextOption, PersonOption
from ReportBase import Report, ReportUtils, CATEGORY_DRAW, MenuReportOptions, \
MODE_GUI, MODE_BKI, MODE_CLI
@ -525,7 +525,8 @@ class AncestorTreeOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'ancestor_chart',
category = CATEGORY_DRAW,
report_class = AncestorTree,

View File

@ -72,7 +72,7 @@ import ListModel
import Errors
import BaseDoc
from QuestionDialog import WarningDialog, ErrorDialog
from PluginUtils import bkitems_list, register_report, Plugins
from PluginUtils import PluginManager, Plugins
from PluginUtils import PersonOption, FilterOption, FamilyOption
import ManagedWindow
@ -189,7 +189,9 @@ class BookItem:
"""
self.dbase = dbase
self.style_name = "default"
for item in bkitems_list:
pmgr = PluginManager.get_instance()
for item in pmgr.get_book_item_list():
if item[4] == name:
self.translated_name = item[0]
if item[5]:
@ -740,11 +742,11 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
The selections are read from the book item registry.
"""
if not bkitems_list:
pmgr = PluginManager.get_instance()
if not pmgr.get_book_item_list():
return
for book_item in bkitems_list:
for book_item in pmgr.get_book_item_list():
if book_item[5]:
category = Plugins.UNSUPPORTED
else:
@ -1234,7 +1236,8 @@ def write_book_item(database, report_class, options_class):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'book',
category = CATEGORY_BOOK,
report_class = BookReportSelector,

View File

@ -36,7 +36,7 @@ import time
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import Tool, register_tool, PluginWindows, \
from PluginUtils import Tool, PluginManager, PluginWindows, \
MenuToolOptions, BooleanOption, FilterOption, StringOption, \
NumberOption, PersonOption
import gen.lib
@ -482,7 +482,8 @@ class CalcToolManagedWindow(PluginWindows.ToolManagedWindowBatch):
# Register the tool
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'calculateestimateddates',
category = Tool.TOOL_DBPROC,
tool_class = CalcToolManagedWindow,

View File

@ -37,7 +37,7 @@ import os
#------------------------------------------------------------------------
import BaseDoc
from BasicUtils import name_displayer
from PluginUtils import register_report, relationship_class
from PluginUtils import PluginManager
from ReportBase import (Report, ReportUtils, MenuReportOptions,
CATEGORY_DRAW, CATEGORY_TEXT,
MODE_GUI, MODE_BKI, MODE_CLI)
@ -314,7 +314,9 @@ class Calendar(Report):
self.progress.set_pass(_('Filtering data...'), 0)
people = self.filter.apply(self.database,
self.database.get_person_handles(sort_handles=False))
rel_calc = relationship_class()
pmgr = PluginManager.get_instance()
rel_calc = pmgr.get_relationship_calculator()
self.progress.set_pass(_('Filtering data...'), len(people))
for person_handle in people:
self.progress.step()
@ -916,7 +918,8 @@ _countries = get_countries()
# Register the plugins
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'calendar',
category = CATEGORY_DRAW,
report_class = Calendar,
@ -929,7 +932,7 @@ register_report(
description = _("Produces a graphical calendar"),
)
register_report(
pmgr.register_report(
name = 'birthday_report',
category = CATEGORY_TEXT,
report_class = CalendarReport,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -48,7 +49,7 @@ import GrampsDisplay
import ManagedWindow
from QuestionDialog import OkDialog
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from TransUtils import sgettext as _
#-------------------------------------------------------------------------
#
@ -279,7 +280,8 @@ class ChangeNamesOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'chname',
category = Tool.TOOL_DBPROC,
tool_class = ChangeNames,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -48,7 +49,7 @@ import ManagedWindow
import AutoComp
from gen.lib import EventType
from QuestionDialog import OkDialog
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
#-------------------------------------------------------------------------
#
@ -195,7 +196,8 @@ class ChangeTypesOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'chtype',
category = Tool.TOOL_DBPROC,
tool_class = ChangeTypes,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -59,7 +60,7 @@ import Utils
#import const
import ManagedWindow
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from QuestionDialog import OkDialog, MissingMediaDialog
from BasicUtils import name_displayer as _nd
@ -1507,7 +1508,8 @@ class CheckOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'check',
category = Tool.TOOL_DBFIX,
tool_class = Check,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -37,7 +38,7 @@ from gettext import gettext as _
# GRAMPS modules
#
#-------------------------------------------------------------------------
from PluginUtils import Tool, cl_list, cli_tool_list, register_tool
from PluginUtils import Tool, PluginManager
from ReportBase import CATEGORY_BOOK, CATEGORY_WEB
from ReportBase._CommandLineReport import CommandLineReport
@ -55,7 +56,7 @@ _tags = [
#-------------------------------------------------------------------------
#
#
# CmdRef
#
#-------------------------------------------------------------------------
class CmdRef(Tool.Tool):
@ -94,12 +95,14 @@ class CmdRef(Tool.Tool):
f.write(' <title>Reports</title>\n')
# Common report options
item = cl_list[0]
pmgr = PluginManager.get_instance()
_cl_list = pmgr.get_cl_list()
item = _cl_list[0]
clr = CommandLineReport(self.__db, item[0], item[1], item[3], {}, True)
self.write_ref(f,clr,level+2,id_counter,True)
id_counter = id_counter + 1
for item in cl_list:
for item in _cl_list:
unsupported = item[5]
if unsupported is True:
continue
@ -116,13 +119,14 @@ class CmdRef(Tool.Tool):
f.write(' <title>Tools</title>\n')
# Common tool options
item = cli_tool_list[0]
_cl_tool_list = pmgr.get_cl_tool_list()
item = _cl_tool_list[0]
clr = Tool.CommandLineTool(self.__db, item[0],
item[1], item[3], {}, True)
self.write_ref(f,clr,level+2,id_counter,True)
id_counter = id_counter + 1
for item in cli_tool_list:
for item in _cl_tool_list:
self.write_ref(f,item,level+2,id_counter)
id_counter = id_counter + 1
f.write(' </%s>\n' % _tags[level+1] )
@ -202,7 +206,7 @@ class CmdRef(Tool.Tool):
#------------------------------------------------------------------------
#
#
# CmdRefOptions
#
#------------------------------------------------------------------------
class CmdRefOptions(Tool.ToolOptions):
@ -231,10 +235,10 @@ class CmdRefOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
if __debug__:
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'cmdref',
category = Tool.TOOL_DEBUG,
tool_class = CmdRef,

View File

@ -1,6 +1,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -40,7 +41,7 @@ from gettext import gettext as _
# gramps modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, TextOption
from PluginUtils import PluginManager, TextOption
from ReportBase import Report, MenuReportOptions, CATEGORY_TEXT, MODE_BKI
import BaseDoc
@ -158,7 +159,8 @@ class CustomTextOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'custom_text',
category = CATEGORY_TEXT,
report_class = CustomText,

View File

@ -3,6 +3,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,6 +35,7 @@ Tools/Debug/Check Localized Date Parser and Displayer
#-------------------------------------------------------------------------
import traceback
import sys
from gettext import gettext as _
#-------------------------------------------------------------------------
#
@ -41,7 +43,7 @@ import sys
#
#-------------------------------------------------------------------------
import gen.lib
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
import Utils
from QuestionDialog import QuestionDialog
from DateHandler import parser as _dp
@ -226,7 +228,8 @@ class DateParserDisplayTest(Tool.Tool):
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'test_for_date_parser_and_displayer',
category = Tool.TOOL_DEBUG,
tool_class = DateParserDisplayTest,
@ -236,9 +239,9 @@ register_tool(
status = _("Beta"),
author_name = "Martin Hawlisch",
author_email = "martin@hawlisch.de",
description = _("This test tool will create many people showing all different"
" date variants as birth. The death date is created by"
" parsing the result of the date displayer for the birth"
" date. This way you can ensure that dates printed can"
" be parsed back in correctly.")
description = _("This test tool will create many people showing all"
" different date variants as birth. The death date is"
" created by parsing the result of the date displayer for"
" the birth date. This way you can ensure that dates"
" printed can be parsed back in correctly.")
)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -43,7 +44,7 @@ from gtk import glade
#
#------------------------------------------------------------------------
from BasicUtils import name_displayer
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
import GrampsDisplay
import ManagedWindow
from TransUtils import sgettext as _
@ -157,7 +158,8 @@ class DesBrowseOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'dbrowse',
category = Tool.TOOL_ANAL,
tool_class = DesBrowse,

View File

@ -35,7 +35,7 @@ from gettext import gettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, NumberOption, PersonOption
from PluginUtils import PluginManager, NumberOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc
@ -245,7 +245,8 @@ class DescendantOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'descend_report',
category = CATEGORY_TEXT,
report_class = DescendantReport,

View File

@ -29,7 +29,7 @@
#
#------------------------------------------------------------------------
from BasicUtils import name_displayer
from PluginUtils import register_report, NumberOption, BooleanOption, \
from PluginUtils import PluginManager, NumberOption, BooleanOption, \
TextOption, PersonOption
from ReportBase import Report, MenuReportOptions, \
ReportUtils, CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
@ -479,7 +479,8 @@ class DescendTreeOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'descend_chart',
category = CATEGORY_DRAW,
report_class = DescendTree,

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import gen.lib
from PluginUtils import register_report, NumberOption, \
from PluginUtils import PluginManager, NumberOption, \
BooleanOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
@ -856,7 +856,8 @@ class DetAncestorOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'det_ancestor_report',
category = CATEGORY_TEXT,
report_class = DetAncestorReport,

View File

@ -38,7 +38,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import gen.lib
from PluginUtils import register_report, NumberOption, \
from PluginUtils import PluginManager, NumberOption, \
BooleanOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
@ -821,7 +821,8 @@ class DetDescendantOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'det_descendant_report',
category = CATEGORY_TEXT,
report_class = DetDescendantReport,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -24,12 +25,12 @@
Tools/Debug/Dump Gender Statistics
"""
from gettext import gettext as _
import gtk
import ListModel
import ManagedWindow
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
#-------------------------------------------------------------------------
@ -108,7 +109,8 @@ class DumpGenderStatsOptions(Tool.ToolOptions):
if __debug__:
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'dgenstats',
category = Tool.TOOL_DEBUG,
tool_class = DumpGenderStats,

View File

@ -34,7 +34,7 @@ from gettext import gettext as _
# gramps modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, PersonOption
from PluginUtils import PluginManager, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc
@ -307,7 +307,8 @@ class EndOfLineOptions(MenuReportOptions):
# Register the plugin
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'endofline_report',
category = CATEGORY_TEXT,
report_class = EndOfLineReport,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -45,7 +46,7 @@ from gtk import glade
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
import ManagedWindow
#-------------------------------------------------------------------------
@ -119,7 +120,8 @@ class EvalOptions(Tool.ToolOptions):
#------------------------------------------------------------------------
if __debug__:
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'eval',
category = Tool.TOOL_DEBUG,
tool_class = Eval,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -51,7 +52,7 @@ import const
import Errors
import DateHandler
from QuestionDialog import WarningDialog
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from ReportBase import ReportUtils
import GrampsDisplay
import ManagedWindow
@ -455,7 +456,8 @@ class EventComparisonOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'eventcmp',
category = Tool.TOOL_ANAL,
tool_class = EventComparison,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -44,7 +45,7 @@ import ManagedWindow
import gen.lib
import Utils
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from BasicUtils import name_displayer
#-------------------------------------------------------------------------
@ -151,7 +152,8 @@ class EventNamesOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'evname',
category = Tool.TOOL_DBPROC,
tool_class = EventNames,

View File

@ -1,8 +1,9 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Douglas S. Blank
# Copyright (C) 2007-2008 Douglas S. Blank
# Copyright (C) 2004-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ from Filters import GenericFilter, Rules, build_filter_menu
import Utils
import Errors
from QuestionDialog import ErrorDialog
from PluginUtils import register_export
from PluginUtils import PluginManager
import DateHandler
#-------------------------------------------------------------------------
@ -504,4 +505,5 @@ _description = _('CSV is a common spreadsheet format.')
_config = (_('CSV spreadsheet options'),CSVWriterOptionBox)
_filename = 'csv'
register_export(exportData,_title,_description,_config,_filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(exportData,_title,_description,_config,_filename)

View File

@ -3,6 +3,7 @@
#
# Copyright (C) 2004 Martin Hawlisch
# Copyright (C) 2005-2006, 2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ import Utils
from gen.lib import Date, EventType
import Errors
from QuestionDialog import ErrorDialog
from PluginUtils import register_export
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -355,4 +356,5 @@ _description = _('vCalendar is used in many calendaring and pim applications.')
_config = (_('vCalendar export options'), CalendarWriterOptionBox)
_filename = 'vcs'
register_export(exportData, _title, _description, _config, _filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(exportData, _title, _description, _config, _filename)

View File

@ -3,6 +3,7 @@
#
# Copyright (C) 2004 Martin Hawlisch
# Copyright (C) 2005-2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ from Filters import GenericFilter, Rules, build_filter_menu
from gen.lib import Date
import Errors
from QuestionDialog import ErrorDialog
from PluginUtils import register_export
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -271,4 +272,5 @@ _description = _('vCard is used in many addressbook and pim applications.')
_config = (_('vCard export options'), CardWriterOptionBox)
_filename = 'vcf'
register_export(exportData, _title, _description, _config, _filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(exportData, _title, _description, _config, _filename)

View File

@ -3,6 +3,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -49,7 +50,7 @@ import gobject
import ManagedWindow
import GrampsDisplay
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
import Utils
CITY_STATE_ZIP = re.compile("((\w|\s)+)\s*,\s*((\w|\s)+)\s*(,\s*((\d|-)+))", re.UNICODE)
@ -621,7 +622,8 @@ class ExtractCityOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'excity',
category = Tool.TOOL_DBPROC,
tool_class = ExtractCity,

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -29,7 +29,7 @@
#
#------------------------------------------------------------------------
import gen.lib
from PluginUtils import register_report, BooleanOption, FamilyOption
from PluginUtils import PluginManager, BooleanOption, FamilyOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc
@ -762,7 +762,8 @@ class FamilyGroupOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'family_group',
category = CATEGORY_TEXT,
report_class = FamilyGroup,

View File

@ -34,7 +34,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import BaseDoc
from PluginUtils import register_report
from PluginUtils import PluginManager
from PluginUtils import NumberOption, EnumeratedListOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_DRAW, \
MODE_GUI, MODE_BKI, MODE_CLI
@ -433,7 +433,8 @@ class FanChartOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'fan_chart',
category = CATEGORY_DRAW,
report_class = FanChart,

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -24,7 +24,7 @@ Display filtered data
"""
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
from Utils import media_path_full
from QuickReports import run_quick_report_by_name_direct
from gen.lib import Person
@ -226,7 +226,8 @@ def run(database, document, filter_name, *args, **kwargs):
#
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'filterbyname',
category = -1, # stand-alone
run_func = run,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -51,7 +52,7 @@ import Errors
from Merge import PersonCompare
import GrampsDisplay
import ManagedWindow
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from QuestionDialog import ErrorDialog, RunDatabaseRepair
from TransUtils import sgettext as _
#-------------------------------------------------------------------------
@ -689,7 +690,8 @@ class MergeOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'dupfind',
category = Tool.TOOL_DBPROC,
tool_class = Merge,

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Stephane Charette
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pubilc License as published by
@ -51,7 +51,7 @@ import ThumbNails
from DateHandler import displayer as _dd
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_GRAPHVIZ, MODE_GUI
from PluginUtils import register_report, EnumeratedListOption, BooleanOption, \
from PluginUtils import PluginManager, EnumeratedListOption, BooleanOption, \
NumberOption, ColourOption, PersonListOption, SurnameColourOption
#------------------------------------------------------------------------
@ -1032,7 +1032,8 @@ class FamilyLinesReport(Report):
# appears in the "Reports" menu options
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'familylines_graph',
translated_name = _("Family Lines Graph"),
category = CATEGORY_GRAPHVIZ,

View File

@ -35,7 +35,7 @@ from gettext import gettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, NumberOption, PersonOption, \
from PluginUtils import PluginManager, NumberOption, PersonOption, \
EnumeratedListOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
MODE_GUI, MODE_CLI, CATEGORY_GRAPHVIZ
@ -273,7 +273,8 @@ class HourGlassOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'hourglass_graph',
category = CATEGORY_GRAPHVIZ,
report_class = HourGlassReport,

View File

@ -42,7 +42,7 @@ from TransUtils import sgettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, FilterOption, \
from PluginUtils import PluginManager, FilterOption, \
EnumeratedListOption, BooleanOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
MODE_GUI, MODE_CLI, CATEGORY_GRAPHVIZ
@ -551,7 +551,8 @@ class RelGraphOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'rel_graph',
category = CATEGORY_GRAPHVIZ,
report_class = RelGraphReport,

View File

@ -1,9 +1,10 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 Douglas S. Blank
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Raphael Ackerman
# Copyright (C) 2007 Douglas S. Blank
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Raphael Ackerman
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ import gtk
import gen.lib
from QuestionDialog import ErrorDialog
from DateHandler import parser as _dp
from PluginUtils import register_import
from PluginUtils import PluginManager
from Utils import gender as gender_map
from Utils import ProgressMeter
@ -806,5 +807,7 @@ _filter.set_name(_('CSV spreadsheet files'))
_filter.add_mime_type(_mime_type)
_filter.add_mime_type(_mime_type_rfc_4180)
_format_name = _('CSV Spreadheet')
register_import(importData, _filter, [_mime_type, _mime_type_rfc_4180],
pmgr = PluginManager.get_instance()
pmgr.register_import(importData, _filter, [_mime_type, _mime_type_rfc_4180],
0, _format_name)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ import Errors
import gen.lib
import const
from QuestionDialog import ErrorDialog
from PluginUtils import register_import
from PluginUtils import PluginManager
from htmlentitydefs import name2codepoint
_date_parse = re.compile('([kmes~?<>]+)?([0-9/]+)([J|H|F])?(\.\.)?([0-9/]+)?([J|H|F])?')
@ -934,4 +935,5 @@ _filter.set_name(_('GeneWeb files'))
_filter.add_mime_type(_mime_type)
_format_name = _('GeneWeb')
register_import(importData, _filter, [_mime_type], 0, _format_name)
pmgr = PluginManager.get_instance()
pmgr.register_import(importData, _filter, [_mime_type], 0, _format_name)

View File

@ -3,6 +3,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008-2008 Kees Bakker
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -53,7 +54,7 @@ import Utils
import gen.lib
import const
from QuestionDialog import ErrorDialog
from PluginUtils import register_import
from PluginUtils import PluginManager
class ProgenError(Exception):
@ -1207,4 +1208,5 @@ _filter.set_name(_('Pro-Gen files'))
_filter.add_mime_type(_mime_type)
_format_name = _('Pro-Gen')
register_import(_importData, _filter, [_mime_type], 0, _format_name)
pmgr = PluginManager.get_instance()
pmgr.register_import(_importData, _filter, [_mime_type], 0, _format_name)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ import Errors
import gen.lib
import const
from QuestionDialog import ErrorDialog
from PluginUtils import register_import
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -225,4 +226,5 @@ _filter.set_name(_('vCard files'))
for mime in _mime_type:
_filter.add_mime_type(mime)
register_import(importData, _filter, _mime_type, 1)
pmgr = PluginManager.get_instance()
pmgr.register_import(importData, _filter, _mime_type, 1)

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
import gen.lib
import BaseDoc
import DateHandler
from PluginUtils import register_report, FilterOption, BooleanOption, \
from PluginUtils import PluginManager, FilterOption, BooleanOption, \
PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
@ -633,7 +633,8 @@ class IndivCompleteOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'indiv_complete',
category = CATEGORY_TEXT,
report_class = IndivCompleteReport,

View File

@ -35,7 +35,7 @@ from string import capitalize
# gramps modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, relationship_class, NumberOption, \
from PluginUtils import PluginManager, NumberOption, \
BooleanOption, PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
@ -82,7 +82,9 @@ class KinshipReport(Report):
self.person = database.get_person_from_gramps_id(pid)
self.__db = database
self.rel_calc = relationship_class()
pmgr = PluginManager.get_instance()
self.rel_calc = pmgr.get_relationship_calculator()
self.kinship_map = {}
self.spouse_map = {}
@ -395,7 +397,8 @@ class KinshipOptions(MenuReportOptions):
# Register the plugin
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'kinship_report',
category = CATEGORY_TEXT,
report_class = KinshipReport,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -46,7 +47,7 @@ import gc
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
import ManagedWindow
#-------------------------------------------------------------------------
@ -119,7 +120,8 @@ class LeakOptions(Tool.ToolOptions):
#------------------------------------------------------------------------
if __debug__:
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'leak',
category = Tool.TOOL_DEBUG,
tool_class = Leak,

View File

@ -34,7 +34,7 @@ from gettext import gettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, EnumeratedListOption
from PluginUtils import PluginManager, EnumeratedListOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc
@ -515,7 +515,8 @@ class MarkerOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'marker_report',
category = CATEGORY_TEXT,
report_class = MarkerReport,

View File

@ -2,7 +2,8 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 B. Malengier
# Copyright (C) 2008 B. Malengier
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -50,7 +51,7 @@ import Assistant
import Errors
from gen.lib import MediaObject
from BasicUtils import UpdateCallback
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from Utils import media_path_full, relative_path, media_path
from TransUtils import sgettext as _
@ -584,7 +585,8 @@ class MediaManOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'mediaman',
category = Tool.TOOL_UTILS,
tool_class = MediaMan,

View File

@ -4,6 +4,7 @@
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com>
# Copyright (C) 2007 Gary Burton <gary.burton@zen.co.uk>
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -70,7 +71,7 @@ import gen.lib
import const
from GrampsCfg import get_researcher
import Sort
from PluginUtils import (register_report, FilterOption, EnumeratedListOption,
from PluginUtils import (PluginManager, FilterOption, EnumeratedListOption,
PersonOption, BooleanOption, NumberOption,
StringOption, DestinationOption, NoteOption,
MediaOption)
@ -3152,7 +3153,8 @@ def sort_people(db, handle_list):
sorted_lists.append((name, entries))
return sorted_lists
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'navwebpage',
category = CATEGORY_WEB,
report_class = NavWebReport,

View File

@ -43,7 +43,7 @@ import gobject
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_tool, Tool
from PluginUtils import PluginManager, Tool
from ReportBase import ReportUtils
from Editors import EditPerson, EditFamily
import ManagedWindow
@ -426,7 +426,8 @@ class NotRelatedOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'not_related',
category = Tool.TOOL_UTILS,
tool_class = NotRelated,

View File

@ -38,7 +38,7 @@ import math
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, PersonOption
from PluginUtils import PluginManager, PersonOption
from ReportBase import Report, MenuReportOptions, ReportUtils, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
from BasicUtils import name_displayer
@ -189,7 +189,8 @@ class NumberOfAncestorsOptions(MenuReportOptions):
# register_report
#
#-------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'number_of_ancestors_report',
category = CATEGORY_TEXT,
report_class = NumberOfAncestorsReport,

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -25,7 +25,7 @@ Display all events on a particular day.
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
from ReportBase import CATEGORY_QR_EVENT
import gen.lib
@ -137,7 +137,8 @@ def run(database, document, main_event):
# Register the report
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'onthisday',
category = CATEGORY_QR_EVENT,
run_func = run,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -47,7 +48,7 @@ import GrampsCfg
import GrampsDisplay
from widgets import MonitoredEntry
import ManagedWindow
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from TransUtils import sgettext as _
#-------------------------------------------------------------------------
@ -189,7 +190,8 @@ class OwnerEditorOptions(Tool.ToolOptions):
# Register the plugin tool to plugin manager
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'editowner',
category = Tool.TOOL_DBPROC,
tool_class = OwnerEditor,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -45,7 +46,7 @@ import gobject
#
#-------------------------------------------------------------------------
import Utils
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from QuestionDialog import OkDialog
import ManagedWindow
import GrampsDisplay
@ -362,7 +363,8 @@ class PatchNamesOptions(Tool.ToolOptions):
Tool.ToolOptions.__init__(self, name, person_id)
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'patchnames',
category = Tool.TOOL_DBPROC,
tool_class = PatchNames,

View File

@ -25,7 +25,7 @@ Run a query on the tables
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
import Utils
from ReportBase import CATEGORY_QR_MISC
import DateHandler
@ -427,8 +427,8 @@ def run(database, document, query):
# Register the report
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'query',
category = CATEGORY_QR_MISC,
run_func = run,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -50,7 +51,7 @@ from QuestionDialog import ErrorDialog
from Errors import HandleError
from BasicUtils import UpdateCallback
from BasicUtils import name_displayer
from PluginUtils import register_import
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -326,4 +327,5 @@ _filter.set_name(_('GRAMPS 2.x database'))
_filter.add_mime_type(_mime_type)
_format_name = _('GRAMPS 2.x database')
register_import(importData, _filter, [_mime_type], 0, _format_name)
pmgr = PluginManager.get_instance()
pmgr.register_import(importData, _filter, [_mime_type], 0, _format_name)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -56,7 +57,7 @@ import const
from GrampsDbUtils import gramps_db_reader_factory
from QuestionDialog import ErrorDialog, WarningDialog
import Utils
from PluginUtils import register_import
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -154,4 +155,5 @@ _filter.set_name(_('GRAMPS packages'))
_filter.add_mime_type(_mime_type)
_format_name = _('GRAMPS package')
register_import(impData, _filter, [_mime_type], 0, _format_name)
pmgr = PluginManager.get_instance()
pmgr.register_import(impData, _filter, [_mime_type], 0, _format_name)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -48,7 +49,7 @@ log = logging.getLogger(".Rebuild")
# GRAMPS modules
#
#-------------------------------------------------------------------------
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from QuestionDialog import OkDialog
from BasicUtils import UpdateCallback
@ -108,7 +109,8 @@ class RebuildOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'rebuild',
category = Tool.TOOL_DBFIX,
tool_class = Rebuild,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -50,7 +51,7 @@ log = logging.getLogger(".RebuildRefMap")
# GRAMPS modules
#
#-------------------------------------------------------------------------
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from QuestionDialog import OkDialog
from BasicUtils import UpdateCallback
@ -110,7 +111,8 @@ class RebuildRefMapOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'rebuild_refmap',
category = Tool.TOOL_DBFIX,
tool_class = RebuildRefMap,

View File

@ -28,7 +28,7 @@ from ReportBase import (CATEGORY_QR_SOURCE, CATEGORY_QR_PERSON,
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
# mention so that will be translated for below
[_('Person'), _('Family'), _('Event'), _('Source'),
@ -93,8 +93,10 @@ refitems = [(CATEGORY_QR_PERSON, 'person', _("Person")),
(CATEGORY_QR_PLACE, 'place', _("Place")),
(CATEGORY_QR_REPOSITORY, 'repository', _("Repository")),
]
pmgr = PluginManager.get_instance()
for (category,item,trans) in refitems:
register_quick_report(
pmgr.register_quick_report(
name = item + 'refereneces',
category = category,
run_func = lambda db, doc, obj, item=item, trans=trans: \

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -48,7 +49,7 @@ import ManagedWindow
from DisplayModels import PeopleModel
from QuestionDialog import ErrorDialog
from PluginUtils import Tool, relationship_class, register_tool
from PluginUtils import Tool, PluginManager
column_names = [
_('Name'),
@ -79,7 +80,8 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
self.dbstate = dbstate
self.relationship = relationship_class()
pmgr = PluginManager.get_instance()
self.relationship = pmgr.get_relationship_calculator()
self.relationship.connect_db_signals(dbstate)
base = os.path.dirname(__file__)
@ -257,7 +259,8 @@ class RelCalcOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'relcalc',
category = Tool.TOOL_UTILS,
tool_class = RelCalc,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -56,7 +57,7 @@ from gen.lib import StyledText
import Errors
import ManagedWindow
from BasicUtils import UpdateCallback
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
#-------------------------------------------------------------------------
#
@ -425,7 +426,8 @@ class CheckOptions(Tool.ToolOptions):
#
#
#------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'remove_unused',
category = Tool.TOOL_DBFIX,
tool_class = RemoveUnused,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -40,7 +41,7 @@ from gettext import gettext as _
#------------------------------------------------------------------------
import Utils
import gen.lib
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
_findint = re.compile('^[^\d]*(\d+)[^\d]*')
@ -227,7 +228,8 @@ class ReorderIdsOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'reorder_ids',
category = Tool.TOOL_DBPROC,
tool_class = ReorderIds,

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -25,7 +25,7 @@ Display a people who have a person's same surname
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
from ReportBase import CATEGORY_QR_PERSON
from Filters.Rules import Rule
from Filters import GenericFilterFactory
@ -95,7 +95,8 @@ def run(database, document, person):
#
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'samesurnames',
category = CATEGORY_QR_PERSON,
run_func = run,

View File

@ -33,7 +33,7 @@ from TransUtils import sgettext as _
# gramps modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report, NumberOption, StringOption, MediaOption
from PluginUtils import PluginManager, NumberOption, StringOption, MediaOption
from Utils import media_path_full
from ReportBase import Report, MenuReportOptions, CATEGORY_TEXT, MODE_BKI
import BaseDoc
@ -177,7 +177,8 @@ class SimpleBookTitleOptions(MenuReportOptions):
# register_report
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'simple_book_title',
category = CATEGORY_TEXT,
report_class = SimpleBookTitle,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -45,7 +46,7 @@ import GrampsDisplay
import ManagedWindow
import AutoComp
from TransUtils import sgettext as _
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
#-------------------------------------------------------------------------
#
@ -142,7 +143,8 @@ class SoundGenOptions(Tool.ToolOptions):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'soundgen',
category = Tool.TOOL_UTILS,
tool_class = SoundGen,

View File

@ -44,7 +44,7 @@ from TransUtils import sgettext as _
from gen.lib import Person, FamilyRelType, EventType
# gender and report type names
import BaseDoc
from PluginUtils import register_report
from PluginUtils import PluginManager
from PluginUtils import BooleanOption, FilterOption, PersonOption, \
EnumeratedListOption, NumberOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
@ -891,7 +891,8 @@ class StatisticsChartOptions(MenuReportOptions):
# Register report/options
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'statistics_chart',
category = CATEGORY_DRAW,
report_class = StatisticsChart,

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
#
#------------------------------------------------------------------------
import gen.lib
from PluginUtils import register_report
from PluginUtils import PluginManager
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc
@ -291,7 +291,8 @@ class SummaryOptions(MenuReportOptions):
# register_report
#
#-------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'summary',
category = CATEGORY_TEXT,
report_class = SummaryReport,

View File

@ -3,6 +3,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -44,7 +45,7 @@ import gtk
#
#-------------------------------------------------------------------------
import gen.lib
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
import Utils
import LdsUtils
@ -1389,7 +1390,8 @@ class TestcaseGeneratorOptions(Tool.ToolOptions):
#-------------------------------------------------------------------------
if __debug__:
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'testcasegenerator',
category = Tool.TOOL_DEBUG,
tool_class = TestcaseGenerator,

View File

@ -37,7 +37,7 @@ from TransUtils import sgettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from PluginUtils import register_report
from PluginUtils import PluginManager
from PluginUtils import FilterOption, EnumeratedListOption, \
PersonOption
from ReportBase import Report, ReportUtils, MenuReportOptions, \
@ -455,7 +455,8 @@ class TimeLineOptions(MenuReportOptions):
#
#
#------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'timeline',
category = CATEGORY_DRAW,
report_class = TimeLine,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ import Utils
import GrampsDisplay
from ManagedWindow import ManagedWindow
from BasicUtils import UpdateCallback
from PluginUtils import Tool, register_tool
from PluginUtils import Tool, PluginManager
from TransUtils import sgettext as _
#-------------------------------------------------------------------------
#
@ -1568,7 +1569,8 @@ class InvalidDeathDate(PersonRule):
#
#
#-------------------------------------------------------------------------
register_tool(
pmgr = PluginManager.get_instance()
pmgr.register_tool(
name = 'verify',
category = Tool.TOOL_UTILS,
tool_class = Verify,

View File

@ -67,7 +67,7 @@ import gen.lib
import const
import BaseDoc
from GrampsCfg import get_researcher
from PluginUtils import register_report
from PluginUtils import PluginManager
from ReportBase import (Report, ReportUtils, MenuReportOptions, CATEGORY_WEB,
MODE_GUI)
from PluginUtils import FilterOption, EnumeratedListOption, PersonOption, \
@ -1219,7 +1219,8 @@ _COUNTRIES = _get_countries()
#
#
#-------------------------------------------------------------------------
register_report(
pmgr = PluginManager.get_instance()
pmgr.register_report(
name = 'WebCal',
category = CATEGORY_WEB,
report_class = WebCalReport,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -75,7 +76,7 @@ except:
from GrampsDbUtils import XmlWriter
from Utils import media_path_full
from QuestionDialog import ErrorDialog, MissingMediaDialog
from PluginUtils import register_export
from PluginUtils import PluginManager
_title_string = _("Export to CD")
@ -306,4 +307,5 @@ _description = _('Exporting to CD copies all your data and media '
_config = None
_filename = 'burn'
register_export(writeData, _title, _description, _config, _filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(writeData, _title, _description, _config, _filename)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006, 2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ import Utils
from Filters import GenericFilter, Rules, build_filter_menu
import Errors
from QuestionDialog import ErrorDialog
from PluginUtils import register_export
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -312,4 +313,5 @@ _description = _('Web Family Tree format.')
_config = (_('Web Family Tree export options'), FtreeWriterOptionBox)
_filename = 'wft'
register_export(writeData, _title, _description, _config,_filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(writeData, _title, _description, _config,_filename)

View File

@ -3,6 +3,7 @@
#
# Copyright (C) 2004 Martin Hawlisch
# Copyright (C) 2004-2006, 2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -56,7 +57,7 @@ from Filters import GenericFilter, Rules, build_filter_menu
import Utils
import Errors
from QuestionDialog import ErrorDialog
from PluginUtils import register_export
from PluginUtils import PluginManager
#-------------------------------------------------------------------------
#
@ -642,4 +643,5 @@ _description = _('GeneWeb is a web based genealogy program.')
_config = (_('GeneWeb export options'), GeneWebWriterOptionBox)
_filename = 'gw'
register_export(exportData, _title, _description, _config, _filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(exportData, _title, _description, _config, _filename)

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2008 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ import gtk
#
#-------------------------------------------------------------------------
from GrampsDbUtils import XmlWriter
from PluginUtils import register_export
from PluginUtils import PluginManager
import Utils
#-------------------------------------------------------------------------
@ -226,4 +227,5 @@ _description = _('GRAMPS package is an archived XML database together '
_config = (_('GRAMPS package export options'), ExportOptions.WriterOptionBox)
_filename = 'gpkg'
register_export(writeData, _title, _description, _config, _filename)
pmgr = PluginManager.get_instance()
pmgr.register_export(writeData, _title, _description, _config, _filename)

View File

@ -2,7 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2007-2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -25,7 +25,7 @@ Display a person's events, both personal and family
from Simple import SimpleAccess, by_date, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
from ReportBase import CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY
def run(database, document, person):
@ -137,7 +137,9 @@ def fam_sort(event1, event2):
#
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'all_events',
category = CATEGORY_QR_PERSON,
run_func = run,
@ -148,7 +150,7 @@ register_quick_report(
author_email="don@gramps-project.org"
)
register_quick_report(
pmgr.register_quick_report(
name = 'all_events_fam',
category = CATEGORY_QR_FAMILY,
run_func = run_fam,

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 B. Malengier
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -29,7 +30,7 @@ Display a person's relations to the home person
from Simple import SimpleAccess, SimpleDoc
from gettext import gettext as _
from PluginUtils import register_quick_report, relationship_class
from PluginUtils import PluginManager
from ReportBase import CATEGORY_QR_PERSON
# define the formatting string once as a constant. Since this is reused
@ -57,7 +58,10 @@ class AllRelReport():
self.person = person
self.sdb = SimpleAccess(database)
self.sdoc = SimpleDoc(document)
self.rel_class = relationship_class()
pmgr = PluginManager.get_instance()
self.rel_class = pmgr.get_relationship_calculator()
self.msg_list = []
def run(self):
@ -342,7 +346,8 @@ class AllRelReport():
#
#
#------------------------------------------------------------------------
register_quick_report(
pmgr = PluginManager.get_instance()
pmgr.register_quick_report(
name = 'all_relations',
category = CATEGORY_QR_PERSON,
run_func = run,

View File

@ -3,6 +3,7 @@
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Jerome Rapinat, B. Malengier
# Copyright (C) 2008 Brian G. Matherly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,7 +35,7 @@ Display a person's father or mother lineage
import gen.lib
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from PluginUtils import register_quick_report
from PluginUtils import PluginManager
from ReportBase import CATEGORY_QR_PERSON
__FMT = "%-30s\t%-12s\t%-12s"
@ -231,8 +232,9 @@ def add_rem(remark, text):
#
#
#------------------------------------------------------------------------
pmgr = PluginManager.get_instance()
register_quick_report(
pmgr.register_quick_report(
name = 'father_lineage',
category = CATEGORY_QR_PERSON,
run_func = run_father,
@ -243,7 +245,7 @@ register_quick_report(
author_email="benny.malengier@gramps-project.org"
)
register_quick_report(
pmgr.register_quick_report(
name = 'mother_lineage',
category = CATEGORY_QR_PERSON,
run_func = run_mother,

Some files were not shown because too many files have changed in this diff Show More