From 473d3aab48841a4516ca861553e13efcc364e02a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 1 Nov 2016 17:57:29 +0000 Subject: [PATCH] Remove unused method Also removes an import from outside the gen module. --- gramps/gen/dbstate.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/gramps/gen/dbstate.py b/gramps/gen/dbstate.py index 3ba011cae..fbf60f77b 100644 --- a/gramps/gen/dbstate.py +++ b/gramps/gen/dbstate.py @@ -257,36 +257,3 @@ class DbState(Callback): pass return (dirpath, locked, locked_by, backend) return None - - def import_from_filename(self, db, filename, user=None): - """ - Import the filename into the db. - """ - from .plug import BasePluginManager - from .const import PLUGINS_DIR, USER_PLUGINS - from gramps.cli.user import User - pmgr = BasePluginManager.get_instance() - if user is None: - user = User() - (name, ext) = os.path.splitext(os.path.basename(filename)) - extension = ext[1:].lower() - import_list = pmgr.get_reg_importers() - if import_list == []: - # This might happen if using gramps from outside, and - # we haven't loaded plugins yet - pmgr.reg_plugins(PLUGINS_DIR, self, None) - pmgr.reg_plugins(USER_PLUGINS, self, None, load_on_reg=True) - import_list = pmgr.get_reg_importers() - for pdata in import_list: - if extension == pdata.extension: - mod = pmgr.load_plugin(pdata) - if not mod: - for item in pmgr.get_fail_list(): - name, error_tuple, pdata = item - etype, exception, traceback = error_tuple - print("ERROR:", name, exception) - return False - import_function = getattr(mod, pdata.import_function) - results = import_function(db, filename, user) - return True - return False