Querying the dict dataengine
alan moore
me at alandmoore.com
Sun Aug 16 06:07:13 CEST 2009
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.
More information about the Plasma-devel
mailing list