Re: [Pyobjc-dev] Python talking to XPC services?
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2019-01-01 01:00:56
|
Op 31 dec. 2018 om 19:48 heeft Glyph <gl...@tw...> het volgende geschreven: > > >> On Dec 30, 2018, at 2:51 AM, Ronald Oussoren <ron...@ma...> wrote: >> >> >> >>> On 30 Dec 2018, at 07:19, Glyph <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 >>> >>> 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 > > (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.) Thanks for the link. I hope I don’t need any of the real low-level stuff, but just enough to make the XPC support classes happy. I’m currently focusing on what will result in a rewrite, and more importantly, major cleanup of py2app and supporting libraries. Low-level objc stuff will have to wait a bit, writing nice clean python 3 code is much more fun :-) And: my best wishes for the 2019. Ronald > > -g > |