On Sun, 2010-08-08 at 14:27 +0200, m.bey...@gmx.de wrote: > The problem I have with this is that kaa seams to start some sort of > signals handlers and other mainloop stuff that, in my case, prevents > my program to quit properly.
I'm not aware of anything in kaa.metadata that depends on the mainloop. I consider your problem to be a bug in kaa.base. I do see code in kaa.base that adds handlers to SIGTERM and SIGINT when kaa.main is imported. This seems like a bad idea to me. dischi, this looks like your code, so I don't want to change anything before double checking. I think we should do this the first time kaa.main.loop() is called, and only replace default handlers, not handlers that might have been previously set by the user. Objections if I make this change? We need to continue to minimize the amount of stuff we do at import time. > File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line > 1177, in mainLoop > self.doIteration(t) > File "/usr/lib/python2.6/dist-packages/twisted/internet/epollreactor.py", > line 180, in doPoll > l = self._poller.wait(len(self._selectables), timeout) > File "/usr/lib/python2.6/dist-packages/kaa/main.py", line 313, in > signal_handler > notifier.shutdown() > File "/usr/lib/python2.6/dist-packages/kaa/nf_wrapper.py", line 137, in > shutdown > sys.exit(0) > exceptions.SystemExit: 0 > > Has anyone any advice on how to prevent this? You could try installing kaa.base from svn. The version in svn uses lazy importing of kaa.base submodules, and won't indirectly import kaa.main (which seems to be the culprit) when all you're doing is importing kaa.metadata. In terms of solving the problem with the version of kaa.base that you're using, you could try removing (or restoring) the signal handlers for SIGTERM and SIGINT that get installed after you import kaa.metadata. This is a kludge of course, but should work, and won't be necessary after we fix the problem. > Also, what's the point on having a metadata library if it depends so > heavily on kaa as a whole? kaa.metadata depends only on kaa.base for some helper functions and distutils stuff. All kaa modules depend on kaa.base. But kaa.metadata doesn't presently depend on the kaa mainloop, so it should be perfectly usable for what you're trying to do. The fact that it isn't is a bug. Thanks, Jason. ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel