Von der Dreambox bzw. Enigma2 System lassen mittels Python eigene Plugins erstellen. Wie zum Beispiel Youtube und ZDFMediathek Erweiterungen. Da quasi der gesamte unterbau der System auf Python basiert, kann man vieles am System schrauben. Über Kanalisten bis hin zu Aufnahmefunktionen. Leider sich die Suche nach Beispielen und Anleitung etwas mühselig, deswegen hier eine Zusammenfassung einder Links, Beispiele und PDFs, die ich so gefunden habe und ziemlich hilfreich sind.
Beispiel: Hello World
/usr/lib/enigma2/python/Plugins/Extensions/YourModule/YourModule.py
from Plugins.Plugin import PluginDescriptor
import YourModule
def main(session, **kwargs):
reload(YourModule)
try:
session.open(YourModule.YourScreen)
except:
import traceback
traceback.print_exc()
def Plugins(**kwargs):
return PluginDescriptor(name = "YourPlugin",
description = "Your test plugin",
where = PluginDescriptor.WHERE_PLUGINMENU,
fnc = main)Variablen setzen
from Components.config import config, ConfigSubsection, configfile, ConfigPassword, ConfigText
config.plugins.ShareIt = ConfigSubsection()
config.plugins.ShareIt.Key = ConfigText()
[...]
config.plugins.ShareIt.Key.value = key
config.plugins.ShareIt.save()
configfile.save()
[..]
print config.plugins.ShareIt.Key.value
self.myMsg(returnValue + config.plugins.ShareIt.Key.value)
[...]
def myMsg(self, entry):
self.session.open(MessageBox, entry, MessageBox.TYPE_INFO)