diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-24 13:29:37 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-24 13:29:37 +0000 |
commit | 6787e1c6d488483e1fc00888b58725c1d66d8ee1 (patch) | |
tree | c0862af3398c0d12c669d191fb3b6ba028c85e90 /docs | |
parent | 5d75c5589ab56558392433e6d4fe09b416d5578f (diff) |
new naming convention for pre/post command hooks
command names alone do not uniquely determine a command
as we do have several differend Commands registered with the same name
but for different modes. pre and post hooks are from now on named
[pre|post]_[modestring]_[commandname].
This commit adjusts the lookup code for command hooks and corrects the
user docs accordingly.
closes #282
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/source/configuration.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/user/source/configuration.rst b/docs/user/source/configuration.rst index d228fde6..1c1d3eec 100644 --- a/docs/user/source/configuration.rst +++ b/docs/user/source/configuration.rst @@ -124,10 +124,10 @@ Have a look at `the urwid User Input documentation <http://excess.org/urwid/wiki Hooks ===== -Hooks are python callables that live in a module specified by -`hooksfile` in the `[global]` section of your config. Per default this points -to `~/.config/alot/hooks.py`. -For every command X, the callable 'pre_X' will be called before X and 'post_X' afterwards. +Hooks are python callables that live in a module specified by `hooksfile` in the `[global]` +section of your config. Per default this points to `~/.config/alot/hooks.py`. +For every command X in mode M, the callables 'pre_M_X' and 'post_M_X' +-- if defined -- will be called before and after the command is applied respectively. When a hook gets called, it receives instances of @@ -146,7 +146,7 @@ As an example, consider this pre-hook for the exit command, that logs a personalized goodby message:: import logging - def pre_exit(aman=None, **rest): + def pre_global_exit(aman=None, **rest): accounts = aman.get_accounts() if accounts: logging.info('goodbye, %s!' % accounts[0].realname) |