[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim]  Akonadi Resource in python
From:       Ignacio Lorenzo =?iso-8859-1?q?Garc=EDa?= <nacholore () gmail ! com>
Date:       2010-12-08 22:06:00
Message-ID: 201012082206.00300.nacholore () gmail ! com
[Download RAW message or body]

Hi,
I'm creating a resource akonadi in python, I get segmentation fault when I try 
to create Akonadi.ResourceBase.__init__(self, QString(id))
Does anyone help me?


Thanks you

["pruebat.py" (text/x-python)]

#!/usr/bin/env python
from PyKDE4.akonadi import *
from PyQt4.QtCore import QString, qDebug
import getopt, sys

class FbResource( Akonadi.ResourceBase ):
    
  def __init__(self, id = None):
    qDebug(" Llego %s" % (id))
    Akonadi.ResourceBase.__init__(self, QString(id))
    qDebug(" Llegue hasta aqui ")
#    qDebug(" Name %s" % (self.name()))
  
  def retrieveCollections( self ):
    qDebug(" It is retriveCollections")
    c = Akonadi.Collection()
    c.setParent(Akonadi.Collection.root())
    c.setRemoteId("fb-contacts");
    c.setName(QString('fb'));
    mimeTypes = QStringList('text/directory')
    c.setContentMimeTypes(mimeTypes)
    list = [c]
    collectionsRetrieved(list)
    Akonadi.ResourceBase.synchonizeCollectionTree()
    

def main():
  try:
    opts, args = getopt.getopt(sys.argv[1:], "" , ["identifier="])
  except getopt.GetoptError:
    usage()
    sys.exit(2)
  for o, a in opts:
    qDebug(" Opciones %s = %s" %( o, a))
    if o in ("--identifier"):
      fb = FbResource(a)
#      fb.synchronizeCollectionTree()
     

if __name__ == "__main__":
  main()



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic