Data Engine/QML/Python Guidance Needed

Aaron J. Seigo aseigo at kde.org
Mon Aug 15 09:34:11 UTC 2011


On Saturday, August 13, 2011 17:07:31 Eric Mesa wrote:
> Now, views.py, the program script it's calling is returning a tuple with the
> first entry being an XML object and the second being a list.

complex types from Python will not be able to be used from users of the 
DataEngine. the data is being exported from the Python runtime, after all. 
you'll need to simplify the returns, e.g. turn the XML into a string and the 
provide the list as a separate key/value pair.

> Second, how could I cobble together a quick script to grab from
> thatdataengine to be able to test the data coming out of there?

a plasmoid with a text label connected to the engine is often quickest.

> Third, is there a way to make the dataengine grab the data
> automatically?

i'm not sure what you mean by "automatically"?

> Right now, when I use the Plasma Engine Explorer and type 25, 50, or 75,
> itgrabs the data.  But this process takes a long time 5+ minutes or more. 
> SoI'd like it to happen when the plasmoid starts, I guess. 

when something calls connectToSource, if the source does not exist, then the 
DataEngine's sourceRequestEvent is called and the engine can start its process 
of data fetching then. in other words, when the first plasmoid requests a 
source for the first time, the DataEngine will start the fetch.

> And I'd want it to update all of them. 

them == the plasmoids or the sources? if plasmoids, that's handled 
automatically for you. if source, that's up to the DataEngine and depends on 
whether the data is gathered on demand or if the data is pushed to the 
DataEngine from an external source (as e.g. hotplug events are)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20110815/6205986a/attachment.sig>


More information about the Plasma-devel mailing list