mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-07-09 08:51:40 +00:00
18 lines
517 B
Python
18 lines
517 B
Python
import pluggy
|
|
from .hookspecs import HookSpec
|
|
import importlib.metadata
|
|
|
|
# Define the plugin namespace
|
|
plugin_namespace = "changedetectionio.restock_price_scraper"
|
|
|
|
# Create a pluggy.PluginManager instance
|
|
pm = pluggy.PluginManager(plugin_namespace)
|
|
|
|
# Register the hook specifications
|
|
pm.add_hookspecs(HookSpec)
|
|
|
|
# Automatically discover and register plugins using entry points
|
|
for entry_point in importlib.metadata.entry_points().get(plugin_namespace, []):
|
|
plugin = entry_point.load()
|
|
pm.register(plugin())
|