Implement clean CTRL-C termination

Previously, we would simply bail out in an ugly way, potentially leaving
temporary files around etc, or while writing status files. Hand SIGINT
and SIGTERM as an event to the Account class, and make that bail out
cleanly at predefined points. Stopping on ctrl-c can take a few seconds
(it will e.g. finish to transfer the ongoing message), but it will shut
down cleanly.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-01-04 19:24:19 +01:00
parent 8ec6980c96
commit 0ccf06d5e6
4 changed files with 37 additions and 13 deletions

View File

@ -29,5 +29,9 @@ Changes
* Bumped bundled imaplib2 to release 2.29
* Make ctrl-c exit cleanly rather aborting brutally (which could leave
around temporary files, half-written cache files, etc). Exiting on
SIGTERM and CTRL-C can take a little longer, but will be clean.
Bug Fixes
---------