Bug 71048 - TpProtocol: high-level API for D-Bus methods, P.I.Presence, P.I.Addressing
Summary: TpProtocol: high-level API for D-Bus methods, P.I.Presence, P.I.Addressing
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium enhancement
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks: 70731
  Show dependency treegraph
 
Reported: 2013-10-30 12:53 UTC by Simon McVittie
Modified: 2014-01-07 14:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
[01/15] inspect-cm.py: on errors, exit rather than blocking forever (1.39 KB, patch)
2013-10-30 12:53 UTC, Simon McVittie
Details | Splinter Review
02/15] TpProtocol: parse_default_value: take raw value as a parameter (3.03 KB, patch)
2013-10-30 12:54 UTC, Simon McVittie
Details | Splinter Review
03/15] _tp_protocol_parse_rcc: produce debug output (2.71 KB, patch)
2013-10-30 12:54 UTC, Simon McVittie
Details | Splinter Review
04/15] Require GLib 2.36, for GTask (978 bytes, patch)
2013-10-30 12:54 UTC, Simon McVittie
Details | Splinter Review
05/15] tp_protocol_normalize_contact_async: add and test (6.36 KB, patch)
2013-10-30 12:55 UTC, Simon McVittie
Details | Splinter Review
06/15] tp_protocol_identify_account_async: add and test (8.01 KB, patch)
2013-10-30 12:55 UTC, Simon McVittie
Details | Splinter Review
07/15] TpProtocol: add high-level API for the Addressing interface (18.60 KB, patch)
2013-10-30 12:56 UTC, Simon McVittie
Details | Splinter Review
08/15] TpPresenceMixin: deprecate optional arguments other than "message" (2.24 KB, patch)
2013-10-30 12:56 UTC, Simon McVittie
Details | Splinter Review
09/15] TpPresenceMixin: fix indentation (900 bytes, patch)
2013-10-30 12:57 UTC, Simon McVittie
Details | Splinter Review
10/15] TpPresenceStatusSpec: add some accessors (5.48 KB, patch)
2013-10-30 12:58 UTC, Simon McVittie
Details | Splinter Review
11/15] TpPresenceStatusSpec: be a boxed type (6.25 KB, patch)
2013-10-30 12:58 UTC, Simon McVittie
Details | Splinter Review
12/15] Emit a new TpProtocol's immutable properties as debug messages (1.08 KB, patch)
2013-10-30 12:58 UTC, Simon McVittie
Details | Splinter Review
13/15] TpProtocol: parse status specs from .manager files (3.67 KB, patch)
2013-10-30 12:59 UTC, Simon McVittie
Details | Splinter Review
14/15] TpProtocol: add API for presence statuses (4.38 KB, patch)
2013-10-30 13:00 UTC, Simon McVittie
Details | Splinter Review
15/15] TpProtocol: improve debug (2.85 KB, patch)
2013-10-30 13:00 UTC, Simon McVittie
Details | Splinter Review
[1/2] Stop calling g_type_init() (33.22 KB, patch)
2013-11-11 17:22 UTC, Simon McVittie
Details | Splinter Review
[2/2] Enable GLib 2.36 deprecation warnings (901 bytes, patch)
2013-11-11 17:22 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2013-10-30 12:53:10 UTC
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.
Comment 1 Simon McVittie 2013-10-30 12:53:58 UTC
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.
Comment 2 Simon McVittie 2013-10-30 12:54:18 UTC
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.
Comment 3 Simon McVittie 2013-10-30 12:54:29 UTC
Created attachment 88349 [details] [review]
03/15] _tp_protocol_parse_rcc: produce debug output
Comment 4 Simon McVittie 2013-10-30 12:54:58 UTC
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.
Comment 5 Simon McVittie 2013-10-30 12:55:19 UTC
Created attachment 88351 [details] [review]
05/15] tp_protocol_normalize_contact_async: add and test
Comment 6 Simon McVittie 2013-10-30 12:55:43 UTC
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.
Comment 7 Simon McVittie 2013-10-30 12:56:03 UTC
Created attachment 88353 [details] [review]
07/15] TpProtocol: add high-level API for the Addressing  interface
Comment 8 Simon McVittie 2013-10-30 12:56:56 UTC
Created attachment 88354 [details] [review]
08/15] TpPresenceMixin: deprecate optional arguments other  than "message"

Our D-Bus API no longer supports anything else.
Comment 9 Simon McVittie 2013-10-30 12:57:34 UTC
Created attachment 88355 [details] [review]
09/15] TpPresenceMixin: fix indentation
Comment 10 Simon McVittie 2013-10-30 12:58:04 UTC
Created attachment 88356 [details] [review]
10/15] TpPresenceStatusSpec: add some accessors
Comment 11 Simon McVittie 2013-10-30 12:58:44 UTC
Created attachment 88357 [details] [review]
11/15] TpPresenceStatusSpec: be a boxed type
Comment 12 Simon McVittie 2013-10-30 12:58:59 UTC
Created attachment 88358 [details] [review]
12/15] Emit a new TpProtocol's immutable properties as debug  messages
Comment 13 Simon McVittie 2013-10-30 12:59:44 UTC
Created attachment 88359 [details] [review]
13/15] TpProtocol: parse status specs from .manager files
Comment 14 Simon McVittie 2013-10-30 13:00:05 UTC
Created attachment 88360 [details] [review]
14/15] TpProtocol: add API for presence statuses
Comment 15 Simon McVittie 2013-10-30 13:00:29 UTC
Created attachment 88361 [details] [review]
15/15] TpProtocol: improve debug
Comment 16 Guillaume Desmottes 2013-10-31 08:32:37 UTC
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 17 Guillaume Desmottes 2013-10-31 08:33:29 UTC
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 18 Guillaume Desmottes 2013-10-31 08:34:00 UTC
Comment on attachment 88349 [details] [review]
03/15] _tp_protocol_parse_rcc: produce debug output

Review of attachment 88349 [details] [review]:
-----------------------------------------------------------------

++
Comment 19 Guillaume Desmottes 2013-10-31 08:34:52 UTC
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 20 Guillaume Desmottes 2013-10-31 08:37:23 UTC
Comment on attachment 88351 [details] [review]
05/15] tp_protocol_normalize_contact_async: add and test

Review of attachment 88351 [details] [review]:
-----------------------------------------------------------------

++
Comment 21 Guillaume Desmottes 2013-10-31 08:39:44 UTC
Comment on attachment 88352 [details] [review]
06/15] tp_protocol_identify_account_async: add and test

Review of attachment 88352 [details] [review]:
-----------------------------------------------------------------

++
Comment 22 Guillaume Desmottes 2013-10-31 08:42:19 UTC
Comment on attachment 88353 [details] [review]
07/15] TpProtocol: add high-level API for the Addressing  interface

Review of attachment 88353 [details] [review]:
-----------------------------------------------------------------

++
Comment 23 Guillaume Desmottes 2013-10-31 08:42:46 UTC
Comment on attachment 88354 [details] [review]
08/15] TpPresenceMixin: deprecate optional arguments other  than "message"

Review of attachment 88354 [details] [review]:
-----------------------------------------------------------------

++
Comment 24 Guillaume Desmottes 2013-10-31 08:42:58 UTC
Comment on attachment 88355 [details] [review]
09/15] TpPresenceMixin: fix indentation

Review of attachment 88355 [details] [review]:
-----------------------------------------------------------------

++
Comment 25 Guillaume Desmottes 2013-10-31 08:43:50 UTC
Comment on attachment 88356 [details] [review]
10/15] TpPresenceStatusSpec: add some accessors

Review of attachment 88356 [details] [review]:
-----------------------------------------------------------------

++
Comment 26 Guillaume Desmottes 2013-10-31 08:45:20 UTC
Comment on attachment 88357 [details] [review]
11/15] TpPresenceStatusSpec: be a boxed type

Review of attachment 88357 [details] [review]:
-----------------------------------------------------------------

++
Comment 27 Guillaume Desmottes 2013-10-31 08:46:48 UTC
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 28 Guillaume Desmottes 2013-10-31 08:48:29 UTC
Comment on attachment 88359 [details] [review]
13/15] TpProtocol: parse status specs from .manager files

Review of attachment 88359 [details] [review]:
-----------------------------------------------------------------

++
Comment 29 Guillaume Desmottes 2013-10-31 08:49:17 UTC
Comment on attachment 88360 [details] [review]
14/15] TpProtocol: add API for presence statuses

Review of attachment 88360 [details] [review]:
-----------------------------------------------------------------

++
Comment 30 Guillaume Desmottes 2013-10-31 08:50:02 UTC
Comment on attachment 88361 [details] [review]
15/15] TpProtocol: improve debug

Review of attachment 88361 [details] [review]:
-----------------------------------------------------------------

++
Comment 31 Simon McVittie 2013-11-11 16:47:52 UTC
(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.
Comment 32 Simon McVittie 2013-11-11 17:22:27 UTC
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.
Comment 33 Simon McVittie 2013-11-11 17:22:49 UTC
Created attachment 89037 [details] [review]
[2/2] Enable GLib 2.36 deprecation warnings

---

As Guillaume suggested.
Comment 34 Simon McVittie 2013-11-11 17:24:29 UTC
I committed the rest. Feature request fixed in git for 0.23.0; the two patches left for review are just cleanup.
Comment 35 Guillaume Desmottes 2013-12-27 10:25:37 UTC
Comment on attachment 89036 [details] [review]
[1/2] Stop calling g_type_init()

Review of attachment 89036 [details] [review]:
-----------------------------------------------------------------

++
Comment 36 Guillaume Desmottes 2013-12-27 10:25:48 UTC
Comment on attachment 89037 [details] [review]
[2/2] Enable GLib 2.36 deprecation warnings

Review of attachment 89037 [details] [review]:
-----------------------------------------------------------------

++
Comment 37 Simon McVittie 2014-01-07 14:03:04 UTC
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.