[Kde-pim] Hooks for Akonadi resource using Python

Stephen Kelly steveire at gmail.com
Thu Aug 18 13:05:58 BST 2011


Mario Santagiuliana wrote:

> In data 18/8/2011 13:24:42, Stephen Kelly ha scritto:
>> It is a client, not a resource.
>> 
>> However, it is not useful.
>> 
>> As soon as you create a fetch job and try to get the item out of it, you
>> might find that it is not possible.
>> 
>> You should try that next to ensure that you're not missing the hard part
>> of implementing a resource in python. The hard part is getting an email
>> object out of a Akonadi item using the kdepimlibs bindings.
>> 
>> If you're interested in python+akonadi you might be interested in my old
>> posts which showed an implementation of the Akonadi protocol in native
>> python (that is, not with bindings to the kdepimlibs library).
>> 
>> http://steveire.wordpress.com/2009/10/09/holy-grail-no-thanks-weve-alrea
>> dy-got-one/
> Thank you Stephen, I just see your blog :)
> It is important for me read more things as possible about akonadi and
> python!
> 
> Thank you

I don't know how pyqt does signals and slots

What is the python equivalent of this code:


class SomeObject : public QObject
{
  Q_OBJECT
public:
  SomeObject(QObject *parent = 0)
    : QObject(parent)
  {
    Item itemToFetch(itemId);
    Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob(itemToFetch);
    connect(job, SLOT(result(KJob*)), SLOT(onJobDone(KJob*)));
  }

private slots:
  void onJobDone(KJob *job)
  {
    qDebug() << job;
  }

};

int main(int argc, char **argv)
{
  QApplication app(argc, argv);

  SomeObject o;
 
  return app.exec();
}

?

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list