Re: [Pyobjc-dev] Find By Content
Brought to you by:
ronaldoussoren
From: Dethe E. <det...@bl...> - 2003-11-14 22:09:00
|
Thanks for the clarification, I guess this line in the docs threw me: "Carbon supports Find By Content, but note that it is not contained within the Carbon framework." I thought that meant it was part of Cocoa. I guess there are part of the api which are neither Carbon nor Cocoa. Silly me. On the other hand, I certainly don't need *all* of the Find By Content. I could probably write a command-line tool in C or ObjC and call it from Python or wrap it in Python. If I could get to it from PyObjC that would have been easier, but at least now I can rule that path out. Thanks again, --Dethe On 14-Nov-03, at 1:17 PM, Bob Ippolito wrote: > > On Nov 14, 2003, at 3:43 PM, Dethe Elza wrote: > >> I am trying to get started using PyObjC. What I'm interested in is >> creating a command-line search tool using the Find By Content API, >> which is in the ApplicationServices framework. But I haven't been >> able to figure out how to bootstrap far enough to find the API calls >> from Python. >> >> Is the ApplicationServices framework already exposed by PyObjC? >> >> If not, how do I wrap it? I've tried to follow the instructions here: > >> http://pyobjc.sourceforge.net/doc/wrapping.php, but haven't had luck >> with it. > > ApplicationServices is not an Objective C framework, it can not be > wrapped (directly) with PyObjC. > > As you can see by the documentation ( > http://developer.apple.com/documentation/Carbon/Reference/ > Find_By_Content/index.html ), it's part of Carbon. Carbon frameworks > are a lot more work to wrap. You'll want to use a tool like bgen, > Pyrex, or SWIG .. or just write the bindings by hand (see "Extending > and Embedding" and "Python/C API" at http://www.python.org/doc/current/ > > ). It's not very fun. There's also the option of writing an ObjC > framework that wraps the C functions, but that doesn't look like it > would make much sense in this case as the functions are not primarily > CoreFoundation based. In short, it's not possible to wrap any APi that > > was available in Mac OS before OS X (and even several new APIs that are > > not ObjC) using PyObjC (directly). > > Currently, the only part of the Find by Content API that is wrapped are > > the error codes ;) You're on your own here, properly wrapping about 50 > > functions and having them work correctly takes a good while even if you > > know the tools well. You may want to ask on pythonmac-sig if anyone > wants to volunteer to write it, or to help write it. > > -bob > "Computers are beyond dumb, they're mind-numbingly stupid. They're hostile, rigid, capricious, and unforgiving. They're impossibly demanding and they never learn anything." -- John R. Levine |