← Back to team overview

ulc-devs team mailing list archive

Re: libfolks backport

 

Hi Patrick,

Am Dienstag, den 03.01.2012, 00:36 +0100 schrieb Patrick Seemann:

> first of all, I wish all of you a Happy New Year. I hope you all had a
> good time over Christmas and New Year's.

I wish the same to you!

> Don't know about you, but in my family Christmas time is always very
> busy.

Yes, it surely is. I did not expect much to happen on the lens during
the holidays. :-)

> But anyway, after finishing a book I had to read for English class
> "The White Tiger" by Aravind Adiga (a story about an Indian
> entrepreneur - very interesting!)

Oh yes, it is a great book. :-)

> earlier today, I wanted to try accessing libfolks from python.

> 
> Unfortunately, Frederik, your ppa didn't work for me because I'm using
> ubuntu precise. So I while I was compiling folks-0.6.6 by myself, I
> realized that I already have version 0.6.6 installed. This is what is
> currently installed on my system:
> 
> 
> folks-common             0.6.6-1      library to aggregates people
> into metacontacts (common files)
> gir1.2-folks-0.6            0.6.6-1      library to aggregates people
> into metacontacts - GObject-Introspection
> libfolks-dev                 0.6.6-1      library to aggregates people
> into metacontact - development files
> libfolks-eds25             0.6.6-1      Evolution-data-server backend
> for libfolks
> libfolks-telepathy25     0.6.6-1       elepathy backend for libfolks
> libfolks25                  0.6.6-1        library to aggregates
> people into metacontacts

Great! I discovered an issue with my version of folks and the default
empathy with Ubuntu Oneiric, probably I did not also recompile empathy.
So the packages in the PPA are only a temporary workaround for those
still using Oneiric. I also thought that it might be worth using Precise
as development platform and primary target, since it ships the required
packages.

Once we got something working, we can still think about backporting to
Oneiric and providing the required files in our PPA.
> 
> I'm now running into the same problem as Frederik was before. I can
> import Folks from gi.repository but when I do:
> 
> 
> agg= Folks.IndividualAggregator()
> agg.prepare()
> 
> 
> I get the same error:
> File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in
> function
>     return info.invoke(*args, **kwargs)
> TypeError: prepare() takes exactly 3 arguments (1 given)
> 
> 
> Any Ideas?

I got a hint on the telepathy mailing list: Since Vala is more tailored
towards GObject than other languages, Vala sometimes has a more
convenient API than C or other non-GObject languages. This affects
asynchronous callbacks, for example. For this reason, python uses an API
more similar to the C API than to the Vala API, and we need to pass
additional parameters. I wrote a simple example:

from gi.repository import Folks

def callback(source, result, user_data=None):
    pass

agg = Folks.IndividualAggregator()
agg.prepare(callback, None)

You can try this, maybe it helps.

Regards
Frederik



References