Allow filters/rules via plugin without fail on restart
This commit is contained in:
parent
5311cc7744
commit
8366ceb896
@ -22,7 +22,6 @@
|
||||
Package providing filtering framework for Gramps.
|
||||
"""
|
||||
|
||||
#SystemFilters = None
|
||||
CustomFilters = None
|
||||
|
||||
from ..const import CUSTOM_FILTERS
|
||||
@ -32,18 +31,10 @@ from ._genericfilter import (GenericFilter, GenericFilterFactory,
|
||||
from ._paramfilter import ParamFilter
|
||||
from ._searchfilter import SearchFilter, ExactSearchFilter
|
||||
|
||||
#def reload_system_filters():
|
||||
#global SystemFilters
|
||||
#SystemFilters = FilterList(SYSTEM_FILTERS)
|
||||
#SystemFilters.load()
|
||||
|
||||
def reload_custom_filters():
|
||||
global CustomFilters
|
||||
CustomFilters = FilterList(CUSTOM_FILTERS)
|
||||
CustomFilters.load()
|
||||
|
||||
#if not SystemFilters:
|
||||
#reload_system_filters()
|
||||
|
||||
if not CustomFilters:
|
||||
reload_custom_filters()
|
||||
# if not CustomFilters: # moved to viewmanager
|
||||
# reload_custom_filters()
|
||||
|
@ -17,7 +17,6 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
from ....filters.rules.person._matchidof import MatchIdOf
|
||||
|
||||
"""
|
||||
Unittest that tests person-specific filter rules
|
||||
@ -27,6 +26,8 @@ import os
|
||||
from time import perf_counter
|
||||
import inspect
|
||||
|
||||
from ....filters import reload_custom_filters
|
||||
reload_custom_filters()
|
||||
from ....db.utils import import_as_dict
|
||||
from ....filters import GenericFilter, CustomFilters
|
||||
from ....const import DATA_DIR
|
||||
|
@ -100,6 +100,7 @@ from gramps.gui.editors import (EditPerson, EditFamily, EditMedia, EditNote,
|
||||
EditPlace, EditSource, EditRepository,
|
||||
EditCitation, EditEvent)
|
||||
from gramps.gen.db.exceptions import DbWriteFailure
|
||||
from gramps.gen.filters import reload_custom_filters
|
||||
from .managedwindow import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -195,6 +196,7 @@ class ViewManager(CLIManager):
|
||||
self.__connect_signals()
|
||||
|
||||
self.do_reg_plugins(self.dbstate, self.uistate)
|
||||
reload_custom_filters()
|
||||
#plugins loaded now set relationship class
|
||||
self.rel_class = get_relationship_calculator()
|
||||
self.uistate.set_relationship_class()
|
||||
|
@ -37,6 +37,8 @@ from gramps.cli.grampscli import CLIManager
|
||||
from gramps.cli.argparser import ArgParser
|
||||
from gramps.cli.arghandler import ArgHandler
|
||||
from gramps.gen.const import USER_DIRLIST
|
||||
from gramps.gen.filters import reload_custom_filters
|
||||
reload_custom_filters() # so reports with filter options don't fail
|
||||
|
||||
# _caller_context is primarily here to support and document the process
|
||||
# of determining the test-module's directory.
|
||||
|
Loading…
Reference in New Issue
Block a user