[Telepathy] libgee and PyGI

Frederik Elwert frederik.elwert at web.de
Sat Jan 28 01:43:26 PST 2012


Hello,

I am currently trying to write a libfolks client in Python using the
GObject Introspection system. Thanks to the help of the telepathy team,
accessing libfolks itself basically works now.

However, I am currently stuck with accessing the actual data. Libfolks
returns libgee data structures. When trying to access these, I am
getting segfaults. Since I could not find any example of how one could
use libgee objects from Python at all, I am struggling with creating a
minimal test case that could help identifying the root cause of the
crash.

Here is my current attempt:

----8<----
from gi.repository import GObject
from gi.repository import Folks


def list_individuals():
    iterator = aggregator.props.individuals.props.keys.iterator()
    while iterator.next():
        key = iterator.get()
        print aggregator.props.individuals.get(key)

aggregator = Folks.IndividualAggregator.new()
aggregator.prepare(None, None)

GObject.timeout_add(2000, list_individuals)

main_loop = GObject.MainLoop()
main_loop.run()
---->8----

The current conversation on the telepathy list is here:
http://lists.freedesktop.org/archives/telepathy/2012-January/005951.html

Maybe someone with deeper knowledge of libgee could help?

Regards
Frederik



More information about the telepathy mailing list