diff --git a/gramps/gen/db/__init__.py b/gramps/gen/db/__init__.py index 066571e38..10f751303 100644 --- a/gramps/gen/db/__init__.py +++ b/gramps/gen/db/__init__.py @@ -88,3 +88,24 @@ from .base import * from .dbconst import * from .txn import * from .exceptions import * + +def find_surname_name(key, data): + """ + Creating a surname from raw name, to use for sort and index + returns a byte string + """ + return __index_surname(data[5]) + +def __index_surname(surn_list): + """ + All non pa/matronymic surnames are used in indexing. + pa/matronymic not as they change for every generation! + returns a byte string + """ + from gramps.gen.lib import NameOriginType + if surn_list: + surn = " ".join([x[0] for x in surn_list if not (x[3][0] in [ + NameOriginType.PATRONYMIC, NameOriginType.MATRONYMIC]) ]) + else: + surn = "" + return surn diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index a296f0122..a595eb803 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -1591,6 +1591,11 @@ def run_plugin(pdata, dbstate, uistate): mod = pmgr.load_plugin(pdata) if not mod: #import of plugin failed + failed = pmgr.get_fail_list() + if failed: + error_msg = failed[-1][1][1] + else: + error_msg = "(no error message)" ErrorDialog( _('Failed Loading Plugin'), _('The plugin %(name)s did not load and reported an error.\n\n' @@ -1605,7 +1610,7 @@ def run_plugin(pdata, dbstate, uistate): 'gramps_bugtracker_url' : URL_BUGHOME, 'firstauthoremail': pdata.authors_email[0] if pdata.authors_email else '...', - 'error_msg': pmgr.get_fail_list()[-1][1][1]}) + 'error_msg': error_msg}) return if pdata.ptype == REPORT: