Fix plugin imports: use proper relative imports instead of spec_from_file_location hack

This commit is contained in:
Bertram Gilfoyle 2026-02-24 02:35:10 +00:00
parent 008be764a7
commit 598a768f0a

View file

@ -13,14 +13,7 @@ from datetime import datetime, timezone
from cardinal.decorators import command, event, help
# Import parser from same directory
import os
import importlib.util
_parser_path = os.path.join(os.path.dirname(__file__), "monop_parser.py")
_spec = importlib.util.spec_from_file_location("monop_parser", _parser_path)
_mod = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(_mod)
MonopParser = _mod.MonopParser
from .monop_parser import MonopParser
logger = logging.getLogger(__name__)