diff options
author | VG <vg@devys.org> | 2016-05-19 21:00:26 +0200 |
---|---|---|
committer | VG <vg@devys.org> | 2016-05-19 21:00:26 +0200 |
commit | 41f2eac415ddaf3b93565225317f0579e9ae8cc4 (patch) | |
tree | 965bc7605b6dde1a4b630577863dfc609636d84d /climl/__init__.py | |
parent | 1dc11eb465ff70ea51452326935208a40c2b49bf (diff) | |
download | climl-41f2eac415ddaf3b93565225317f0579e9ae8cc4.tar.gz climl-41f2eac415ddaf3b93565225317f0579e9ae8cc4.tar.bz2 climl-41f2eac415ddaf3b93565225317f0579e9ae8cc4.zip |
Move processing mail code to a dedicated function
Also move KeyboardIntr handling to a better place
Diffstat (limited to 'climl/__init__.py')
-rw-r--r-- | climl/__init__.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/climl/__init__.py b/climl/__init__.py index d577ace..bc8ca94 100644 --- a/climl/__init__.py +++ b/climl/__init__.py @@ -1,7 +1,15 @@ from . import imap +from . import interface def on_email(content): print('on_email:', content) + print('now, raising exception') + raise interface.HookAbortError() def main(): - imap.main(on_email) + print('starting imap.main loop') + try: + imap.main(on_email) + except KeyboardInterrupt: + pass + print('end of main imap loop') |