Re: Python talking to XPC services?

Ronald Oussoren via Pyobjc-dev <[email protected]> Tue, 1 Jan 2019 02:00:43 +0100
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
--===============8701543833625900216==
Content-Type: multipart/alternative;
	boundary=Apple-Mail-0BB960D0-8CA7-4278-AD70-B59D86CEF4DD
Content-Transfer-Encoding: 7bit


--Apple-Mail-0BB960D0-8CA7-4278-AD70-B59D86CEF4DD
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

Op 31 dec. 2018 om 19:48 heeft Glyph <[email protected]> het volgende g=
eschreven:

>=20
>=20
>> On Dec 30, 2018, at 2:51 AM, Ronald Oussoren <[email protected]> wro=
te:
>>=20
>>=20
>>=20
>>> 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 P=
ython, and I recently ran across this question:
>>>=20
>>> https://stackoverflow.com/questions/52284089/is-it-possible-to-use-pyobj=
c-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,
>>=20
>>=20
>> I hadn=E2=80=99t seen this question yet, mostly because I rarely visit st=
ackoverflow.  A quick summary of my answer:
>>=20
>> 1) It is possible to call APIs with blocks, even if those APIs aren=E2=80=
=99t in Apple=E2=80=99s frameworks
>>=20
>> 2) It is possible to define ObjC protocols in Python
>>=20
>> 3) Those protocols don=E2=80=99t work with NSXPCInterface yet (issue #256=
), but there is an (untested) workaround
>>=20
>> I wonder how hard it will be to fix #256, with some luck NSXPCInterface a=
ccess information that isn=E2=80=99t exposed through a public API.  In parti=
cular, 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 docum=
entation.
>=20
> Thanks for having a look at this!  Good luck on figuring out what an "exte=
nded method signature" is, I hope that's tractable.
>=20
> I don't know if it will be helpful for this purpose, but Ian Beer has a ta=
lk about macOS IPC mechanisms - from the perspective of exploiting them, rat=
her than programming against them :) but perhaps some of the internal detail=
s he talks about will be useful to you:
>=20
> https://vimeo.com/127859750
>=20
> (Frankly a lot of this stuff goes over my head; I don't know a whole lot a=
bout Mach and the more I learn about ports the scarier they seem.)

Thanks for the link.  I hope I don=E2=80=99t need any of the real low-level s=
tuff, but just enough to make the XPC support classes happy.=20

I=E2=80=99m currently focusing on what will result in a rewrite, and more im=
portantly, major cleanup  of py2app and supporting libraries.  Low-level obj=
c stuff will have to wait a bit, writing nice clean python 3 code is much mo=
re fun :-)

And: my best wishes for the 2019.=20

Ronald

>=20
> -g
>=20

--Apple-Mail-0BB960D0-8CA7-4278-AD70-B59D86CEF4DD
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto">Op 31 dec. 2018 om 19:48 heeft Glyph &lt;<a=
 href=3D"mailto:[email protected]">[email protected]</a>&gt; het=
 volgende geschreven:<br><div dir=3D"ltr"><br></div><blockquote type=3D"cite=
"><div dir=3D"ltr"><meta http-equiv=3D"Content-Type" content=3D"text/html; c=
harset=3Dutf-8"><br class=3D""><div><br class=3D""><blockquote type=3D"cite"=
 class=3D""><div class=3D"">On Dec 30, 2018, at 2:51 AM, Ronald Oussoren &lt=
;<a href=3D"mailto:[email protected]" class=3D"">[email protected]=
</a>&gt; wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""=
><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" cl=
ass=3D""><div 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 class=3D""><br class=3D""><blockquote type=3D"cite" class=3D""><div cla=
ss=3D"">On 30 Dec 2018, at 07:19, Glyph &lt;<a href=3D"mailto:glyph@twistedm=
atrix.com" class=3D"">[email protected]</a>&gt; 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-wr=
ap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" cl=
ass=3D""><div class=3D"">I've long been curious about if and how one could u=
se 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/que=
stions/52284089/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-too=
l-and-xpcinterface-a" class=3D"">https://stackoverflow.com/questions/5228408=
9/is-it-possible-to-use-pyobjc-with-a-privilved-xpc-helper-tool-and-xpcinter=
face-a</a><div class=3D""><br class=3D""></div><div class=3D"">If anyone on t=
his list happens to have the relevant understanding, I put a 100-point bount=
y on it.</div><div class=3D""><br class=3D""></div><div class=3D"">Happy hol=
idays,</div></div></div></blockquote><div class=3D""><br class=3D""></div><d=
iv class=3D""><br class=3D""></div>I hadn=E2=80=99t seen this question yet, m=
ostly because I rarely visit stackoverflow. &nbsp;A quick summary of my answ=
er:</div><div class=3D""><br class=3D""></div><div class=3D"">1) It is possi=
ble to call APIs with blocks, even if those APIs aren=E2=80=99t in Apple=E2=80=
=99s frameworks</div><div class=3D""><br class=3D""></div><div class=3D"">2)=
 It is possible to define ObjC protocols in Python</div><div class=3D""><br c=
lass=3D""></div><div class=3D"">3) Those protocols don=E2=80=99t work with N=
SXPCInterface yet (issue #256), but there is an (untested) workaround</div><=
div class=3D""><br class=3D""></div><div class=3D"">I wonder how hard it wil=
l be to fix #256, with some luck NSXPCInterface access information that isn=E2=
=80=99t exposed through a public API. &nbsp;In particular, the NSXPCInterfac=
e 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></d=
iv></blockquote><br class=3D""></div><div>Thanks for having a look at this! &=
nbsp;Good luck on figuring out what an "extended method signature" is, I hop=
e that's tractable.</div><div><br class=3D""></div><div>I don't know if it w=
ill be helpful for this purpose, but Ian Beer has a talk about macOS IPC mec=
hanisms - from the perspective of exploiting them, rather than programming a=
gainst them :) but perhaps some of the internal details he talks about will b=
e useful to you:</div><div><br class=3D""></div><div><a href=3D"https://vime=
o.com/127859750" class=3D"">https://vimeo.com/127859750</a></div><div><br cl=
ass=3D""></div><div>(Frankly a lot of this stuff goes over my head; I don't k=
now a whole lot about Mach and the more I learn about ports the scarier they=
 seem.)</div></div></blockquote><div><br></div>Thanks for the link. &nbsp;I h=
ope I don=E2=80=99t need any of the real low-level stuff, but just enough to=
 make the XPC support classes happy.&nbsp;<div><br></div><div>I=E2=80=99m cu=
rrently focusing on what will result in a rewrite, and more importantly, maj=
or cleanup &nbsp;of py2app and supporting libraries. &nbsp;Low-level objc st=
uff will have to wait a bit, writing nice clean python 3 code is much more f=
un :-)</div><div><br></div><div>And: my best wishes for the 2019.&nbsp;</div=
><div><br></div><div>Ronald</div><div><br><div><div><div><blockquote type=3D=
"cite"><div dir=3D"ltr"><div><br class=3D""></div><div>-g</div><br class=3D"=
"></div></blockquote></div></div></div></div></body></html>=

--Apple-Mail-0BB960D0-8CA7-4278-AD70-B59D86CEF4DD--


--===============8701543833625900216==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8701543833625900216==
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

--===============8701543833625900216==--