Author tyoc
Recipients tyoc
Date 2009-05-03.01:20:50
SpamBayes Score 2.25513e-05
Marked as misclassified No
Message-id <>
OK, here is a resume of the anterior.

I see clearly that it matter where I import the library (dont know if 
is a problem of the library or python). This time the thread doesnt 
end, will end when you hit CTRL+C in the terminal, for test this you 
need enabled accessibility.


1) run the code as is and see that it prints spot 0, 1 end is not wrote
2) uncomment the line of import pyatspi # import in the main thread and 
run again, see that it only print 0, it app is stuck inside 
pyatspi.Registry.registerEventListener(cb, 'focus')

[code start]---------------------------
import threading 
class thr(threading.Thread): 
    def __init__(self): 
#        import pyatspi # import in the main thread 
    def run(self): 
        def cb(eve): 
            print eve 
        import pyatspi # import here in the new thread 
        print 'spot 0' 
        pyatspi.Registry.registerEventListener(cb, 'focus') 
        print 'spot 1'
        print 'End' 
t = thr() 
[code end]---------------------------

So at less for this library, it matter where you import the thing.
Date User Action Args
2009-05-03 01:20:52tyocsetrecipients: + tyoc
2009-05-03 01:20:52tyocsetmessageid: <>
2009-05-03 01:20:51tyoclinkissue5908 messages
2009-05-03 01:20:50tyoccreate