Added missing function; allow failed plugin message to show
This commit is contained in:
parent
4805c3c7f0
commit
8a15aaffb7
@ -88,3 +88,24 @@ from .base import *
|
|||||||
from .dbconst import *
|
from .dbconst import *
|
||||||
from .txn import *
|
from .txn import *
|
||||||
from .exceptions 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
|
||||||
|
@ -1593,6 +1593,11 @@ def run_plugin(pdata, dbstate, uistate):
|
|||||||
mod = pmgr.load_plugin(pdata)
|
mod = pmgr.load_plugin(pdata)
|
||||||
if not mod:
|
if not mod:
|
||||||
#import of plugin failed
|
#import of plugin failed
|
||||||
|
failed = pmgr.get_fail_list()
|
||||||
|
if failed:
|
||||||
|
error_msg = failed[-1][1][1]
|
||||||
|
else:
|
||||||
|
error_msg = "(no error message)"
|
||||||
ErrorDialog(
|
ErrorDialog(
|
||||||
_('Failed Loading Plugin'),
|
_('Failed Loading Plugin'),
|
||||||
_('The plugin %(name)s did not load and reported an error.\n\n'
|
_('The plugin %(name)s did not load and reported an error.\n\n'
|
||||||
@ -1607,7 +1612,7 @@ def run_plugin(pdata, dbstate, uistate):
|
|||||||
'gramps_bugtracker_url' : URL_BUGHOME,
|
'gramps_bugtracker_url' : URL_BUGHOME,
|
||||||
'firstauthoremail': pdata.authors_email[0] if
|
'firstauthoremail': pdata.authors_email[0] if
|
||||||
pdata.authors_email else '...',
|
pdata.authors_email else '...',
|
||||||
'error_msg': pmgr.get_fail_list()[-1][1][1]})
|
'error_msg': error_msg})
|
||||||
return
|
return
|
||||||
|
|
||||||
if pdata.ptype == REPORT:
|
if pdata.ptype == REPORT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user