Actually, this specific problem doesn't have a cure in our local branch, but one can work around it using the reactor.callFromThread call which executes a function within the reactor's thread. The example below worked just fine on our local branch and it *should* work with the noxrepo.org version too:

        def sig_install():
            def sig_handler(signal_num, handler):
                lg.debug('HUP!')

            import signal
            signal.signal(signal.SIGHUP, sig_handler)

        from twisted.internet import reactor
        reactor.callFromThread(sig_install)

HTH,
Teemu

No luck I'm afraid Teemu. Here's the error the above code generates:

   --- <exception caught here> ---
File "./nox/apps/pyrt/pyoxidereactor.py", line 166, in callPendingThreadCalls
       f(*a, **kw)
File "./nox/apps/mobile_firewall/mobile_firewall.py", line 33, in sig_install
       signal.signal(signal.SIGHUP, sig_handler)
   exceptions.ValueError: signal only works in main thread

Glen

_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to