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

List:       kde-panel-devel
Subject:    Querying the dict dataengine
From:       alan moore <me () alandmoore ! com>
Date:       2009-08-16 4:07:13
Message-ID: 4A8785F1.4060501 () alandmoore ! com
[Download RAW message or body]

Hello; I am working on my first plasmoid (in Python), so apologies in 
advance if I'm a blockhead.

I'm trying to remake the old kicker dictionary applet.  I have code that 
works by calling the "dict" CLI command, but naturally I want to switch 
that to working with a data engine.  I'm a bit hazy on how to 
communicate with the dict dataEngine and get what I want from it; 
specifically:

  - How do I tell it what server/dictionary to use?  I saw there is a 
setServer() function in the code, but it's private.

  - More importantly, how do I connect to it and get back a definition? 
  I've played with the engine in engine explorer, and I understand the 
structure that's supposed to be coming back, but when I try it in my 
code I just get back an empty dictionary.  My code is simply:

     self.dict_engine = self.dataEngine("dict")
     mydef = self.dict_engine.query(QString(word))
     print(mydef)

I also tried using connectSource(), then assigning mydef in dataUpdated. 
  I noticed in that case that I first got an empty dictionary, then a 
few moments later the actual data I was looking for.

Where am I going wrong here?  Thanks in advance.
_______________________________________________
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