[Kde-pim] Hooks for Akonadi resource using Python

Stephen Kelly steveire at gmail.com
Thu Aug 18 12:24:42 BST 2011


Mario Santagiuliana <fedora <at> marionline.it> writes:

> 
> In data 18/8/2011 09:17:17, Kevin Krammer ha scritto:
> > Not stupid at all, there are quite some concepts to get to know and
> > understand 
> > 
> > :)
> > 
> > Cheers,
> > Kevin
> 
> Thanks a lot! :)
> I will study the documentation and the pykde library, I will create a first 
> example of akonadi resorce as soon as possible.
> 
> I will ask here if I don't understand anything ok?
> 
> Thank you

You might be interested in my experiment with python+Akonadi:


#! /usr/bin/env python

import sys
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs
from PyKDE4.kdeui import KApplication

from PyKDE4.akonadi import Akonadi

appName     = "PyAkonadi"
catalog     = ""
programName = ki18n ("PyAkonadi")
version     = "0.1"

aboutData   = KAboutData (appName, catalog, programName, version)
KCmdLineArgs.init (sys.argv, aboutData)
app = KApplication ()

Akonadi.Control.start()

view = Akonadi.EntityTreeView()
view.show()
monitor = Akonadi.ChangeRecorder()
model = Akonadi.EntityTreeModel(monitor)
view.setModel(model)

app.exec_()


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-already-got-one/


_______________________________________________
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