mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
fix up docs
This commit is contained in:
@@ -2,10 +2,6 @@
|
|||||||
high level API reference
|
high level API reference
|
||||||
========================
|
========================
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
This API is work in progress and may change in versions prior to 1.0.
|
|
||||||
|
|
||||||
- :class:`deltachat.account.Account` (your main entry point, creates the
|
- :class:`deltachat.account.Account` (your main entry point, creates the
|
||||||
other classes)
|
other classes)
|
||||||
- :class:`deltachat.contact.Contact`
|
- :class:`deltachat.contact.Contact`
|
||||||
|
|||||||
@@ -4,15 +4,21 @@ Implementing Plugin Hooks
|
|||||||
|
|
||||||
The Delta Chat Python bindings use `pluggy <https://pluggy.readthedocs.io>`_
|
The Delta Chat Python bindings use `pluggy <https://pluggy.readthedocs.io>`_
|
||||||
for managing global and per-account plugin registration, and performing
|
for managing global and per-account plugin registration, and performing
|
||||||
hook calls.
|
hook calls. There are two kinds of plugins:
|
||||||
|
|
||||||
|
- Global plugins that are active for all accounts; they can implement
|
||||||
|
hooks at account-creation and account-shutdown time.
|
||||||
|
|
||||||
|
- Account plugins that are only active during the lifetime of a
|
||||||
|
single Account instance.
|
||||||
|
|
||||||
|
|
||||||
Registering a plugin
|
Registering a plugin
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
.. autoclass:: deltachat.register_global_plugin
|
.. autofunction:: deltachat.register_global_plugin
|
||||||
|
|
||||||
.. autoclass:: deltachat.account.Account.add_account_plugin
|
.. automethod:: deltachat.account.Account.add_account_plugin
|
||||||
|
|
||||||
|
|
||||||
Per-Account Hook specifications
|
Per-Account Hook specifications
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ def get_dc_event_name(integer, _DC_EVENTNAME_MAP={}):
|
|||||||
|
|
||||||
def register_global_plugin(plugin):
|
def register_global_plugin(plugin):
|
||||||
""" Register a global plugin which implements one or more
|
""" Register a global plugin which implements one or more
|
||||||
of the :class:`deltachat.hookspec.Global` specs.
|
of the :class:`deltachat.hookspec.Global` hooks.
|
||||||
"""
|
"""
|
||||||
gm = hookspec.Global._get_plugin_manager()
|
gm = hookspec.Global._get_plugin_manager()
|
||||||
gm.register(plugin)
|
gm.register(plugin)
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ class Account(object):
|
|||||||
|
|
||||||
def update_config(self, kwargs):
|
def update_config(self, kwargs):
|
||||||
""" update config values.
|
""" update config values.
|
||||||
|
|
||||||
:param kwargs: name=value config settings for this account.
|
:param kwargs: name=value config settings for this account.
|
||||||
values need to be unicode.
|
values need to be unicode.
|
||||||
:returns: None
|
:returns: None
|
||||||
@@ -529,7 +530,7 @@ class Account(object):
|
|||||||
|
|
||||||
def add_account_plugin(self, plugin):
|
def add_account_plugin(self, plugin):
|
||||||
""" add an account plugin which implements one or more of
|
""" add an account plugin which implements one or more of
|
||||||
the :class:`deltachat.hookspec.PerAccount` specs.
|
the :class:`deltachat.hookspec.PerAccount` hooks.
|
||||||
"""
|
"""
|
||||||
self._pm.register(plugin)
|
self._pm.register(plugin)
|
||||||
self._pm.check_pending()
|
self._pm.check_pending()
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ class PerAccount:
|
|||||||
|
|
||||||
|
|
||||||
class Global:
|
class Global:
|
||||||
""" global hook specifications using a per-process singleton plugin manager instance.
|
""" global hook specifications using a per-process singleton
|
||||||
|
plugin manager instance.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
_plugin_manager = None
|
_plugin_manager = None
|
||||||
|
|||||||
Reference in New Issue
Block a user