Re: [Pyobjc-dev] Mail plugin
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2005-01-17 22:09:12
|
On Jan 17, 2005, at 16:56, Fortepianissimo wrote: > On Mon, 17 Jan 2005 14:45:28 -0500, Bob Ippolito <bo...@re...> > wrote: >> >> On Jan 17, 2005, at 11:06, Fortepianissimo wrote: >> >>> After a long while I finally started again on my quest of using >>> PyObjC >>> to write a Mail bundle plugin. >>> >>> For some consideration I want to start my plugin in objc - i.e., >>> implement my bundle class in objc, and in the initialization load in >>> a >>> "plugin" bundle written in Python (in the spirit of >>> SimpleComboBoxPlus >>> example). The -init implementation of the objc bundle is (the plugin >>> written in Python is called Foo.py, with a single class Foo in it): ... >>> I also created setup.py and run py2app to create Foo.plugin, and then >>> included Foo.plugin in my resources. >>> >>> After placing the resulting mailbundle in ~/Library/Mail/Bundles and >>> start Mail.app, I can see Foo.init() is correctly called. > > Now I ran into another problem: it looks like I'm having deadlock of > some sort. My hunch is that the Foo class is instantiated in one > thread, but when I try to do foo.somemethod_() inside some other > thread, I bumped directly into the much dreaded GIL? The way we use the GIL should not cause a deadlock like that. It could be a bug in your code, PyObjC, or Python. If you can give me a minimal example that can reproduce this problem *without* being loaded as a plugin to Mail.app, then I will look into it. Otherwise, you're on your own. > So my general question is: is it possible to call > foo.somemethod_(u'string') (or shall I say [foo somemethod:@"string"] > ) in an objc thread that's different from the thread that instantiates > foo? If yes, how should I do it? Yes, and just like you normally would. It should work just fine. > (the same threading problem will happen if I started out from the > Python side) Are you sure? Did you try it? -bob |