#4503 NORM Never A: Reduce Tubes boilerplate in activities by setting up Telepathy bits in sugar.presence
Zarro Boogs per Child
bugtracker at laptop.org
Mon Oct 29 13:17:47 EDT 2007
#4503: Reduce Tubes boilerplate in activities by setting up Telepathy bits in
sugar.presence
---------------------------+------------------------------------------------
Reporter: smcv | Owner: smcv
Type: defect | Status: new
Priority: normal | Milestone: Never Assigned
Component: sugar | Version:
Keywords: collaboration | Verified: 0
---------------------------+------------------------------------------------
Part of #3949. While converting read-activity to use Tubes, I was annoyed
by the amount of Tubes boilerplate I had to write, so I've moved some of
it into sugar.presence.
The effect is that by the time you get the joined or shared signal in the
activity code:
* self._shared_activity has attributes telepathy_conn (a telepathy-python
Connection), telepathy_text_chan (a telepathy-python Channel) and
telepathy_tubes_chan (another Channel)
* all have had their interfaces retrieved and are thus ready for immediate
use
Results:
read-activity: 1 file changed, 9 insertions(+), 61 deletions(-)
connect-activity: 1 file changed, 4 insertions(+), 44 deletions(-)
The code I added to sugar.presence is longer than the code deleted from
each activity; however, it's better quality (it only makes one blocking
D-Bus call, and that could be made asynchronous with a small API addition
in PS).
In future we can consider making the 'joined' and 'shared' signals imply
that more setup has been done, for instance:
* listing tubes and hooking up to the new_tube signal
* listing the activity's participants and hooking up to change signals
--
Ticket URL: <https://dev.laptop.org/ticket/4503>
One Laptop Per Child <https://dev.laptop.org>
OLPC bug tracking system
More information about the Bugs
mailing list