DataEngineScript Class Reference
from PyKDE4.plasma import *
Inherits: Plasma.ScriptEngine → QObject
Namespace: Plasma
Detailed Description
DataEngineScript plasma/scripting/dataenginescript.h <Plasma/Scripting/DataEngineScript>
Provides a restricted interface for scripting a DataEngine
Methods |
| __init__ (self, QObject parent=0) |
Plasma.DataEngine | dataEngine (self) |
QString | mainScript (self) |
int | minimumPollingInterval (self) |
Plasma.Package | package (self) |
| removeAllData (self, QString source) |
| removeAllSources (self) |
| removeData (self, QString source, QString key) |
Plasma.Service | serviceForSource (self, QString source) |
| setData (self, QString source, QString key, QVariant value) |
| setData (self, QString source, QVariant value) |
| setDataEngine (self, Plasma.DataEngine dataEngine) |
| setMaxSourceCount (self, long limit) |
| setMinimumPollingInterval (self, int minimumMs) |
| setPollingInterval (self, long frequency) |
bool | sourceRequestEvent (self, QString name) |
QStringList | sources (self) |
bool | updateSourceEvent (self, QString source) |
Method Documentation
__init__ |
( |
self, |
|
|
|
QObject |
parent=0 |
|
) |
|
|
|
Default constructor for a DataEngineScript.
Subclasses should not attempt to access the Plasma.DataEngine
associated with this DataEngineScript in the constructor. All
such set up that requires the DataEngine itself should be done
in the init() method.
Returns the Plasma.DataEngine associated with this script component
- Returns:
- absolute path to the main script file for this plasmoid
int minimumPollingInterval |
( |
|
self ) |
|
- Returns:
- the Package associated with this plasmoid which can
be used to request resources, such as images and
interface files.
removeAllData |
( |
self, |
|
|
|
QString |
source |
|
) |
|
|
|
removeAllSources |
( |
|
self ) |
|
- Parameters:
-
| source | the source to targe the Service at
|
- Returns:
- a Service that has the source as a destination. The service
is parented to the DataEngine, but may be deleted by the
caller when finished with it
Sets the Plasma.DataEngine associated with this DataEngineScript
setMaxSourceCount |
( |
self, |
|
|
|
long |
limit |
|
) |
|
|
|
setMinimumPollingInterval |
( |
self, |
|
|
|
int |
minimumMs |
|
) |
|
|
|
setPollingInterval |
( |
self, |
|
|
|
long |
frequency |
|
) |
|
|
|
bool sourceRequestEvent |
( |
self, |
|
|
|
QString |
name |
|
) |
|
|
|
Called when the script should create a source that does not currently
exist.
- Parameters:
-
| name | the name of the source that should be created
|
- Returns:
- true if a DataContainer was set up, false otherwise
- Returns:
- a list of all the data sources available via this DataEngine
Whether these sources are currently available (which is what
the default implementation provides) or not is up to the
DataEngine to decide. By default, this returns dataEngine()->sources()
bool updateSourceEvent |
( |
self, |
|
|
|
QString |
source |
|
) |
|
|
|
Called when the script should refresh the data contained in a given
source.
- Parameters:
-
| source | the name of the source that should be updated
|
- Returns:
- true if the data was changed, or false if there was no
change or if the change will occur later