On Jan 29, 2008 2:15 AM, Philip Jenvey
<pjen...@public.gmane.org> wrote:
Is there a way to get notified when your application is about to be
shut down? Paste looks like it just sends SIGTERM to the process
when
it detects a modified file, but maybe I'm missing something.
If Cliff's suggestion doesn't work -- in general, the way to get a
callback when python quits is via the atexit module.
I've tried to register a function via atexit, but it's not being
called. This is probably because, according to the atexit docs,
"Note: the functions registered via this module are not called when
the program is killed by a signal, when a Python fatal internal error
is detected, or when os._exit() is called."
I'll give Cliff's suggestion a try and see how that goes. The avahi
bindings for python are pretty barebones, I was hoping not to have to
get into that :)
Cheers,
Chris