Plasma.RunnerScript

KDE 4.9 PyKDE API Reference

- KDE's Python API

# RunnerScript Class Reference

`from PyKDE4.plasma import *`

Inherits: Plasma.ScriptEngine → QObject
Namespace: Plasma

## Detailed Description

RunnerScript plasma/scripting/runnerscript.h <Plasma/Scripting/RunnerScript>

Provides a restricted interface for scripting a runner.

## Signals
| actionsForMatch (Plasma.QueryMatch match, [QAction] actions)
| createRunOptions (QWidget widget)
| prepare ()
| reloadConfiguration ()
| teardown ()
## Methods
| __init__ (self, QObject parent=0)
QAction | action (self, QString id)
{QString:QAction} | actions (self)
QAction | addAction (self, QString id, QIcon icon, QString text)
| addAction (self, QString id, QAction action)
| addSyntax (self, Plasma.RunnerSyntax syntax)
| clearActions (self)
KConfigGroup | config (self)
Plasma.DataEngine | dataEngine (self, QString name)
KPluginInfo | description (self)
QString | mainScript (self)
| match (self, Plasma.RunnerContext search)
Plasma.Package | package (self)
| removeAction (self, QString id)
| run (self, Plasma.RunnerContext search, Plasma.QueryMatch action)
Plasma.AbstractRunner | runner (self)
[KSharedPtr] | serviceQuery (self, QString serviceType, QString constraint=QString())
| setHasRunOptions (self, bool hasRunOptions)
| setIgnoredTypes (self, Plasma.RunnerContext.Types types)
| setPriority (self, Plasma.AbstractRunner.Priority newPriority)
| setRunner (self, Plasma.AbstractRunner runner)
| setSpeed (self, Plasma.AbstractRunner.Speed newSpeed)
| setSyntaxes (self, [Plasma.RunnerSyntax] syns)

## Signal Documentation

actionsForMatch | ( | Plasma.QueryMatch | match,
|  | [QAction] | actions
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("actionsForMatch(const Plasma::QueryMatch&, QList*)"), target_slot)`

createRunOptions | ( | QWidget | widget
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("createRunOptions(QWidget*)"), target_slot)`

prepare | ( |  | ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("prepare()"), target_slot)`

reloadConfiguration | ( |  | ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("reloadConfiguration()"), target_slot)`

teardown | ( |  | ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("teardown()"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

Default constructor for a RunnerScript. Subclasses should not attempt to access the Plasma.AbstractRunner associated with this RunnerScript in the constructor. All such set up that requires the AbstractRunner itself should be done in the init() method.

QAction action | ( | self, |
|  | QString | id
| ) |  |  |

{QString:QAction} actions | ( |  | self ) |

QAction addAction | ( | self, |
|  | QString | id,
|  | QIcon | icon,
|  | QString | text
| ) |  |  |

addAction | ( | self, |
|  | QString | id,
|  | QAction | action
| ) |  |  |

addSyntax | ( | self, |
|  | Plasma.RunnerSyntax | syntax
| ) |  |  |

clearActions | ( |  | self ) |

KConfigGroup config | ( |  | self ) |

Plasma.DataEngine dataEngine | ( | self, |
|  | QString | name
| ) |  |  |

Returns:
  a Plasma.DataEngine matchin name

Since:
  4.4

KPluginInfo description | ( |  | self ) |

Returns:
  the KPluginInfo associated with this plasmoid

QString mainScript | ( |  | self ) |

Returns:
  absolute path to the main script file for this plasmoid

match | ( | self, |
|  | Plasma.RunnerContext | search
| ) |  |  |

Called when the script should create QueryMatch instances through RunnerContext.addInformationalMatch, RunnerContext.addExactMatch, and RunnerContext.addPossibleMatch.

Plasma.Package package | ( |  | self ) |

Returns:
  the Package associated with this plasmoid which can be used to request resources, such as images and interface files.

removeAction | ( | self, |
|  | QString | id
| ) |  |  |

run | ( | self, |
|  | Plasma.RunnerContext | search,
|  | Plasma.QueryMatch | action
| ) |  |  |

Called whenever an exact or possible match associated with this runner is triggered.

Plasma.AbstractRunner runner | ( |  | self ) |

Returns the Plasma.AbstractRunner associated with this script component

[KSharedPtr] serviceQuery | ( | self, |
|  | QString | serviceType,
|  | QString | constraint=QString()
| ) |  |  |

setHasRunOptions | ( | self, |
|  | bool | hasRunOptions
| ) |  |  |

setIgnoredTypes | ( | self, |
|  | Plasma.RunnerContext.Types | types
| ) |  |  |

setPriority | ( | self, |
|  | Plasma.AbstractRunner.Priority | newPriority
| ) |  |  |

setRunner | ( | self, |
|  | Plasma.AbstractRunner | runner
| ) |  |  |

Sets the Plasma.AbstractRunner associated with this RunnerScript

setSpeed | ( | self, |
|  | Plasma.AbstractRunner.Speed | newSpeed
| ) |  |  |

setSyntaxes | ( | self, |
|  | [Plasma.RunnerSyntax] | syns
| ) |  |  |