Files
arcanechat-core/python/src/deltachat/hookspec.py
T
holger krekel cf6391d51b move event tracking to new tracker.py file
some api cleanups
2020-04-13 17:39:31 +02:00

30 lines
896 B
Python

""" Hooks for Python bindings to Delta Chat Core Rust CFFI"""
import pluggy
__all__ = ["account_hookspec", "account_hookimpl", "AccountHookSpecs"]
_account_name = "deltachat-account"
account_hookspec = pluggy.HookspecMarker(_account_name)
account_hookimpl = pluggy.HookimplMarker(_account_name)
class AccountHookSpecs:
""" per-Account-instance hook specifications.
Account hook implementations need to be registered with an Account instance.
"""
@classmethod
def _make_plugin_manager(cls):
pm = pluggy.PluginManager(_account_name)
pm.add_hookspecs(cls)
return pm
@account_hookspec
def process_low_level_event(self, event_name, data1, data2):
""" process a CFFI low level events for a given account. """
@account_hookspec
def configure_completed(self, success):
""" Called when a configure process completed. """