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

List:       kde-panel-devel
Subject:    Problems with DataEngine in Python
From:       John Hobbs <john () velvetcache ! org>
Date:       2009-07-26 18:44:29
Message-ID: ffd9db5b0907261144w6da6561bo262dfa332332db29 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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/

[Attachment #5 (text/html)]

Hello,<br><br>I&#39;ve been trying to write my first Plasmoid in python, and I&#39;ve \
been stuck on using the DataEngines [1].  I&#39;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&#39;m getting an error:<span \
style="font-family: courier new,monospace;"> <b>AttributeError: &#39;DataEngine&#39; \
object has no attribute &#39;serviceForSource&#39;</b></span> even though the api \
says it should be there [3]<br> <br>Here is the chunk that is erroring out on \
me:<br><br style="font-family: courier new,monospace;"><span style="font-family: \
courier new,monospace;">  self.engine = \
self.dataEngine(&quot;microblog&quot;)</span><br style="font-family: courier \
new,monospace;"> <span style="font-family: courier new,monospace;">  if not \
self.engine.isValid:</span><br style="font-family: courier new,monospace;"><span \
style="font-family: courier new,monospace;">    self.setFailedToLaunch(True, \
&quot;Could not get DataEngine&quot;)</span><br> <span style="font-family: courier \
new,monospace;">  service = self.engine.serviceForSource(&quot;Timeline:Jmhobbs@<a \
href="https://twitter.com/">https://twitter.com/</a>&quot;)</span><br \
style="font-family: courier new,monospace;"> <span style="font-family: courier \
new,monospace;">  cg = service.operationDescription(&quot;auth&quot;);</span><br \
style="font-family: courier new,monospace;"><span style="font-family: courier \
new,monospace;">  cg.writeEntry(&quot;password&quot;, \
&quot;SuperSecret&quot;);</span><br style="font-family: courier new,monospace;"> \
<span style="font-family: courier new,monospace;">  \
service.startOperationCall(cg);</span><br><br>I&#39;m running  Python 2.5.4, and KDE \
- 4.2.4  (Debian sid)<br><br>My questions are,<br><ol><li>Is there something \
fundamentally wrong with my understanding on how to use DataEngines?</li> <li>Is \
there just a version mismatch between the bindings (as documented) and my \
system?</li><li>Is there documentation on the microblog engine and how to use \
it?</li><li>Do I have an alternative? I tried QThreads/urllib (crashes \
unpredictably), and KIO (KUrl seems to ignore setUser() and setPass()) already to no \
avail.<br> </li></ol>Thanks so much in advance for your assistance.  I&#39;m looking \
forward to creating more community content once I iron this stuff out \
:-)<br><blockquote style="margin: 1.5em 0pt;"></blockquote>[1] - <a \
href="http://techbase.kde.org/Development/Tutorials/Plasma/Python/Using_DataEngines">h \
ttp://techbase.kde.org/Development/Tutorials/Plasma/Python/Using_DataEngines</a><br> \
[2] - <a href="http://websvn.kde.org/trunk/KDE/kdeplasma-addons/applets/microblog/micr \
oblog.cpp?view=markup">http://websvn.kde.org/trunk/KDE/kdeplasma-addons/applets/microblog/microblog.cpp?view=markup</a><br>[3] \
- <a href="http://api.kde.org/pykde-4.2-api/plasma/Plasma.DataEngine.html#obj306560273 \
2">http://api.kde.org/pykde-4.2-api/plasma/Plasma.DataEngine.html#obj3065602732</a><br>
 <br clear="all">- John Hobbs<br><br><a \
href="mailto:john@velvetcache.org">john@velvetcache.org</a><br><br><a \
href="http://www.velvetcache.org/">http://www.velvetcache.org/</a><br>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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