Skip to content

Commit

Permalink
Merge branch '0.3.6-feature-exit-hook-801'
Browse files Browse the repository at this point in the history
  • Loading branch information
pazz committed Dec 16, 2015
2 parents 0e92e66 + 1a863d9 commit 9612603
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
@@ -1,6 +1,7 @@
master:
* switched to setuptools
* detached urwidtrees library into separate project (and new dependency)
* new "exit" hook, called just before the program shuts down

0.3.6:
* implement vim-style "move last" command (bound to G)
Expand Down
7 changes: 6 additions & 1 deletion alot/init.py
Expand Up @@ -185,5 +185,10 @@ def main():
# set up and start interface
UI(dbman, cmdstring)

# run the exit hook
exit_hook = settings.get_hook('exit')
if exit_hook is not None:
exit_hook()

if __name__ == '__main__':
main()
main()
4 changes: 4 additions & 0 deletions docs/source/configuration/hooks.rst
Expand Up @@ -174,3 +174,7 @@ Apart from command pre- and posthooks, the following hooks will be interpreted:
:type buf: alot.buffer.Buffer
:param success: true if successfully focused buffer
:type success: boolean

.. py:function:: exit()
run just before the program exits

0 comments on commit 9612603

Please sign in to comment.