Im trying create some imports. They are registered successfully. But the problem is that always executes the first found xslx import. In current case this is UA Birth Import. I also tried select file type, but it doesnt help.
I can not change types from xlsx to something like death.xslx, because then import openpyxl throws an exception. I also can not register extensions in a way like extension=‘death.xlsx’ because I receive another Gramps error that it doesnt have addons with xlsx extension.
register(IMPORT,
id='UABirthImport',
name=_('UA Birth Import'),
description=_('Imports Birth from xlsx files'),
version='1.0.0',
gramps_target_version='5.2',
status=STABLE,
fname='UABirthImport.py',
import_function='import_data',
extension='xlsx'
)
register(IMPORT,
id='UAMarriageImport',
name=_('UA Marriage Import'),
description=_('Imports Marriage from xlsx files'),
version='1.0.0',
gramps_target_version='5.2',
status=STABLE,
fname='UAMarriageImport.py',
import_function='import_data',
extension='xlsx'
)
register(IMPORT,
id='UADeathImport',
name=_('UA Death Import'),
description=_('Imports Death from xlsx files'),
version='1.0.0',
gramps_target_version='5.2',
status=STABLE,
fname='UADeathImport.py',
import_function='import_data',
extension='xlsx'
)
How can I use 3 separate imports? I beleave there is a valid way because multiple gramplets can use the same extension. But how deny to Gramps autodetecting? Or how would you do this?