1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-15 20:36:55 +00:00

Addd hook capability

This commit is contained in:
Tuna Celik 2020-08-17 02:05:02 +02:00
parent 03e7e209da
commit 5253a464ab
7 changed files with 103 additions and 2 deletions

25
radicale/hook/__init__.py Normal file
View file

@ -0,0 +1,25 @@
from radicale import utils
INTERNAL_TYPES = ("none", "rabbitmq")
def load(configuration):
"""Load the storage module chosen in configuration."""
return utils.load_plugin(
INTERNAL_TYPES, "hook", "Hook", configuration)
class BaseHook:
def __init__(self, configuration):
"""Initialize BaseHook.
``configuration`` see ``radicale.config`` module.
The ``configuration`` must not change during the lifetime of
this object, it is kept as an internal reference.
"""
self.configuration = configuration
def notify(self, content):
"""Upload a new or replace an existing item."""
raise NotImplementedError