summaryrefslogtreecommitdiff
path: root/docs/source
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2013-08-10 22:22:28 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2013-10-30 20:56:39 +0000
commitaa5401cd548e7622c73523ef40383cd9d2c94fc8 (patch)
tree1c3ea31ecd6964c48c9a2bbc6f42f1ac8f76cac0 /docs/source
parentfc0a508350074eae0ea47a520659d43a05451111 (diff)
doc: mention cmd-keyword parm to pre/post cmd hooks
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/configuration/hooks.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/source/configuration/hooks.rst b/docs/source/configuration/hooks.rst
index 90b4fc30..e364d6f3 100644
--- a/docs/source/configuration/hooks.rst
+++ b/docs/source/configuration/hooks.rst
@@ -11,18 +11,20 @@ For every :ref:`COMMAND <usage.commands>` in mode :ref:`MODE <modes>`, the calla
-- if defined -- will be called before and after the command is applied respectively. The signature for the
pre-`send` hook in envelope mode for example looks like this:
-.. py:function:: pre_envelope_send(ui=None, dbm=None)
+.. py:function:: pre_envelope_send(ui=None, dbm=None, cmd=None)
:param ui: the main user interface
:type ui: :class:`alot.ui.UI`
:param dbm: a database manager
:type dbm: :class:`alot.db.manager.DBManager`
+ :param cmd: the Command instance that is being called
+ :type cmd: :class:`alot.commands.Command`
Consider this pre-hook for the exit command, that logs a personalized goodbye message::
import logging
from alot.settings import settings
- def pre_global_exit(ui, dbm):
+ def pre_global_exit(**kwargs):
accounts = settings.get_accounts()
if accounts:
logging.info('goodbye, %s!' % accounts[0].realname)