This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tyoc
Recipients tyoc
Date 2009-05-03.01:20:50
SpamBayes Score 2.2551321e-05
Marked as misclassified No
Message-id <1241313652.58.0.823855092607.issue5908@psf.upfronthosting.co.za>
In-reply-to
Content
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.

Steps

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): 
        threading.Thread.__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'
        pyatspi.Registry.start() 
        print 'End' 
  
t = thr() 
t.start() 
t.join() 
[code end]---------------------------



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