Duncan Webb wrote: > Dirk Meyer wrote: >> Duncan Webb wrote: >>> I have this in __main__, so I would expect the Ctrl-C exit >>> (basically the stop command) to print something. >>> |try: >>> | main() >>> |except Exception, why: >>> | traceback.print_exc() >>> | print why >>> |print 'done.' >> >> You will not see print why because SystemExit will be handled >> internally and kaa.main.run would just stop without exception. But you >> should see 'done' > > Exactly what happens
So it is working :)
>> Looking at current rel-1:
>>
>> | try:
>> | # signal handler
>> | signal.signal(signal.SIGTERM, signal_handler)
>> | signal.signal(signal.SIGINT, signal_handler)
>> | | [...]
>> | | kaa.main.run()
>> | | | except KeyboardInterrupt:
>> | print 'Shutdown by keyboard interrupt'
>> | # Shutdown the application
>> | shutdown()
>> | | except SystemExit:
>> | pass
>> | | except Exception, e:
>> | _debug_('Crash!: %s' % (e), config.DCRITICAL)
>>
>> Please remove the signal handler here, let kaa base handle this. You
>> will also _never_ see 'Shutdown by keyboard interrupt' because kaa
>> handles this as well. If you want to clean up on shutdown, either
>> register a callback to kaa.main.siganls['shutdown'] or do this after
>> all exception handling. BTW, you will also never run into except
>> SystemExit.
>
> I've added some prints into notifier main and the signal handler never
> gets called, after pressing ctrl-c.
>
> What happens is that the signal handler is installed at the very
> beginning of the program. This is before DirectFB is started and I
> guess that DirectFB installed it's own signal handlers and the last
> installed signal handler is used first so DirectFB exits before kaa
> has seen the ctrl-c.
Which signal handler? Yours (see above) or the one from kaa main?
> Freevo runs twice at start up, so it looks like the kaa signal handler
> is not being installed
That could be a thread somehow.
Dischi
--
Regarding security, WindowsNT is an OS with a 'Kick me' sign stuck on
it's back.
pgpqL7wUAuYId.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
