From kde-panel-devel Sun Jul 26 18:44:29 2009 From: John Hobbs Date: Sun, 26 Jul 2009 18:44:29 +0000 To: kde-panel-devel Subject: Problems with DataEngine in Python Message-Id: X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=124863391213489 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0687956312==" --===============0687956312== Content-Type: multipart/alternative; boundary=0016e646991c40ec35046fa03aea --0016e646991c40ec35046fa03aea Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been trying to write my first Plasmoid in python, and I've been stuck on using the DataEngines [1]. I'm working off of the microblog applet [2] to try and understand how to interact with that engine. My problem comes when I try to get a service from my engine. I'm getting an error: *AttributeError: 'DataEngine' object has no attribute 'serviceForSource'* even though the api says it should be there [3] Here is the chunk that is erroring out on me: self.engine = self.dataEngine("microblog") if not self.engine.isValid: self.setFailedToLaunch(True, "Could not get DataEngine") service = self.engine.serviceForSource("Timeline:Jmhobbs@ https://twitter.com/") cg = service.operationDescription("auth"); cg.writeEntry("password", "SuperSecret"); service.startOperationCall(cg); I'm running Python 2.5.4, and KDE - 4.2.4 (Debian sid) My questions are, 1. Is there something fundamentally wrong with my understanding on how to use DataEngines? 2. Is there just a version mismatch between the bindings (as documented) and my system? 3. Is there documentation on the microblog engine and how to use it? 4. Do I have an alternative? I tried QThreads/urllib (crashes unpredictably), and KIO (KUrl seems to ignore setUser() and setPass()) already to no avail. Thanks so much in advance for your assistance. I'm looking forward to creating more community content once I iron this stuff out :-) [1] - http://techbase.kde.org/Development/Tutorials/Plasma/Python/Using_DataEngines [2] - http://websvn.kde.org/trunk/KDE/kdeplasma-addons/applets/microblog/microblog.cpp?view=markup [3] - http://api.kde.org/pykde-4.2-api/plasma/Plasma.DataEngine.html#obj3065602732 - John Hobbs john@velvetcache.org http://www.velvetcache.org/ --0016e646991c40ec35046fa03aea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I've been trying to write my first Plasmoid in python, an= d I've been stuck on using the DataEngines [1].=A0 I'm working off = of the microblog applet [2] to try and understand how to interact with that= engine.=A0 My problem comes when I try to get a service from my engine.=A0= I'm getting an error: AttributeError: 'DataEngine' object has no attribute 'se= rviceForSource' even though the api says it should be there = [3]

Here is the chunk that is erroring out on me:

=A0 self.engine =3D self.dataEngine("microblog")
=A0 if not self.engine.= isValid:
=A0=A0=A0 self.setFailedToLaunch(= True, "Could not get DataEngine")
=A0 service =3D self.en= gine.serviceForSource("Timeline:Jmhobbs@https://twitter.com/")
=A0 cg =3D service.oper= ationDescription("auth");
=A0 cg= .writeEntry("password", "SuperSecret");
=A0 service.startOperat= ionCall(cg);

I'm running=A0 Python 2.5.4, and KDE - 4.2.4= =A0 (Debian sid)

My questions are,
  1. Is there something fun= damentally wrong with my understanding on how to use DataEngines?
  2. Is there just a version mismatch between the bindings (as documented) a= nd my system?
  3. Is there documentation on the microblog engine and ho= w to use it?
  4. Do I have an alternative? I tried QThreads/urllib (cra= shes unpredictably), and KIO (KUrl seems to ignore setUser() and setPass())= already to no avail.
Thanks so much in advance for your assistance.=A0 I'm looking= forward to creating more community content once I iron this stuff out :-)<= br>
[1] - http://techbase.kde.org/Development/Tutorials/Plasma/Python/Using_DataEn= gines
[2] - http://websvn.kde.org/trunk/KDE/kdepl= asma-addons/applets/microblog/microblog.cpp?view=3Dmarkup
[3] - http://api.kde.org/pykde-4.2-api/plasma/Plasma.DataEngine.html#ob= j3065602732

- John Hobbs

john@velvetcache.org

= http://www.velvetcache.org/
--0016e646991c40ec35046fa03aea-- --===============0687956312== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============0687956312==--