Re: [Pyobjc-dev] Python talking to XPC services?
Brought to you by:
ronaldoussoren
From: Glyph <gl...@tw...> - 2018-12-31 18:49:11
|
> On Dec 30, 2018, at 2:51 AM, Ronald Oussoren <ron...@ma...> wrote: > > > >> On 30 Dec 2018, at 07:19, Glyph <gl...@tw... <mailto:gl...@tw...>> wrote: >> >> I've long been curious about if and how one could use XPC services with Python, and I recently ran across this question: >> >> https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a <https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a> >> >> If anyone on this list happens to have the relevant understanding, I put a 100-point bounty on it. >> >> Happy holidays, > > > I hadn’t seen this question yet, mostly because I rarely visit stackoverflow. A quick summary of my answer: > > 1) It is possible to call APIs with blocks, even if those APIs aren’t in Apple’s frameworks > > 2) It is possible to define ObjC protocols in Python > > 3) Those protocols don’t work with NSXPCInterface yet (issue #256), but there is an (untested) workaround > > I wonder how hard it will be to fix #256, with some luck NSXPCInterface access information that isn’t exposed through a public API. In particular, the NSXPCInterface error mentions “extended method signature” and I haven’t found any reference to those yet in Apple documentation. Thanks for having a look at this! Good luck on figuring out what an "extended method signature" is, I hope that's tractable. I don't know if it will be helpful for this purpose, but Ian Beer has a talk about macOS IPC mechanisms - from the perspective of exploiting them, rather than programming against them :) but perhaps some of the internal details he talks about will be useful to you: https://vimeo.com/127859750 <https://vimeo.com/127859750> (Frankly a lot of this stuff goes over my head; I don't know a whole lot about Mach and the more I learn about ports the scarier they seem.) -g |