From a985ea373751f444a15c745cd1af01d55d5d033b Mon Sep 17 00:00:00 2001 From: Andre Anjos Date: Fri, 8 Nov 2024 17:17:22 +0100 Subject: [PATCH] [init] Avoid using object methods as signal receivers --- src/pelican/plugins/pybtex/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pelican/plugins/pybtex/__init__.py b/src/pelican/plugins/pybtex/__init__.py index 259051c..a9d011b 100644 --- a/src/pelican/plugins/pybtex/__init__.py +++ b/src/pelican/plugins/pybtex/__init__.py @@ -17,6 +17,14 @@ def _get_generators(pelican_object): return PybtexGenerator +def _get_injector_init(generator): + return _injector.init(generator) + + +def _get_injector_solver(content): + return _injector.resolve_bibliography(content) + + def register(): """Register this plugin to pelican.""" @@ -28,5 +36,5 @@ def register(): pelican.plugins.signals.get_generators.connect(_get_generators) # Per-content (articles, pages) biobliography injector - signals.pybtex_generator_init.connect(_injector.init) - pelican.plugins.signals.content_object_init.connect(_injector.resolve_bibliography) + signals.pybtex_generator_init.connect(_get_injector_init) + pelican.plugins.signals.content_object_init.connect(_get_injector_solver)