Re: Python talking to XPC services?
Ronald Oussoren via Pyobjc-dev <[email protected]> Sun, 30 Dec 2018 11:51:02 +0100
| Newsgroups | gmane.comp.python.pyobjc.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============2013592294748635152== Content-Type: multipart/alternative; boundary="Apple-Mail=_F1AB5677-5EF7-4052-A7E7-84CA280E0B33" --Apple-Mail=_F1AB5677-5EF7-4052-A7E7-84CA280E0B33 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 30 Dec 2018, at 07:19, Glyph <[email protected]> wrote: >=20 > I've long been curious about if and how one could use XPC services = with Python, and I recently ran across this question: >=20 > = 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> >=20 > If anyone on this list happens to have the relevant understanding, I = put a 100-point bounty on it. >=20 > Happy holidays, I hadn=E2=80=99t 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=E2=80=99= t in Apple=E2=80=99s frameworks 2) It is possible to define ObjC protocols in Python 3) Those protocols don=E2=80=99t 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=E2=80=99t exposed through a public API. In = particular, the NSXPCInterface error mentions =E2=80=9Cextended method = signature=E2=80=9D and I haven=E2=80=99t found any reference to those = yet in Apple documentation. Ronald =E2=80=94 Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ = <https://blog.ronaldoussoren.net/> --Apple-Mail=_F1AB5677-5EF7-4052-A7E7-84CA280E0B33 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div class=3D""> </div> <div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On 30 Dec 2018, at 07:19, Glyph <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><meta = http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii" = class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: = space; line-break: after-white-space;" class=3D""><div class=3D"">I've = long been curious about if and how one could use XPC services with = Python, and I recently ran across this question:</div><div class=3D""><br = class=3D""></div><a = href=3D"https://stackoverflow.com/questions/52284089/is-it-possible-to-use= -pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a" = class=3D"">https://stackoverflow.com/questions/52284089/is-it-possible-to-= use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinterface-a</a><div = class=3D""><br class=3D""></div><div class=3D"">If anyone on this list = happens to have the relevant understanding, I put a 100-point bounty on = it.</div><div class=3D""><br class=3D""></div><div class=3D"">Happy = holidays,</div></div></div></blockquote><div><br class=3D""></div><div><br= class=3D""></div>I hadn=E2=80=99t seen this question yet, mostly = because I rarely visit stackoverflow. A quick summary of my = answer:</div><div><br class=3D""></div><div>1) It is possible to call = APIs with blocks, even if those APIs aren=E2=80=99t in Apple=E2=80=99s = frameworks</div><div><br class=3D""></div><div>2) It is possible to = define ObjC protocols in Python</div><div><br class=3D""></div><div>3) = Those protocols don=E2=80=99t work with NSXPCInterface yet (issue #256), = but there is an (untested) workaround</div><div><br = class=3D""></div><div>I wonder how hard it will be to fix #256, with = some luck NSXPCInterface access information that isn=E2=80=99t exposed = through a public API. In particular, the NSXPCInterface error = mentions =E2=80=9Cextended method signature=E2=80=9D and I haven=E2=80=99t= found any reference to those yet in Apple documentation.</div><div><br = class=3D""></div><div>Ronald</div><div><br class=3D""><div = class=3D""><div>=E2=80=94</div><div><br class=3D""></div><div>Twitter: = @ronaldoussoren</div><div>Blog: <a = href=3D"https://blog.ronaldoussoren.net/" = class=3D"">https://blog.ronaldoussoren.net/</a></div><div><br = class=3D""></div></div></div></body></html>= --Apple-Mail=_F1AB5677-5EF7-4052-A7E7-84CA280E0B33-- --===============2013592294748635152== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2013592294748635152== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Pyobjc-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyobjc-dev --===============2013592294748635152==--