diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index aa740b419..b6b8fc737 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2005-01-04 Don Allingham + * src/Plugins.py: move non-gui functions to PluginMgr.py + * src/PluginMgr.py: Non-gui functions for plugins + * src/Makefile.am: Added PluginMgr.py + * various: switch from Plugins to PluginMgr + 2005-01-03 Don Allingham * src/GrampsDbBase.py: move all thumbnail creation here to have a common thumbnail scheme. diff --git a/gramps2/src/DateHandler.py b/gramps2/src/DateHandler.py index 15f9f27ff..518247c52 100644 --- a/gramps2/src/DateHandler.py +++ b/gramps2/src/DateHandler.py @@ -106,7 +106,7 @@ def register_datehandler(locales,parse_class,display_class): # Import localized date classes # #------------------------------------------------------------------------- -from Plugins import load_plugins +from PluginMgr import load_plugins from const import datesDir load_plugins(datesDir) diff --git a/gramps2/src/DbPrompter.py b/gramps2/src/DbPrompter.py index 94bf9f759..fc4367332 100644 --- a/gramps2/src/DbPrompter.py +++ b/gramps2/src/DbPrompter.py @@ -46,7 +46,7 @@ import gnome import Utils import const import QuestionDialog -import Plugins +import PluginMgr import GrampsBSDDB import GrampsXMLDB import GrampsGEDDB @@ -156,7 +156,7 @@ class ExistingDbPrompter: choose.add_filter(mime_filter) # Add more data type selections if opening existing db - for (importData,mime_filter,mime_type,native_format) in Plugins._imports: + for (importData,mime_filter,mime_type,native_format) in PluginMgr.import_list: if not native_format: choose.add_filter(mime_filter) @@ -183,7 +183,7 @@ class ExistingDbPrompter: # The above native formats did not work, so we need to # look up the importer for this format # and create an empty native database to import data in - for (importData,mime_filter,mime_type,native_format) in Plugins._imports: + for (importData,mime_filter,mime_type,native_format) in Plugin.import_list: if filetype == mime_type or the_file == mime_type: QuestionDialog.OkDialog( _("Opening non-native format"), @@ -252,7 +252,7 @@ class ImportDbPrompter: # choose.add_filter(mime_filter) # Add more data type selections if opening existing db - for (importData,mime_filter,mime_type,native_format) in Plugins._imports: + for (importData,mime_filter,mime_type,native_format) in PluginMgr.import_list: choose.add_filter(mime_filter) # Suggested folder: try last open file, import, then last export, @@ -279,7 +279,7 @@ class ImportDbPrompter: (the_path,the_file) = os.path.split(filename) GrampsGconfKeys.save_last_import_dir(the_path) - for (importData,mime_filter,mime_type,native_format) in Plugins._imports: + for (importData,mime_filter,mime_type,native_format) in PluginMgr.import_list: if filetype == mime_type or the_file == mime_type: choose.destroy() importData(self.parent.db,filename) diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index fc2873362..af314bee3 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -1398,6 +1398,8 @@ class IsSpouseOfFilterMatch(Rule): class GenericFilter: """Filter class that consists of several rules""" + logical_functions = ['or', 'and', 'xor', 'one'] + def __init__(self,source=None): if source: self.need_param = source.need_param @@ -1415,7 +1417,7 @@ class GenericFilter: self.invert = 0 def set_logical_op(self,val): - if val in const.logical_functions: + if val in GenericFilter.logical_functions: self.logical_op = val else: self.logical_op = 'and' diff --git a/gramps2/src/Makefile.am b/gramps2/src/Makefile.am index 873c8b509..288a47fdb 100644 --- a/gramps2/src/Makefile.am +++ b/gramps2/src/Makefile.am @@ -78,6 +78,7 @@ gdir_PYTHON = \ PeopleModel.py\ PlaceView.py\ Plugins.py\ + PluginMgr.py\ QuestionDialog.py\ ReadGedcom.py \ ReadXML.py\ diff --git a/gramps2/src/PluginMgr.py b/gramps2/src/PluginMgr.py new file mode 100644 index 000000000..435de28fb --- /dev/null +++ b/gramps2/src/PluginMgr.py @@ -0,0 +1,418 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2000-2004 Donald N. Allingham +# +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# 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 core of the GRAMPS plugin system. This module provides tasks to load +plugins from specfied directories, build menus for the different categories, +and provide dialog to select and execute plugins. + +Plugins are divided into several categories. This are: reports, tools, +importers, exporters, and document generators. +""" + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +import os +import sys +import string +from re import compile +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +import const +import GrampsGconfKeys +import Errors + +#------------------------------------------------------------------------- +# +# Global lists +# +#------------------------------------------------------------------------- +report_list = [] +tool_list = [] +import_list = [] +export_list = [] +expect_list = [] +attempt_list = [] +loaddir_list = [] +textdoc_list = [] +bookdoc_list = [] +drawdoc_list = [] +failmsg_list = [] +bkitems_list = [] +cl_list = [] + +_success_list = [] + +status_up = None +#------------------------------------------------------------------------- +# +# Default relationship calculator +# +#------------------------------------------------------------------------- +import Relationship +_relcalc_class = Relationship.RelationshipCalculator + +#------------------------------------------------------------------------- +# +# +#------------------------------------------------------------------------- +_unavailable = _("No description was provided"), + +#------------------------------------------------------------------------- +# +# load_plugins +# +#------------------------------------------------------------------------- +def load_plugins(direct): + """Searches the specified directory, and attempts to load any python + modules that it finds, adding name to the attempt_lists list. If the module + successfully loads, it is added to the _success_list list. Each plugin is + responsible for registering itself in the correct manner. No attempt + is done in this routine to register the tasks.""" + + global _success_list,attempt_list,loaddir_list,failmsg_list + + # if the directory does not exist, do nothing + if not os.path.isdir(direct): + return + + # if the path has not already been loaded, save it in the loaddir_list + # list for use on reloading + + if direct not in loaddir_list: + loaddir_list.append(direct) + + # add the directory to the python search path + sys.path.append(direct) + + pymod = compile(r"^(.*)\.py$") + + # loop through each file in the directory, looking for files that + # have a .py extention, and attempt to load the file. If it succeeds, + # add it to the _success_list list. If it fails, add it to the _failure + # list + + for filename in os.listdir(direct): + name = os.path.split(filename) + match = pymod.match(name[1]) + if not match: + continue + attempt_list.append(filename) + plugin = match.groups()[0] + try: + a = __import__(plugin) + _success_list.append(a) + except Errors.PluginError, msg: + expect_list.append((filename,str(msg))) + except: + failmsg_list.append((filename,sys.exc_info())) + + if GrampsGconfKeys.get_pop_plugin_status() and len(expect_list)+len(failmsg_list): + PluginStatus() + +#------------------------------------------------------------------------- +# +# reload_plugins +# +#------------------------------------------------------------------------- +def reload_plugins(obj=None,junk1=None,junk2=None,junk3=None): + """Treated as a callback, causes all plugins to get reloaded. This is + useful when writing and debugging a plugin""" + + pymod = compile(r"^(.*)\.py$") + + global _success_list,attempt_list,loaddir_list,failmsg_list + + oldfailmsg = failmsg_list[:] + failmsg_list = [] + + # attempt to reload all plugins that have succeeded in the past + for plugin in _success_list: + filename = os.path.basename(plugin.__file__) + filename = filename.replace('pyc','py') + filename = filename.replace('pyo','py') + try: + reload(plugin) + except: + failmsg_list.append((filename,sys.exc_info())) + + # attempt to load the plugins that have failed in the past + + for (filename,message) in oldfailmsg: + name = os.path.split(filename) + match = pymod.match(name[1]) + if not match: + continue + attempt_list.append(filename) + plugin = match.groups()[0] + try: + # For some strange reason second importing of a failed plugin + # results in success. Then reload reveals the actual error. + # Looks like a bug in Python. + a = __import__(plugin) + reload(a) + _success_list.append(a) + except: + failmsg_list.append((filename,sys.exc_info())) + + # attempt to load any new files found + for directory in loaddir_list: + for filename in os.listdir(directory): + name = os.path.split(filename) + match = pymod.match(name[1]) + if not match: + continue + if filename in attempt_list: + continue + attempt_list.append(filename) + plugin = match.groups()[0] + try: + a = __import__(plugin) + if a not in _success_list: + _success_list.append(a) + except: + failmsg_list.append((filename,sys.exc_info())) + + if GrampsGconfKeys.get_pop_plugin_status(): + global status_up + if len(failmsg_list): + PluginStatus() + elif status_up: + status_up.close(None) + status_up = None + +#------------------------------------------------------------------------- +# +# Plugin registering +# +#------------------------------------------------------------------------- +def register_export(exportData,title,description='',config=None,filename=''): + """ + Register an export filter, taking the task, file filter, + and the list of patterns for the filename matching. + """ + if description and filename: + export_list.append((exportData,title,description,config,filename)) + +def register_import(task, ffilter, mime=None, native_format=0): + """Register an import filter, taking the task and file filter""" + if mime: + import_list.append((task, ffilter, mime, native_format)) + + +def register_tool( + task, + name, + category=_("Uncategorized"), + description=_unavailable, + status=_("Unknown"), + author_name=_("Unknown"), + author_email=_("Unknown") + ): + """Register a tool with the plugin system""" + del_index = -1 + for i in range(0,len(tool_list)): + val = tool_list[i] + if val[2] == name: + del_index = i + if del_index != -1: + del tool_list[del_index] + tool_list.append((task, category, name, description, + status, author_name, author_name)) + +#------------------------------------------------------------------------- +# +# Report registration +# +#------------------------------------------------------------------------- +def register_report( + name, + category, + report_class, + options_class, + modes, + translated_name, + status=_("Unknown"), + description=_unavailable, + author_name=_("Unknown"), + author_email=_("Unknown") + ): + """ + Registers report for all possible flavors. + + This function should be used to register report as a stand-alone, book item, or command-line flavor in any combination of those. + The low-level functions (starting with '_') should not be used + on their own. Instead, this function will call them as needed. + """ + + import Report + (junk,standalone_task) = divmod(modes,2**Report.MODE_GUI) + if standalone_task: + _register_standalone(report_class,options_class,translated_name, + name,category,description, + status,author_name,author_email) + + (junk,book_item_task) = divmod(modes-standalone_task,2**Report.MODE_BKI) + if book_item_task: + book_item_category = const.book_categories[category] + register_book_item(translated_name,book_item_category, + report_class,options_class,name) + + (junk,command_line_task) = divmod(modes-standalone_task-book_item_task, + 2**Report.MODE_CLI) + if command_line_task: + _register_cl_report(name,category,report_class,options_class) + +def _register_standalone(report_class, options_class, translated_name, + name, category, + description=_unavailable, + status=_("Unknown"), + author_name=_("Unknown"), + author_email=_("Unknown") + ): + """Register a report with the plugin system""" + + import Report + + del_index = -1 + for i in range(0,len(report_list)): + val = report_list[i] + if val[2] == name: + del_index = i + if del_index != -1: + del report_list[del_index] + report_list.append((report_class, options_class, translated_name, + category, name, description, status, author_name, author_email)) + +def register_book_item(translated_name, category, report_class, + option_class, name): + """Register a book item""" + + for n in bkitems_list: + if n[0] == name: + return + bkitems_list.append((translated_name, category, report_class, + option_class, name)) + +def _register_cl_report(name,category,report_class,options_class): + for n in cl_list: + if n[0] == name: + return + cl_list.append((name,category,report_class,options_class)) + +#------------------------------------------------------------------------- +# +# Text document generator registration +# +#------------------------------------------------------------------------- +def register_text_doc(name,classref, table, paper, style, ext, + print_report_label=None,clname=''): + """Register a text document generator""" + for n in textdoc_list: + if n[0] == name: + return + if not clname: + clname = ext[1:] + textdoc_list.append( + (name, classref, table, paper, style, + ext, print_report_label, clname)) + +#------------------------------------------------------------------------- +# +# Book document generator registration +# +#------------------------------------------------------------------------- +def register_book_doc(name,classref, table, paper, style, ext, clname=''): + """Register a text document generator""" + for n in bookdoc_list: + if n[0] == name: + return + if not clname: + clname = ext[1:] + bookdoc_list.append((name,classref,table,paper,style,ext,clname)) + +#------------------------------------------------------------------------- +# +# Drawing document generator registration +# +#------------------------------------------------------------------------- +def register_draw_doc(name,classref,paper,style, ext, + print_report_label=None,clname=''): + """Register a drawing document generator""" + for n in drawdoc_list: + if n[0] == name: + return + if not clname: + clname = ext[1:] + drawdoc_list.append((name, classref, paper,style, ext, + print_report_label, clname)) + +#------------------------------------------------------------------------- +# +# Relationship calculator registration +# +#------------------------------------------------------------------------- +def register_relcalc(relclass, languages): + """Register a relationshp calculator""" + global _relcalc_class + + try: + if os.environ["LANG"] in languages: + _relcalc_class = relclass + except: + pass + +def relationship_class(db): + global _relcalc_class + return _relcalc_class(db) + +#------------------------------------------------------------------------- +# +# Image attributes +# +#------------------------------------------------------------------------- +_image_attributes = [] +def register_image_attribute(name): + if name not in _image_attributes: + _image_attributes.append(name) + +def get_image_attributes(): + return _image_attributes + +#------------------------------------------------------------------------- +# +# Register the plugin reloading tool +# +#------------------------------------------------------------------------- +register_tool( + reload_plugins, + _("Reload plugins"), + category=_("Debug"), + description=_("Attempt to reload plugins. Note: This tool itself is not reloaded!"), + ) diff --git a/gramps2/src/Plugins.py b/gramps2/src/Plugins.py index 1fea33c4d..05ae8c9a1 100644 --- a/gramps2/src/Plugins.py +++ b/gramps2/src/Plugins.py @@ -60,41 +60,7 @@ import Utils import GrampsGconfKeys import Errors import Report - -#------------------------------------------------------------------------- -# -# Global lists -# -#------------------------------------------------------------------------- -_reports = [] -_tools = [] -_imports = [] -_exports = [] -_success = [] -_expect = [] -_attempt = [] -_loaddir = [] -_textdoc = [] -_bookdoc = [] -_drawdoc = [] -_failmsg = [] -_bkitems = [] -_cl = [] - -_status_up = None -#------------------------------------------------------------------------- -# -# Default relationship calculator -# -#------------------------------------------------------------------------- -import Relationship -_relcalc_class = Relationship.RelationshipCalculator - -#------------------------------------------------------------------------- -# -# -#------------------------------------------------------------------------- -_unavailable = _("No description was provided"), +import PluginMgr #------------------------------------------------------------------------- # @@ -341,9 +307,13 @@ 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.""" - PluginDialog.__init__(self,parent,db,active,_reports,_("Report Selection"), - _("Select a report from those available on the left."), - _("_Generate"), _("Generate selected report")) + PluginDialog.__init__( + self,parent, + db, + active, + PluginMgr.report_list,_("Report Selection"), + _("Select a report from those available on the left."), + _("_Generate"), _("Generate selected report")) #------------------------------------------------------------------------- # @@ -359,9 +329,16 @@ class ToolPlugins(PluginDialog): reports. This is used to build the selection tree on the left hand side of the dailog box.""" - PluginDialog.__init__(self,parent,db,active,_tools,_("Tool Selection"), - _("Select a tool from those available on the left."), - _("_Run"), _("Run selected tool")) + PluginDialog.__init__( + self, + parent, + db, + active, + PluginMgr.tool_list, + _("Tool Selection"), + _("Select a tool from those available on the left."), + _("_Run"), + _("Run selected tool")) self.update = update #------------------------------------------------------------------------- @@ -373,10 +350,9 @@ class PluginStatus: """Displays a dialog showing the status of loaded plugins""" def __init__(self): - global _status_up - if _status_up: - _status_up.close(None) - _status_up = self + if PluginMgr.status_up: + PluginMgr.status_up.close(None) + PluginMgr.status_up = self import cStringIO @@ -401,16 +377,16 @@ class PluginStatus: info = cStringIO.StringIO() - if len(_expect) + len(_failmsg) == 0: + if len(PluginMgr.expect_list) + len(PluginMgr.failmsg_list) == 0: window.get_buffer().set_text(_('All modules were successfully loaded.')) else: info.write(_("The following modules could not be loaded:")) info.write("\n\n") - for (filename,msg) in _expect: + for (filename,msg) in PluginMgr.expect_list: info.write("%s: %s\n\n" % (filename,msg)) - for (filename,msgs) in _failmsg: + for (filename,msgs) in PluginMgr.failmsg_list: error = str(msgs[0]) if error[0:11] == "exceptions.": error = error[11:] @@ -421,11 +397,11 @@ class PluginStatus: window.get_buffer().set_text(info.read()) def on_delete(self,obj1,obj2): - _status_up = None + PluginMgr.status_up = None def close(self,obj): self.top.destroy() - _status_up = None + PluginMgr.status_up = None def help(self,obj): """Display the GRAMPS manual""" @@ -434,316 +410,6 @@ class PluginStatus: def pop_button_update(self, client,cnxn_id,entry,data): self.pop_button.set_active(GrampsGconfKeys.get_pop_plugin_status()) -#------------------------------------------------------------------------- -# -# load_plugins -# -#------------------------------------------------------------------------- -def load_plugins(direct): - """Searches the specified directory, and attempts to load any python - modules that it finds, adding name to the _attempts list. If the module - successfully loads, it is added to the _success list. Each plugin is - responsible for registering itself in the correct manner. No attempt - is done in this routine to register the tasks.""" - - global _success,_attempt,_loaddir,_failmsg - - # if the directory does not exist, do nothing - if not os.path.isdir(direct): - return - - # if the path has not already been loaded, save it in the _loaddir - # list for use on reloading - - if direct not in _loaddir: - _loaddir.append(direct) - - # add the directory to the python search path - sys.path.append(direct) - - pymod = compile(r"^(.*)\.py$") - - # loop through each file in the directory, looking for files that - # have a .py extention, and attempt to load the file. If it succeeds, - # add it to the _success list. If it fails, add it to the _failure - # list - - for filename in os.listdir(direct): - name = os.path.split(filename) - match = pymod.match(name[1]) - if not match: - continue - _attempt.append(filename) - plugin = match.groups()[0] - try: - a = __import__(plugin) - _success.append(a) - except Errors.PluginError, msg: - _expect.append((filename,str(msg))) - except: - _failmsg.append((filename,sys.exc_info())) - - if GrampsGconfKeys.get_pop_plugin_status() and len(_expect)+len(_failmsg): - PluginStatus() - -#------------------------------------------------------------------------- -# -# reload_plugins -# -#------------------------------------------------------------------------- -def reload_plugins(obj=None,junk1=None,junk2=None,junk3=None): - """Treated as a callback, causes all plugins to get reloaded. This is - useful when writing and debugging a plugin""" - - pymod = compile(r"^(.*)\.py$") - - global _success,_attempt,_loaddir,_failmsg - - oldfailmsg = _failmsg[:] - _failmsg = [] - - # attempt to reload all plugins that have succeeded in the past - for plugin in _success: - filename = os.path.basename(plugin.__file__) - filename = filename.replace('pyc','py') - filename = filename.replace('pyo','py') - try: - reload(plugin) - except: - _failmsg.append((filename,sys.exc_info())) - - # attempt to load the plugins that have failed in the past - - for (filename,message) in oldfailmsg: - name = os.path.split(filename) - match = pymod.match(name[1]) - if not match: - continue - _attempt.append(filename) - plugin = match.groups()[0] - try: - # For some strange reason second importing of a failed plugin - # results in success. Then reload reveals the actual error. - # Looks like a bug in Python. - a = __import__(plugin) - reload(a) - _success.append(a) - except: - _failmsg.append((filename,sys.exc_info())) - - # attempt to load any new files found - for directory in _loaddir: - for filename in os.listdir(directory): - name = os.path.split(filename) - match = pymod.match(name[1]) - if not match: - continue - if filename in _attempt: - continue - _attempt.append(filename) - plugin = match.groups()[0] - try: - a = __import__(plugin) - if a not in _success: - _success.append(a) - except: - _failmsg.append((filename,sys.exc_info())) - - if GrampsGconfKeys.get_pop_plugin_status(): - global _status_up - if len(_failmsg): - PluginStatus() - elif _status_up: - _status_up.close(None) - _status_up = None - -#------------------------------------------------------------------------- -# -# Plugin registering -# -#------------------------------------------------------------------------- -def register_export(exportData,title,description='',config=None,filename=''): - """ - Register an export filter, taking the task, file filter, - and the list of patterns for the filename matching. - """ - if description and filename: - _exports.append((exportData,title,description,config,filename)) - -def register_import(task, ffilter, mime=None, native_format=0): - """Register an import filter, taking the task and file filter""" - if mime: - _imports.append((task, ffilter, mime, native_format)) - - -def register_tool(task, name, - category=_("Uncategorized"), - description=_unavailable, - status=_("Unknown"), - author_name=_("Unknown"), - author_email=_("Unknown") - ): - """Register a tool with the plugin system""" - del_index = -1 - for i in range(0,len(_tools)): - val = _tools[i] - if val[2] == name: - del_index = i - if del_index != -1: - del _tools[del_index] - _tools.append((task, category, name, description, status, author_name, author_name)) - -#------------------------------------------------------------------------- -# -# Report registration -# -#------------------------------------------------------------------------- -def register_report( - name, - category, - report_class, - options_class, - modes, - translated_name, - status=_("Unknown"), - description=_unavailable, - author_name=_("Unknown"), - author_email=_("Unknown") - ): - """ - Registers report for all possible flavors. - - This function should be used to register report as a stand-alone, - book item, or command-line flavor in any combination of those. - The low-level functions (starting with '_') should not be used - on their own. Instead, this function will call them as needed. - """ - (junk,standalone_task) = divmod(modes,2**Report.MODE_GUI) - if standalone_task: - _register_standalone(report_class,options_class,translated_name, - name,category,description, - status,author_name,author_email) - - (junk,book_item_task) = divmod(modes-standalone_task,2**Report.MODE_BKI) - if book_item_task: - book_item_category = const.book_categories[category] - _register_book_item(translated_name,book_item_category, - report_class,options_class,name) - - (junk,command_line_task) = divmod(modes-standalone_task-book_item_task, - 2**Report.MODE_CLI) - if command_line_task: - _register_cl_report(name,category,report_class,options_class) - -def _register_standalone(report_class, options_class, translated_name, - name, category, - description=_unavailable, - status=_("Unknown"), - author_name=_("Unknown"), - author_email=_("Unknown") - ): - """Register a report with the plugin system""" - - del_index = -1 - for i in range(0,len(_reports)): - val = _reports[i] - if val[2] == name: - del_index = i - if del_index != -1: - del _reports[del_index] - _reports.append((report_class, options_class, translated_name, - category, name, description, status, author_name, author_email)) - -def _register_book_item(translated_name,category,report_class,option_class,name): - """Register a book item""" - - for n in _bkitems: - if n[0] == name: - return - _bkitems.append((translated_name,category,report_class,option_class,name)) - -def _register_cl_report(name,category,report_class,options_class): - for n in _cl: - if n[0] == name: - return - _cl.append((name,category,report_class,options_class)) - -#------------------------------------------------------------------------- -# -# Text document generator registration -# -#------------------------------------------------------------------------- -def register_text_doc(name,classref, table, paper, style, ext, - print_report_label=None,clname=''): - """Register a text document generator""" - for n in _textdoc: - if n[0] == name: - return - if not clname: - clname = ext[1:] - _textdoc.append((name,classref,table,paper,style,ext,print_report_label,clname)) - -#------------------------------------------------------------------------- -# -# Book document generator registration -# -#------------------------------------------------------------------------- -def register_book_doc(name,classref, table, paper, style, ext, clname=''): - """Register a text document generator""" - for n in _bookdoc: - if n[0] == name: - return - if not clname: - clname = ext[1:] - _bookdoc.append((name,classref,table,paper,style,ext,clname)) - -#------------------------------------------------------------------------- -# -# Drawing document generator registration -# -#------------------------------------------------------------------------- -def register_draw_doc(name,classref,paper,style, ext, - print_report_label=None,clname=''): - """Register a drawing document generator""" - for n in _drawdoc: - if n[0] == name: - return - if not clname: - clname = ext[1:] - _drawdoc.append((name,classref,paper,style,ext,print_report_label,clname)) - -#------------------------------------------------------------------------- -# -# Relationship calculator registration -# -#------------------------------------------------------------------------- -def register_relcalc(relclass, languages): - """Register a relationshp calculator""" - global _relcalc_class - - try: - if os.environ["LANG"] in languages: - _relcalc_class = relclass - except: - pass - -def relationship_class(db): - global _relcalc_class - return _relcalc_class(db) - -#------------------------------------------------------------------------- -# -# Image attributes -# -#------------------------------------------------------------------------- -_image_attributes = [] -def register_image_attribute(name): - if name not in _image_attributes: - _image_attributes.append(name) - -def get_image_attributes(): - return _image_attributes - #------------------------------------------------------------------------- # # Building pulldown menus @@ -790,7 +456,7 @@ def build_report_menu(top_menu,callback): report_menu.show() hash_data = {} - for report in _reports: + for report in PluginMgr.report_list: standalone_category = const.standalone_categories[report[3]] if hash_data.has_key(standalone_category): hash_data[standalone_category].append( @@ -827,7 +493,7 @@ def build_report_menu(top_menu,callback): # #------------------------------------------------------------------------- def build_tools_menu(top_menu,callback): - build_menu(top_menu,_tools,callback) + build_menu(top_menu,PluginMgr.tool_list,callback) #------------------------------------------------------------------------- # @@ -966,53 +632,3 @@ class GrampsBookFormatComboBox(gtk.ComboBox): def get_printable(self): return self.data[self.get_active()][6] - -#------------------------------------------------------------------------- -# -# get_text_doc_list -# -#------------------------------------------------------------------------- -def get_text_doc_list(): - l = [] - _textdoc.sort() - for item in _textdoc: - l.append(item[0]) - return l - -#------------------------------------------------------------------------- -# -# get_book_doc_list -# -#------------------------------------------------------------------------- -def get_book_doc_list(): - l = [] - _bookdoc.sort() - for item in _bookdoc: - l.append(item[0]) - return l - -#------------------------------------------------------------------------- -# -# get_draw_doc_list -# -#------------------------------------------------------------------------- -def get_draw_doc_list(): - - l = [] - _drawdoc.sort() - for item in _drawdoc: - l.append(item[0]) - return l - - -#------------------------------------------------------------------------- -# -# Register the plugin reloading tool -# -#------------------------------------------------------------------------- -register_tool( - reload_plugins, - _("Reload plugins"), - category=_("Debug"), - description=_("Attempt to reload plugins. Note: This tool itself is not reloaded!"), - ) diff --git a/gramps2/src/ReadGedcom.py b/gramps2/src/ReadGedcom.py index 62052d125..0826cd3fd 100644 --- a/gramps2/src/ReadGedcom.py +++ b/gramps2/src/ReadGedcom.py @@ -2014,5 +2014,5 @@ def create_id(): # # #------------------------------------------------------------------------- -from Plugins import register_import +from PluginMgr import register_import register_import(importData,_filter,_mime_type,1) diff --git a/gramps2/src/ReadXML.py b/gramps2/src/ReadXML.py index 5f62b8acb..239d3e757 100644 --- a/gramps2/src/ReadXML.py +++ b/gramps2/src/ReadXML.py @@ -1440,5 +1440,5 @@ _filter = gtk.FileFilter() _filter.set_name(_('GRAMPS XML databases')) _filter.add_pattern(_mime_type) -from Plugins import register_import +from PluginMgr import register_import register_import(importData,_filter,_mime_type,1) diff --git a/gramps2/src/WriteGedcom.py b/gramps2/src/WriteGedcom.py index 1aa42556d..899c3f747 100644 --- a/gramps2/src/WriteGedcom.py +++ b/gramps2/src/WriteGedcom.py @@ -1240,5 +1240,5 @@ _description = _('GEDCOM is used to transfer data between genealogy programs. ' _config = (_('GEDCOM export options'),GedcomWriterOptionBox) _filename = 'ged' -from Plugins import register_export +from PluginMgr import register_export register_export(exportData,_title,_description,_config,_filename) diff --git a/gramps2/src/WriteXML.py b/gramps2/src/WriteXML.py index 9ec8d84d7..a8065913d 100644 --- a/gramps2/src/WriteXML.py +++ b/gramps2/src/WriteXML.py @@ -899,5 +899,5 @@ _description = _('The GRAMPS XML database is a format used by older ' _config = None _filename = 'gramps' -from Plugins import register_export +from PluginMgr import register_export register_export(exportData,_title,_description,_config,_filename) diff --git a/gramps2/src/const.py.in b/gramps2/src/const.py.in index d81e45d54..85f320cf1 100644 --- a/gramps2/src/const.py.in +++ b/gramps2/src/const.py.in @@ -875,7 +875,6 @@ lds_ssealing = [ _("Submitted"), _("Uncleared"), ] -logical_functions = ['or', 'and', 'xor', 'one'] notes_formats = [ _("Flowed"), diff --git a/gramps2/src/docgen/AbiWord2Doc.py b/gramps2/src/docgen/AbiWord2Doc.py index 005613875..e2002237b 100644 --- a/gramps2/src/docgen/AbiWord2Doc.py +++ b/gramps2/src/docgen/AbiWord2Doc.py @@ -35,7 +35,7 @@ import os import BaseDoc import Errors -import Plugins +import PluginMgr import ImgManip import GrampsMime @@ -327,6 +327,6 @@ try: print_label=_("Open in %s") % prog[1] else: print_label=None - Plugins.register_text_doc(mtype,AbiWordDoc,1,1,1,".abw", print_label) + PluginMgr.register_text_doc(mtype,AbiWordDoc,1,1,1,".abw", print_label) except: - Plugins.register_text_doc(_('AbiWord document'),AbiWordDoc,1,1,1,".abw", None) + PluginMgr.register_text_doc(_('AbiWord document'),AbiWordDoc,1,1,1,".abw", None) diff --git a/gramps2/src/docgen/AsciiDoc.py b/gramps2/src/docgen/AsciiDoc.py index 6f6b54200..39adbe62d 100644 --- a/gramps2/src/docgen/AsciiDoc.py +++ b/gramps2/src/docgen/AsciiDoc.py @@ -35,7 +35,7 @@ import GrampsMime # #------------------------------------------------------------------------ import BaseDoc -import Plugins +import PluginMgr import Errors from gettext import gettext as _ @@ -367,7 +367,7 @@ try: else: print_label=None - Plugins.register_text_doc(mtype,AsciiDoc,1,1,1,".txt", print_label) + PluginMgr.register_text_doc(mtype,AsciiDoc,1,1,1,".txt", print_label) except: - Plugins.register_text_doc(_("Plain Text"),AsciiDoc,1,1,1,".txt", None) + PluginMgr.register_text_doc(_("Plain Text"),AsciiDoc,1,1,1,".txt", None) diff --git a/gramps2/src/docgen/HtmlDoc.py b/gramps2/src/docgen/HtmlDoc.py index 7ba526250..414070d9e 100644 --- a/gramps2/src/docgen/HtmlDoc.py +++ b/gramps2/src/docgen/HtmlDoc.py @@ -25,7 +25,7 @@ import string import re import time -import Plugins +import PluginMgr import ImgManip import TarFile import const @@ -486,6 +486,6 @@ try: print_label=_("Open in %s") % prog[1] else: print_label=None - Plugins.register_text_doc(mtype,HtmlDoc,1,0,1,".html", print_label) + PluginMgr.register_text_doc(mtype,HtmlDoc,1,0,1,".html", print_label) except: - Plugins.register_text_doc(_('HTML'),HtmlDoc,1,0,1,".html", None) + PluginMgr.register_text_doc(_('HTML'),HtmlDoc,1,0,1,".html", None) diff --git a/gramps2/src/docgen/KwordDoc.py b/gramps2/src/docgen/KwordDoc.py index 31248c6f3..cabf6cfc1 100644 --- a/gramps2/src/docgen/KwordDoc.py +++ b/gramps2/src/docgen/KwordDoc.py @@ -31,7 +31,7 @@ import os import Errors from TarFile import TarFile -import Plugins +import PluginMgr import ImgManip import GrampsMime @@ -495,7 +495,7 @@ try: print_label=_("Open in %s") % prog[1] else: print_label=None - Plugins.register_text_doc(mtype, KwordDoc, 1, 0, 1, ".kwd", print_label) + PluginMgr.register_text_doc(mtype, KwordDoc, 1, 0, 1, ".kwd", print_label) except: - Plugins.register_text_doc(_('KWord'), KwordDoc, 1, 0, 1, ".kwd", print_label) + PluginMgr.register_text_doc(_('KWord'), KwordDoc, 1, 0, 1, ".kwd", print_label) diff --git a/gramps2/src/docgen/LPRDoc.py b/gramps2/src/docgen/LPRDoc.py index c303f2575..0a682e8b4 100644 --- a/gramps2/src/docgen/LPRDoc.py +++ b/gramps2/src/docgen/LPRDoc.py @@ -61,7 +61,7 @@ else: # #------------------------------------------------------------------------ import BaseDoc -import Plugins +import PluginMgr #------------------------------------------------------------------------ # @@ -1161,7 +1161,7 @@ class LPRDoc(BaseDoc.BaseDoc): # Register the document generator with the system # #------------------------------------------------------------------------ -Plugins.register_text_doc( +PluginMgr.register_text_doc( name=_("Print..."), classref=LPRDoc, table=1, @@ -1172,7 +1172,7 @@ Plugins.register_text_doc( clname='print') -Plugins.register_book_doc( +PluginMgr.register_book_doc( _("Print..."), LPRDoc, 1, @@ -1181,7 +1181,7 @@ Plugins.register_book_doc( "", 'print') -Plugins.register_draw_doc( +PluginMgr.register_draw_doc( _("Print..."), LPRDoc, 1, diff --git a/gramps2/src/docgen/LaTeXDoc.py b/gramps2/src/docgen/LaTeXDoc.py index 93026c37f..96bd3e72a 100644 --- a/gramps2/src/docgen/LaTeXDoc.py +++ b/gramps2/src/docgen/LaTeXDoc.py @@ -40,7 +40,7 @@ import string # #------------------------------------------------------------------------ import BaseDoc -import Plugins +import PluginMgr import ImgManip import Errors @@ -425,7 +425,7 @@ class LaTeXDoc(BaseDoc.BaseDoc): # Register the document generator with the system # #------------------------------------------------------------------------ -Plugins.register_text_doc( +PluginMgr.register_text_doc( name=_("LaTeX"), classref=LaTeXDoc, table=1, diff --git a/gramps2/src/docgen/OpenOfficeDoc.py b/gramps2/src/docgen/OpenOfficeDoc.py index c95e84ee5..a3ca12545 100644 --- a/gramps2/src/docgen/OpenOfficeDoc.py +++ b/gramps2/src/docgen/OpenOfficeDoc.py @@ -41,7 +41,7 @@ from math import pi, cos, sin, fabs import Errors import BaseDoc import const -import Plugins +import PluginMgr import ImgManip import FontScale import GrampsMime @@ -975,10 +975,10 @@ try: else: print_label = None - Plugins.register_text_doc(mtype,OpenOfficeDoc,1,1,1,".sxw",print_label) - Plugins.register_book_doc(mtype,OpenOfficeDoc,1,1,1,".sxw") - Plugins.register_draw_doc(mtype,OpenOfficeDoc,1,1, ".sxw",print_label); + PluginMgr.register_text_doc(mtype,OpenOfficeDoc,1,1,1,".sxw",print_label) + PluginMgr.register_book_doc(mtype,OpenOfficeDoc,1,1,1,".sxw") + PluginMgr.register_draw_doc(mtype,OpenOfficeDoc,1,1, ".sxw",print_label); except: - Plugins.register_text_doc(_('OpenOffice.org Writer'), OpenOfficeDoc,1,1,1,".sxw", None) - Plugins.register_book_doc(_("OpenOffice.org Writer"), OpenOfficeDoc,1,1,1,".sxw") - Plugins.register_draw_doc(_("OpenOffice.org Writer"), OpenOfficeDoc,1,1,".sxx",None); + PluginMgr.register_text_doc(_('OpenOffice.org Writer'), OpenOfficeDoc,1,1,1,".sxw", None) + PluginMgr.register_book_doc(_("OpenOffice.org Writer"), OpenOfficeDoc,1,1,1,".sxw") + PluginMgr.register_draw_doc(_("OpenOffice.org Writer"), OpenOfficeDoc,1,1,".sxx",None); diff --git a/gramps2/src/docgen/PSDrawDoc.py b/gramps2/src/docgen/PSDrawDoc.py index fb6166cb8..bb978c9c3 100644 --- a/gramps2/src/docgen/PSDrawDoc.py +++ b/gramps2/src/docgen/PSDrawDoc.py @@ -31,7 +31,7 @@ from math import pi, cos, sin # Gramps modules # #------------------------------------------------------------------------- -import Plugins +import PluginMgr import Errors import BaseDoc from Report import run_print_dialog @@ -401,5 +401,5 @@ def rgb_color(color): b = float(color[2])/255.0 return (r,g,b) -Plugins.register_draw_doc(_("PostScript"),PSDrawDoc,1,1,".ps", +PluginMgr.register_draw_doc(_("PostScript"),PSDrawDoc,1,1,".ps", _("Print a copy")); diff --git a/gramps2/src/docgen/PdfDoc.py b/gramps2/src/docgen/PdfDoc.py index 3403f1f6d..bb66a0718 100644 --- a/gramps2/src/docgen/PdfDoc.py +++ b/gramps2/src/docgen/PdfDoc.py @@ -26,7 +26,7 @@ # #------------------------------------------------------------------------ import BaseDoc -import Plugins +import PluginMgr import Errors import ImgManip import GrampsMime @@ -589,10 +589,10 @@ try: print_label=_("Open in %s") % mprog[1] else: print_label=None - Plugins.register_text_doc(mtype, PdfDoc, 1, 0, 1, ".pdf", print_label) - Plugins.register_draw_doc(mtype, PdfDoc, 1, 1, ".pdf", print_label) - Plugins.register_book_doc(mtype,classref=PdfDoc,table=1,paper=1,style=1,ext=".pdf") + PluginMgr.register_text_doc(mtype, PdfDoc, 1, 0, 1, ".pdf", print_label) + PluginMgr.register_draw_doc(mtype, PdfDoc, 1, 1, ".pdf", print_label) + PluginMgr.register_book_doc(mtype,classref=PdfDoc,table=1,paper=1,style=1,ext=".pdf") except: - Plugins.register_text_doc(_('PDF document'), PdfDoc, 1, 0, 1,".pdf", None) - Plugins.register_draw_doc(_('PDF document'), PdfDoc, 1, 1, ".pdf", None) - Plugins.register_book_doc(name=_("PDF document"),classref=PdfDoc,table=1,paper=1,style=1,ext=".pdf") + PluginMgr.register_text_doc(_('PDF document'), PdfDoc, 1, 0, 1,".pdf", None) + PluginMgr.register_draw_doc(_('PDF document'), PdfDoc, 1, 1, ".pdf", None) + PluginMgr.register_book_doc(name=_("PDF document"),classref=PdfDoc,table=1,paper=1,style=1,ext=".pdf") diff --git a/gramps2/src/docgen/RTFDoc.py b/gramps2/src/docgen/RTFDoc.py index 54c277d8b..6c5db73a5 100644 --- a/gramps2/src/docgen/RTFDoc.py +++ b/gramps2/src/docgen/RTFDoc.py @@ -35,7 +35,7 @@ import GrampsMime # #------------------------------------------------------------------------ import BaseDoc -import Plugins +import PluginMgr import ImgManip import Errors @@ -429,6 +429,6 @@ try: print_label=_("Open in %s") % mprog[1] else: print_label=None - Plugins.register_text_doc(mtype, RTFDoc, 1, 0, 1, ".rtf", print_label) + PluginMgr.register_text_doc(mtype, RTFDoc, 1, 0, 1, ".rtf", print_label) except: - Plugins.register_text_doc(_('RTF document'), RTFDoc, 1, 0, 1, ".rtf", None) + PluginMgr.register_text_doc(_('RTF document'), RTFDoc, 1, 0, 1, ".rtf", None) diff --git a/gramps2/src/docgen/SvgDrawDoc.py b/gramps2/src/docgen/SvgDrawDoc.py index 5ae350897..83f0a0fa8 100644 --- a/gramps2/src/docgen/SvgDrawDoc.py +++ b/gramps2/src/docgen/SvgDrawDoc.py @@ -33,7 +33,7 @@ from math import pi, cos, sin, fabs # Gramps modules # #------------------------------------------------------------------------- -import Plugins +import PluginMgr from gettext import gettext as _ import BaseDoc import Errors @@ -258,4 +258,4 @@ def units(val): # Register document generator # #------------------------------------------------------------------------- -Plugins.register_draw_doc(_("SVG (Scalable Vector Graphics)"),SvgDrawDoc,1,1,".svg"); +PluginMgr.register_draw_doc(_("SVG (Scalable Vector Graphics)"),SvgDrawDoc,1,1,".svg"); diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 06600643f..7902d526d 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -19539,7 +19539,7 @@ GNOME Settings False 1 0.5 - 5 + 0 0 @@ -19563,7 +19563,7 @@ GNOME Settings False 1 0.5 - 5 + 0 0 diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 50d96deb1..252c33fb9 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -63,6 +63,7 @@ import GenericFilter import DisplayTrace import const import Plugins +import PluginMgr import Utils import Bookmarks import GrampsGconfKeys @@ -140,7 +141,7 @@ class Gramps: "contain bugs which could corrupt your database.")) GrampsGconfKeys.save_betawarn(1) - self.RelClass = Plugins.relationship_class + self.RelClass = PluginMgr.relationship_class self.relationship = self.RelClass(self.db) self.gtop = gtk.glade.XML(const.gladeFile, "gramps", "gramps") self.init_interface() @@ -820,15 +821,15 @@ class Gramps: self.report_menu.set_sensitive(0) self.tools_menu.set_sensitive(0) - Plugins.load_plugins(const.docgenDir) - Plugins.load_plugins(os.path.expanduser("~/.gramps/docgen")) - Plugins.load_plugins(const.pluginsDir) - Plugins.load_plugins(os.path.expanduser("~/.gramps/plugins")) + PluginMgr.load_plugins(const.docgenDir) + PluginMgr.load_plugins(os.path.expanduser("~/.gramps/docgen")) + PluginMgr.load_plugins(const.pluginsDir) + PluginMgr.load_plugins(os.path.expanduser("~/.gramps/plugins")) Plugins.build_report_menu(self.report_menu,self.menu_report) Plugins.build_tools_menu(self.tools_menu,self.menu_tools) - self.RelClass = Plugins.relationship_class + self.RelClass = PluginMgr.relationship_class self.relationship = self.RelClass(self.db) def init_filters(self): diff --git a/gramps2/src/plugins/AncestorChart.py b/gramps2/src/plugins/AncestorChart.py index 47809e6cb..1c4987fcb 100644 --- a/gramps2/src/plugins/AncestorChart.py +++ b/gramps2/src/plugins/AncestorChart.py @@ -264,7 +264,7 @@ class AncestorChartOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'ancestor_chart', category = const.CATEGORY_DRAW, diff --git a/gramps2/src/plugins/AncestorChart2.py b/gramps2/src/plugins/AncestorChart2.py index bc519eb7a..048d566e6 100644 --- a/gramps2/src/plugins/AncestorChart2.py +++ b/gramps2/src/plugins/AncestorChart2.py @@ -515,7 +515,7 @@ class AncestorChartOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'ancestor_chart2', category = const.CATEGORY_DRAW, diff --git a/gramps2/src/plugins/AncestorReport.py b/gramps2/src/plugins/AncestorReport.py index e0d8feedd..64874c67a 100644 --- a/gramps2/src/plugins/AncestorReport.py +++ b/gramps2/src/plugins/AncestorReport.py @@ -295,7 +295,7 @@ class AncestorOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'ancestor_report', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/Ancestors.py b/gramps2/src/plugins/Ancestors.py index 5517de67a..ab6775373 100644 --- a/gramps2/src/plugins/Ancestors.py +++ b/gramps2/src/plugins/Ancestors.py @@ -44,7 +44,7 @@ import const import Report import BaseDoc import RelLib -import Plugins +import PluginMgr import ReportOptions from DateHandler import displayer as _dd @@ -83,7 +83,7 @@ class ComprehensiveAncestorsReport (Report.Report): self.sources = [] self.sourcerefs = [] - self.RelClass = Plugins.relationship_class + self.RelClass = PluginMgr.relationship_class self.relationship = self.RelClass(database) table = BaseDoc.TableStyle () @@ -988,7 +988,7 @@ class ComprehensiveAncestorsOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -Plugins.register_report( +PluginMgr.register_report( name = 'ancestors_report', category = const.CATEGORY_TEXT, report_class = ComprehensiveAncestorsReport, diff --git a/gramps2/src/plugins/BookReport.py b/gramps2/src/plugins/BookReport.py index b50c9b90e..60d450893 100644 --- a/gramps2/src/plugins/BookReport.py +++ b/gramps2/src/plugins/BookReport.py @@ -58,7 +58,7 @@ from RelLib import Person import const import Utils import ListModel -import Plugins +import PluginMgr import Report import BaseDoc from QuestionDialog import WarningDialog @@ -110,7 +110,7 @@ class BookItem: """ self.clear() - for item in Plugins._bkitems: + for item in PluginMgr.bkitems_list: if item[0] == name: self.name = item[0] self.category = item[1] @@ -642,10 +642,10 @@ class BookReportSelector: The selections are read from the book item registry. """ - if not Plugins._bkitems: + if not PluginMgr.bkitems_list: return - for book_item in Plugins._bkitems: + for book_item in PluginMgr.bkitems_list: data = [ book_item[0], book_item[1] ] new_iter = self.av_model.add(data) @@ -1097,7 +1097,7 @@ def cl_report(database,name,category,options_str_dict): # # #------------------------------------------------------------------------ -Plugins.register_report( +PluginMgr.register_report( name = 'book', category = const.CATEGORY_BOOK, report_class = BookReportSelector, diff --git a/gramps2/src/plugins/ChangeNames.py b/gramps2/src/plugins/ChangeNames.py index a5ee16127..013f8e140 100644 --- a/gramps2/src/plugins/ChangeNames.py +++ b/gramps2/src/plugins/ChangeNames.py @@ -182,7 +182,7 @@ class ChangeNames: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/ChangeTypes.py b/gramps2/src/plugins/ChangeTypes.py index b31e56378..4d84cda3a 100644 --- a/gramps2/src/plugins/ChangeTypes.py +++ b/gramps2/src/plugins/ChangeTypes.py @@ -104,7 +104,7 @@ class ChangeTypes: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/Check.py b/gramps2/src/plugins/Check.py index c68572495..d45ad5c30 100644 --- a/gramps2/src/plugins/Check.py +++ b/gramps2/src/plugins/Check.py @@ -406,7 +406,7 @@ class CheckIntegrity: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/CountAncestors.py b/gramps2/src/plugins/CountAncestors.py index 579102967..aeb69f1b9 100644 --- a/gramps2/src/plugins/CountAncestors.py +++ b/gramps2/src/plugins/CountAncestors.py @@ -111,7 +111,7 @@ class CountAncestors: # # #------------------------------------------------------------------------- -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'count_ancestors', category = const.CATEGORY_VIEW, diff --git a/gramps2/src/plugins/CustomBookText.py b/gramps2/src/plugins/CustomBookText.py index 5d89ceb9b..fcb130465 100644 --- a/gramps2/src/plugins/CustomBookText.py +++ b/gramps2/src/plugins/CustomBookText.py @@ -280,7 +280,7 @@ def write_book_item(database,person,doc,options,newpage=0): # # #------------------------------------------------------------------------ -from Plugins import register_book_item +from PluginMgr import register_book_item # (name,category,options_dialog,write_book_item,options,style_name,style_file,make_default_style) register_book_item( diff --git a/gramps2/src/plugins/DesGraph.py b/gramps2/src/plugins/DesGraph.py index c9caabbc4..48a700a5c 100644 --- a/gramps2/src/plugins/DesGraph.py +++ b/gramps2/src/plugins/DesGraph.py @@ -338,7 +338,7 @@ class DescendantGraphOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'descendant_graph', category = const.CATEGORY_DRAW, diff --git a/gramps2/src/plugins/Desbrowser.py b/gramps2/src/plugins/Desbrowser.py index 4cc7e08ea..2f560ff33 100644 --- a/gramps2/src/plugins/Desbrowser.py +++ b/gramps2/src/plugins/Desbrowser.py @@ -143,7 +143,7 @@ class DesBrowse: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/DescendReport.py b/gramps2/src/plugins/DescendReport.py index ae6885650..61775cc2f 100644 --- a/gramps2/src/plugins/DescendReport.py +++ b/gramps2/src/plugins/DescendReport.py @@ -187,7 +187,7 @@ class DescendantOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'descend_report', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/DetAncestralReport.py b/gramps2/src/plugins/DetAncestralReport.py index 5c1684f35..c7bf987e4 100644 --- a/gramps2/src/plugins/DetAncestralReport.py +++ b/gramps2/src/plugins/DetAncestralReport.py @@ -964,7 +964,7 @@ class DetAncestorOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'det_ancestor_report', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/DetDescendantReport.py b/gramps2/src/plugins/DetDescendantReport.py index 342a79ac3..4db2672ca 100644 --- a/gramps2/src/plugins/DetDescendantReport.py +++ b/gramps2/src/plugins/DetDescendantReport.py @@ -977,7 +977,7 @@ class DetDescendantOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'det_descendant_report', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/Eval.py b/gramps2/src/plugins/Eval.py index d900439cb..e66a2e3a6 100644 --- a/gramps2/src/plugins/Eval.py +++ b/gramps2/src/plugins/Eval.py @@ -106,7 +106,7 @@ class EvalWindow: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool def runtool(database,person,callback,parent): EvalWindow(parent) diff --git a/gramps2/src/plugins/EventCmp.py b/gramps2/src/plugins/EventCmp.py index 7f3728cc4..965b9c4e1 100644 --- a/gramps2/src/plugins/EventCmp.py +++ b/gramps2/src/plugins/EventCmp.py @@ -441,7 +441,7 @@ class DisplayChart: # # #------------------------------------------------------------------------- -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/FamilyGroup.py b/gramps2/src/plugins/FamilyGroup.py index f61467c7d..7b72c9ca1 100644 --- a/gramps2/src/plugins/FamilyGroup.py +++ b/gramps2/src/plugins/FamilyGroup.py @@ -537,7 +537,7 @@ class FamilyGroupOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'family_group', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/FanChart.py b/gramps2/src/plugins/FanChart.py index 5fcde4beb..ba37c08d4 100644 --- a/gramps2/src/plugins/FanChart.py +++ b/gramps2/src/plugins/FanChart.py @@ -317,7 +317,7 @@ class FanChartOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'fan_chart', category = const.CATEGORY_DRAW, diff --git a/gramps2/src/plugins/FilterEditor.py b/gramps2/src/plugins/FilterEditor.py index 937c54368..7e45b9417 100644 --- a/gramps2/src/plugins/FilterEditor.py +++ b/gramps2/src/plugins/FilterEditor.py @@ -842,7 +842,7 @@ def SystemFilterEditor(database,person,callback,parent=None): # # #------------------------------------------------------------------------- -from Plugins import register_tool +from PluginMgr import register_tool register_tool( CustomFilterEditor, diff --git a/gramps2/src/plugins/FtmStyleAncestors.py b/gramps2/src/plugins/FtmStyleAncestors.py index da2e62f28..c5c514e7e 100644 --- a/gramps2/src/plugins/FtmStyleAncestors.py +++ b/gramps2/src/plugins/FtmStyleAncestors.py @@ -1100,7 +1100,7 @@ class FtmAncestorOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'ftm_ancestor_report', diff --git a/gramps2/src/plugins/FtmStyleDescendants.py b/gramps2/src/plugins/FtmStyleDescendants.py index b27eedd4a..3c53b216c 100644 --- a/gramps2/src/plugins/FtmStyleDescendants.py +++ b/gramps2/src/plugins/FtmStyleDescendants.py @@ -1529,7 +1529,7 @@ class FtmDescendantOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report register_report( name = 'ftm_descendant_report', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/GraphViz.py b/gramps2/src/plugins/GraphViz.py index ad48697b8..19ef0bffe 100644 --- a/gramps2/src/plugins/GraphViz.py +++ b/gramps2/src/plugins/GraphViz.py @@ -541,7 +541,7 @@ def get_description(): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report import sys ver = sys.version_info diff --git a/gramps2/src/plugins/ImportGeneWeb.py b/gramps2/src/plugins/ImportGeneWeb.py index 24f98c6df..e4497c01b 100644 --- a/gramps2/src/plugins/ImportGeneWeb.py +++ b/gramps2/src/plugins/ImportGeneWeb.py @@ -685,5 +685,6 @@ _filter = gtk.FileFilter() _filter.set_name(_('GeneWeb files')) _filter.add_mime_type(_mime_type) -from Plugins import register_import +from PluginMgr import register_import + register_import(importData,_filter,_mime_type,1) diff --git a/gramps2/src/plugins/IndivComplete.py b/gramps2/src/plugins/IndivComplete.py index c86f828f0..5b1dfeb25 100644 --- a/gramps2/src/plugins/IndivComplete.py +++ b/gramps2/src/plugins/IndivComplete.py @@ -590,7 +590,8 @@ class IndivCompleteOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report + register_report( name = 'indiv_complete', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/IndivSummary.py b/gramps2/src/plugins/IndivSummary.py index bbd76d36a..df796d831 100644 --- a/gramps2/src/plugins/IndivSummary.py +++ b/gramps2/src/plugins/IndivSummary.py @@ -384,7 +384,8 @@ class IndivSummaryOptions(ReportOptions.ReportOptions): # Register plugins # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report + register_report( name = 'individual_summary', category = const.CATEGORY_TEXT, diff --git a/gramps2/src/plugins/Leak.py b/gramps2/src/plugins/Leak.py index 70f772030..39ef127be 100644 --- a/gramps2/src/plugins/Leak.py +++ b/gramps2/src/plugins/Leak.py @@ -95,7 +95,7 @@ class Leak: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool def runtool(database,person,callback,parent=None): Leak(parent) diff --git a/gramps2/src/plugins/Merge.py b/gramps2/src/plugins/Merge.py index f887a6a5f..d5bf86de1 100644 --- a/gramps2/src/plugins/Merge.py +++ b/gramps2/src/plugins/Merge.py @@ -650,7 +650,7 @@ def by_id(p1,p2): # # #------------------------------------------------------------------------- -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/Partition.py b/gramps2/src/plugins/Partition.py index 27cda705d..dda7fde99 100644 --- a/gramps2/src/plugins/Partition.py +++ b/gramps2/src/plugins/Partition.py @@ -220,7 +220,7 @@ def report(db, person): # # #------------------------------------------------------------------------- -from Plugins import register_report +from PluginMgr import register_report register_report( report, diff --git a/gramps2/src/plugins/PatchNames.py b/gramps2/src/plugins/PatchNames.py index fad423e14..ce0558397 100644 --- a/gramps2/src/plugins/PatchNames.py +++ b/gramps2/src/plugins/PatchNames.py @@ -299,7 +299,7 @@ class PatchNames: # # #------------------------------------------------------------------------ -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/ReadNative.py b/gramps2/src/plugins/ReadNative.py index 2e0ec691f..4705cb3d3 100644 --- a/gramps2/src/plugins/ReadNative.py +++ b/gramps2/src/plugins/ReadNative.py @@ -104,6 +104,6 @@ class ReadNative: # Register with the plugin system # #------------------------------------------------------------------------ -from Plugins import register_import +from PluginMgr import register_import register_import(readData,_title_string) diff --git a/gramps2/src/plugins/ReadPkg.py b/gramps2/src/plugins/ReadPkg.py index 2d483d592..37abbc52c 100644 --- a/gramps2/src/plugins/ReadPkg.py +++ b/gramps2/src/plugins/ReadPkg.py @@ -187,5 +187,6 @@ _filter = gtk.FileFilter() _filter.set_name(_('GRAMPS packages')) _filter.add_mime_type(_mime_type) -from Plugins import register_import +from PluginMgr import register_import + register_import(impData,_filter,_mime_type) diff --git a/gramps2/src/plugins/RelCalc.py b/gramps2/src/plugins/RelCalc.py index 7284056be..76e1d4dbb 100644 --- a/gramps2/src/plugins/RelCalc.py +++ b/gramps2/src/plugins/RelCalc.py @@ -46,7 +46,7 @@ import RelLib import Utils import NameDisplay import ListModel -import Plugins +import PluginMgr from gettext import gettext as _ #------------------------------------------------------------------------- @@ -70,7 +70,7 @@ class RelCalc: def __init__(self,database,person,parent): self.person = person self.db = database - self.RelClass = Plugins.relationship_class + self.RelClass = PluginMgr.relationship_class self.relationship = self.RelClass(database) self.parent = parent self.win_key = self @@ -200,7 +200,7 @@ class RelCalc: # #------------------------------------------------------------------------- -Plugins.register_tool( +PluginMgr.register_tool( runTool, _("Relationship calculator"), category=_("Utilities"), diff --git a/gramps2/src/plugins/ReorderIds.py b/gramps2/src/plugins/ReorderIds.py index 602324a89..5a4369aa3 100644 --- a/gramps2/src/plugins/ReorderIds.py +++ b/gramps2/src/plugins/ReorderIds.py @@ -122,7 +122,7 @@ class ReorderIds: # # #------------------------------------------------------------------------- -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/SimpleBookTitle.py b/gramps2/src/plugins/SimpleBookTitle.py index b4413ee61..11144d16f 100644 --- a/gramps2/src/plugins/SimpleBookTitle.py +++ b/gramps2/src/plugins/SimpleBookTitle.py @@ -466,7 +466,7 @@ def write_book_item(database,person,doc,options,newpage=0): # # #------------------------------------------------------------------------ -from Plugins import register_book_item +from PluginMgr import register_book_item # (name,category,options_dialog,write_book_item,options,style_name,style_file,make_default_style) register_book_item( diff --git a/gramps2/src/plugins/SoundGen.py b/gramps2/src/plugins/SoundGen.py index 944d59b5a..38909e646 100644 --- a/gramps2/src/plugins/SoundGen.py +++ b/gramps2/src/plugins/SoundGen.py @@ -126,7 +126,7 @@ class SoundGen: # # #------------------------------------------------------------------------- -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/Summary.py b/gramps2/src/plugins/Summary.py index 0f9b0b87e..3e160b819 100644 --- a/gramps2/src/plugins/Summary.py +++ b/gramps2/src/plugins/Summary.py @@ -166,7 +166,8 @@ class SummaryReport: # # #------------------------------------------------------------------------- -from Plugins import register_report +from PluginMgr import register_report + register_report( name = 'summary', category = const.CATEGORY_VIEW, diff --git a/gramps2/src/plugins/TimeLine.py b/gramps2/src/plugins/TimeLine.py index 2fe90775f..f2c9ba0f8 100644 --- a/gramps2/src/plugins/TimeLine.py +++ b/gramps2/src/plugins/TimeLine.py @@ -469,7 +469,8 @@ class TimeLineOptions(ReportOptions.ReportOptions): # # #------------------------------------------------------------------------ -from Plugins import register_report +from PluginMgr import register_report + register_report( name = 'timeline', category = const.CATEGORY_DRAW, diff --git a/gramps2/src/plugins/Verify.py b/gramps2/src/plugins/Verify.py index 979d17588..6ed55b483 100644 --- a/gramps2/src/plugins/Verify.py +++ b/gramps2/src/plugins/Verify.py @@ -508,7 +508,7 @@ class Verify: # # #------------------------------------------------------------------------- -from Plugins import register_tool +from PluginMgr import register_tool register_tool( runTool, diff --git a/gramps2/src/plugins/WebPage.py b/gramps2/src/plugins/WebPage.py index 180326bda..a03e4df8b 100644 --- a/gramps2/src/plugins/WebPage.py +++ b/gramps2/src/plugins/WebPage.py @@ -72,8 +72,6 @@ _month = [ _hline = " " # Everything is underlined, so use blank _BORN = _('b.') -_dd = DateHandler.create_display() - #------------------------------------------------------------------------ # # HtmlLinkDoc @@ -235,7 +233,7 @@ class IndividualPage: self.write_info(base.get_title()) self.write_info(base.get_author()) self.write_info(base.get_publication_info()) - self.write_info(_dd.display(sref.get_date())) + self.write_info(DateHander.displayer.display(sref.get_date())) self.write_info(sref.get_page()) if self.usecomments: self.write_info(sref.get_text()) @@ -799,7 +797,7 @@ class WebReport(Report.Report): else: continue if e: - f.write("%s|" % _dd.display(e.get_date_object())) + f.write("%s|" % DateHander.displayer.display(e.get_date_object())) if e.get_place_handle(): f.write('%s|' % self.db.get_place_from_handle(e.get_place_handle()).get_title()) else: @@ -1744,7 +1742,7 @@ def report(database,person): # # #------------------------------------------------------------------------- -from Plugins import register_report +from PluginMgr import register_report register_report( report, diff --git a/gramps2/src/plugins/WriteCD.py b/gramps2/src/plugins/WriteCD.py index 7de3490c9..592bfd50f 100644 --- a/gramps2/src/plugins/WriteCD.py +++ b/gramps2/src/plugins/WriteCD.py @@ -311,6 +311,6 @@ class PackageWriter: # Register the plugin # #------------------------------------------------------------------------- -from Plugins import register_export +from PluginMgr import register_export register_export(writeData,_title_string) diff --git a/gramps2/src/plugins/WriteFtree.py b/gramps2/src/plugins/WriteFtree.py index 446d140e3..8dca9e93d 100644 --- a/gramps2/src/plugins/WriteFtree.py +++ b/gramps2/src/plugins/WriteFtree.py @@ -266,6 +266,6 @@ def get_name(name,count): # Register the plugin # #------------------------------------------------------------------------- -from Plugins import register_export +from PluginMgr import register_export register_export(writeData,_title_string) diff --git a/gramps2/src/plugins/WriteGeneWeb.py b/gramps2/src/plugins/WriteGeneWeb.py index 2637f3ed1..350466224 100644 --- a/gramps2/src/plugins/WriteGeneWeb.py +++ b/gramps2/src/plugins/WriteGeneWeb.py @@ -582,5 +582,6 @@ _description = _('GeneWeb is a web based genealogy program.') _config = (_('GeneWeb export options'),GeneWebWriterOptionBox) _filename = 'gw' -from Plugins import register_export +from PluginMgr import register_export + register_export(exportData,_title,_description,_config,_filename) diff --git a/gramps2/src/plugins/WritePkg.py b/gramps2/src/plugins/WritePkg.py index 935c65d68..4cdde14de 100644 --- a/gramps2/src/plugins/WritePkg.py +++ b/gramps2/src/plugins/WritePkg.py @@ -202,5 +202,6 @@ _filter.set_name(_('GRAMPS packages')) _filter.add_mime_type(_mime_type) _ext_list = ('.gpkg',) -from Plugins import register_export +from PluginMgr import register_export + register_export(writeData,_filter,_ext_list) diff --git a/gramps2/src/plugins/rel_da.py b/gramps2/src/plugins/rel_da.py index 3b609e6e4..7fb8463f2 100644 --- a/gramps2/src/plugins/rel_da.py +++ b/gramps2/src/plugins/rel_da.py @@ -177,8 +177,9 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, - ["da","DA","da_DK","danish","Danish","da_DK.UTF8","da_DK@euro","da_DK.UTF8@euro", - "dansk","Dansk", "da_DK.UTF-8", "da_DK.utf-8", "da_DK.utf8"]) + [ "da", "DA", "da_DK", "danish", "Danish", "da_DK.UTF8", + "da_DK@euro", "da_DK.UTF8@euro", "dansk", "Dansk", + "da_DK.UTF-8", "da_DK.utf-8", "da_DK.utf8"]) diff --git a/gramps2/src/plugins/rel_de.py b/gramps2/src/plugins/rel_de.py index e4634217d..7996d8dec 100644 --- a/gramps2/src/plugins/rel_de.py +++ b/gramps2/src/plugins/rel_de.py @@ -391,7 +391,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["de","DE","de_DE","deutsch","Deutsch","de_DE.UTF8","de_DE@euro","de_DE.UTF8@euro", diff --git a/gramps2/src/plugins/rel_es.py b/gramps2/src/plugins/rel_es.py index 166c94f86..fd64611ab 100644 --- a/gramps2/src/plugins/rel_es.py +++ b/gramps2/src/plugins/rel_es.py @@ -316,7 +316,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this function with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["es","ES","es_ES","espanol","Espanol","es_ES.UTF8","es_ES@euro","es_ES.UTF8@euro", diff --git a/gramps2/src/plugins/rel_fi.py b/gramps2/src/plugins/rel_fi.py index 0061d5bf6..9757a0004 100644 --- a/gramps2/src/plugins/rel_fi.py +++ b/gramps2/src/plugins/rel_fi.py @@ -216,7 +216,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["fi","FI","fi_FI","finnish","Finnish","fi_FI.UTF8","fi_FI@euro","fi_FI.UTF8@euro", diff --git a/gramps2/src/plugins/rel_fr.py b/gramps2/src/plugins/rel_fr.py index 446064c69..8cde49a2a 100644 --- a/gramps2/src/plugins/rel_fr.py +++ b/gramps2/src/plugins/rel_fr.py @@ -218,7 +218,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["fr","FR","fr_FR","francais","Francais","fr_FR.UTF8","fr_FR@euro","fr_FR.UTF8@euro", diff --git a/gramps2/src/plugins/rel_hu.py b/gramps2/src/plugins/rel_hu.py index 832c4eb92..1b58a032e 100644 --- a/gramps2/src/plugins/rel_hu.py +++ b/gramps2/src/plugins/rel_hu.py @@ -33,7 +33,7 @@ import RelLib import Date import Relationship -from Plugins import register_relcalc +from PluginMgr import register_relcalc import types from gettext import gettext as _ diff --git a/gramps2/src/plugins/rel_it.py b/gramps2/src/plugins/rel_it.py index fcbe129a4..894c23b7f 100644 --- a/gramps2/src/plugins/rel_it.py +++ b/gramps2/src/plugins/rel_it.py @@ -200,7 +200,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Function registration # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["it", "IT", "it_IT", "it_IT@euro", "it_IT.utf8"]) diff --git a/gramps2/src/plugins/rel_no.py b/gramps2/src/plugins/rel_no.py index d23073c90..748a38040 100644 --- a/gramps2/src/plugins/rel_no.py +++ b/gramps2/src/plugins/rel_no.py @@ -273,7 +273,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["nb","nn","no", "nb_NO","nn_NO","no_NO","nb_NO.UTF8","nn_NO.UTF8","no_NO.UTF8", diff --git a/gramps2/src/plugins/rel_ru.py b/gramps2/src/plugins/rel_ru.py index 9158e0cef..28be9619d 100644 --- a/gramps2/src/plugins/rel_ru.py +++ b/gramps2/src/plugins/rel_ru.py @@ -260,7 +260,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["ru","RU","ru_RU","koi8r","ru_koi8r","russian","Russian","ru_RU.koi8r","ru_RU.KOI8-R","ru_RU.utf8","ru_RU.UTF8", "ru_RU.utf-8","ru_RU.UTF-8","ru_RU.iso88595","ru_RU.iso8859-5","ru_RU.iso-8859-5"]) diff --git a/gramps2/src/plugins/rel_sv.py b/gramps2/src/plugins/rel_sv.py index 26764ed1b..6a7fbfdf4 100644 --- a/gramps2/src/plugins/rel_sv.py +++ b/gramps2/src/plugins/rel_sv.py @@ -224,7 +224,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # Register this class with the Plugins system # #------------------------------------------------------------------------- -from Plugins import register_relcalc +from PluginMgr import register_relcalc register_relcalc(RelationshipCalculator, ["sv","SV","sv_SE","swedish","Swedish","sv_SE.UTF8","sv_SE@euro","sv_SE.UTF8@euro",