[Telepathy] telepathy-python

Diane Trout diane at ghic.org
Tue Aug 18 16:59:12 PDT 2015


Hello,

I know Gnome deprecated telepathy-python, but after needing to write a quick 
connection manager and really liking python I decided to try and update it for 
the current telepathy sepc.

My current progress is at:

https://github.com/detrout/telepathy-python

Mostly I've made sure it works with python3, though there have been a few 
other minor updates.

Some of the changes I've thought about doing more long term:

python3 has abstract base classes, perhaps the interface classes should use 
that instead of just running "raise NotImplemented" in all the _generated code 

I'm pretty sure I can replace the implementation of 
telepathy.server.Connection.GetInterfaces with introspecting on 
.__class__.__bases__ and thus remove the need for the generated code to
have an __init__ function. (Which will hopefully make it safer to use super())

Also I really want to change the API to look more like this:

from telepathy.Connection.Interface import Contacts

class MyContacts(Contacts):
    @Contacts.method(sender_keyword='sender')
    def GetContactAttribute(self, handles, interfaces, hold, sender):
        pass


instead of 

import telepathy

class MyContacts(telepathy.server.ConnectionInterfaceContacts):
    @dbus.service.method(
        dbus_interface=telepathy.CONNECTION_INTERFACE_CONTACT_CAPABILITIES,
        in_signature="au"
        out_signature="a{ua(a({sv}as)}",
        sender_keyword='sender')
    def GetContactAttributes(self, handles,interfaces, hold, sender)


Though it might need to be
from telepathy.connection.interface.contacts import Contacts
and I'm not completely sure if hiding the dbus type signature is a good idea.

Also I'd like to modify the setup.py script to use lxml to do the xslt 
transformation instead of using autotools & xsltproc.

I was thinking of trying to make this version of telepathy-python more closely 
track the TelepathyQt version (since the official glib way is to use 
gi.repository version)

And lastly python has some really nice documentation tools so it might be 
generally useful to try and create documentation

Diane


More information about the telepathy mailing list