People occasionally turn up in #telepathy wanting to write a connection manager in Python. That goal is some way off, but it would be nice if it was possible one day. I recently tried to make a gobject-introspection-based CM with Telepathy-GLib in Python, starting from first principles and working around any missing APIs I noticed. To test its ConnectionManager and Protocol functionality from Python, I had to fill in some missing Protocol API on the client side. Here it is.
Created attachment 88347 [details] [review] [01/15] inspect-cm.py: on errors, exit rather than blocking forever --- Useful for manual testing, if your CM doesn't actually work yet.
Created attachment 88348 [details] [review] 02/15] TpProtocol: parse_default_value: take raw value as a parameter We previously passed the value when parsed as a string, but that makes very little sense. The raw value is at least used for something by the function itself, and it's better for debug messages too.
Created attachment 88349 [details] [review] 03/15] _tp_protocol_parse_rcc: produce debug output
Created attachment 88350 [details] [review] 04/15] Require GLib 2.36, for GTask --- We might as well use GLib best-practice for new code, at least.
Created attachment 88351 [details] [review] 05/15] tp_protocol_normalize_contact_async: add and test
Created attachment 88352 [details] [review] 06/15] tp_protocol_identify_account_async: add and test To make the test a little more interesting and a little more realistic, we normalize the 'account' parameter to lower-case.
Created attachment 88353 [details] [review] 07/15] TpProtocol: add high-level API for the Addressing interface
Created attachment 88354 [details] [review] 08/15] TpPresenceMixin: deprecate optional arguments other than "message" Our D-Bus API no longer supports anything else.
Created attachment 88355 [details] [review] 09/15] TpPresenceMixin: fix indentation
Created attachment 88356 [details] [review] 10/15] TpPresenceStatusSpec: add some accessors
Created attachment 88357 [details] [review] 11/15] TpPresenceStatusSpec: be a boxed type
Created attachment 88358 [details] [review] 12/15] Emit a new TpProtocol's immutable properties as debug messages
Created attachment 88359 [details] [review] 13/15] TpProtocol: parse status specs from .manager files
Created attachment 88360 [details] [review] 14/15] TpProtocol: add API for presence statuses
Created attachment 88361 [details] [review] 15/15] TpProtocol: improve debug
Comment on attachment 88347 [details] [review] [01/15] inspect-cm.py: on errors, exit rather than blocking forever Review of attachment 88347 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88348 [details] [review] 02/15] TpProtocol: parse_default_value: take raw value as a parameter Review of attachment 88348 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88349 [details] [review] 03/15] _tp_protocol_parse_rcc: produce debug output Review of attachment 88349 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88350 [details] [review] 04/15] Require GLib 2.36, for GTask Review of attachment 88350 [details] [review]: ----------------------------------------------------------------- ++ ::: configure.ac @@ -203,2 @@ > > AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_34], [Ignore post 2.34 deprecations]) We don't build with 2.36 as min required?
Comment on attachment 88351 [details] [review] 05/15] tp_protocol_normalize_contact_async: add and test Review of attachment 88351 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88352 [details] [review] 06/15] tp_protocol_identify_account_async: add and test Review of attachment 88352 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88353 [details] [review] 07/15] TpProtocol: add high-level API for the Addressing interface Review of attachment 88353 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88354 [details] [review] 08/15] TpPresenceMixin: deprecate optional arguments other than "message" Review of attachment 88354 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88355 [details] [review] 09/15] TpPresenceMixin: fix indentation Review of attachment 88355 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88356 [details] [review] 10/15] TpPresenceStatusSpec: add some accessors Review of attachment 88356 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88357 [details] [review] 11/15] TpPresenceStatusSpec: be a boxed type Review of attachment 88357 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88358 [details] [review] 12/15] Emit a new TpProtocol's immutable properties as debug messages Review of attachment 88358 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88359 [details] [review] 13/15] TpProtocol: parse status specs from .manager files Review of attachment 88359 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88360 [details] [review] 14/15] TpProtocol: add API for presence statuses Review of attachment 88360 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 88361 [details] [review] 15/15] TpProtocol: improve debug Review of attachment 88361 [details] [review]: ----------------------------------------------------------------- ++
(In reply to comment #19) > > AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_34], [Ignore post 2.34 deprecations]) > > We don't build with 2.36 as min required? Not yet. I hadn't confirmed whether it works.
Created attachment 89036 [details] [review] [1/2] Stop calling g_type_init() It was deprecated in GLib 2.36, and we already have a hard dependency on that version.
Created attachment 89037 [details] [review] [2/2] Enable GLib 2.36 deprecation warnings --- As Guillaume suggested.
I committed the rest. Feature request fixed in git for 0.23.0; the two patches left for review are just cleanup.
Comment on attachment 89036 [details] [review] [1/2] Stop calling g_type_init() Review of attachment 89036 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 89037 [details] [review] [2/2] Enable GLib 2.36 deprecation warnings Review of attachment 89037 [details] [review]: ----------------------------------------------------------------- ++
Thanks, cleanup applied for 0.23.1.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.