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

Improvements: gen.plug only depends on gen, relationship default is moved
to Relationship.py, and config for hidden to a gui.pluginmanager


svn: r13405
This commit is contained in:
Benny Malengier
2009-10-25 13:52:29 +00:00
parent c10da3fec5
commit d25cdc3958
28 changed files with 161 additions and 181 deletions

View File

@@ -48,7 +48,7 @@ import gen
from clidbman import CLIDbManager, NAME_FILE, find_locker_name
from PluginUtils import Tool
from gen.plug import PluginManager
from gen.plug import BasePluginManager
from ReportBase import CATEGORY_BOOK, CATEGORY_CODE, cl_report
#-------------------------------------------------------------------------
@@ -146,7 +146,7 @@ class ArgHandler(object):
# or an empty string.
family_tree_format = os.path.splitext(fname)[-1][1:].lower()
pmgr = PluginManager.get_instance()
pmgr = BasePluginManager.get_instance()
plugin_found = False
for plugin in pmgr.get_import_plugins():
if family_tree_format == plugin.get_extension():
@@ -189,7 +189,7 @@ class ArgHandler(object):
# or an empty string.
family_tree_format = os.path.splitext(fname)[-1][1:].lower()
pmgr = PluginManager.get_instance()
pmgr = BasePluginManager.get_instance()
plugin_found = False
for plugin in pmgr.get_export_plugins():
if family_tree_format == plugin.get_extension():
@@ -403,7 +403,7 @@ class ArgHandler(object):
"""
Command-line import routine. Try to import filename using the family_tree_format.
"""
pmgr = PluginManager.get_instance()
pmgr = BasePluginManager.get_instance()
for plugin in pmgr.get_import_plugins():
if family_tree_format == plugin.get_extension():
import_function = plugin.get_import_function()
@@ -425,7 +425,7 @@ class ArgHandler(object):
Command-line export routine.
Try to write into filename using the family_tree_format.
"""
pmgr = PluginManager.get_instance()
pmgr = BasePluginManager.get_instance()
for plugin in pmgr.get_export_plugins():
if family_tree_format == plugin.get_extension():
export_function = plugin.get_export_function()
@@ -440,7 +440,7 @@ class ArgHandler(object):
"""
Command-line action routine. Try to perform specified action.
"""
pmgr = PluginManager.get_instance()
pmgr = BasePluginManager.get_instance()
if action == "report":
try:
options_str_dict = dict( [ tuple(chunk.split('='))

View File

@@ -49,7 +49,7 @@ LOG = logging.getLogger(".clidbman")
#
#-------------------------------------------------------------------------
import gen.db
from gen.plug import PluginManager
from gen.plug import BasePluginManager
import config
#-------------------------------------------------------------------------
@@ -258,7 +258,7 @@ class CLIDbManager(object):
@return: A tuple of (new_path, name) for the new database
or (None, None) if no import was performed.
"""
pmgr = PluginManager.get_instance()
pmgr = BasePluginManager.get_instance()
(name, ext) = os.path.splitext(os.path.basename(filename))
format = ext[1:].lower()

View File

@@ -52,7 +52,7 @@ import Errors
import DbState
from gen.db import (GrampsDBDir, FileVersionDeclineToUpgrade)
import gen.db.exceptions
from gen.plug import PluginManager
from gen.plug import BasePluginManager
from Utils import get_researcher
import RecentFiles
@@ -184,7 +184,7 @@ class CLIManager(object):
else:
self.db_loader = None
self.file_loaded = False
self._pmgr = PluginManager.get_instance()
self._pmgr = BasePluginManager.get_instance()
def open_activate(self, path):
"""