Hello.
I'm looking for a simple sample code to use Console() in Enigma2. Unfortunately, I found nothing on GitHub servers. Although there are many examples of different algorithms, I still do not understand them. I always get some mistake. I try everything possible. Unfortunately, I still do not know exactly how Console is used in Enigma2. I can not start the enigma2 graphic display on the screen. Do not also need to use the Screen Class to invoke the console ?
Any suggestions ?
Thanks.
Here is my simple example code for the Plugin I'm trying to call a console in Enigma:
Python
from Plugins.Plugin import PluginDescriptor
from Components.Console import Console
class konzola(Console):
def __init__(self, session):
self.skinName = None
self.cmdlist = ("ping -c 1 www.openpli.org", "ping -c 1 www.google.nl")
self.Console = Console()
self.funguj()
def funguj(self):
if not self.Console:
self.Console = Console()
self.Console.ePopen(self.cmdlist, self.funcFinished)
def funcFinished(self, data, retval, extra_args = None):
if retval == 0:
print('all done')
else:
print('failed')
def pluginOpen(session, **kwargs):
session.open(konzola)
def Plugins(**kwargs):
return PluginDescriptor(
name = "plugin 97",
description = _("testing the console into GUI"),
where = [ PluginDescriptor.WHERE_EXTENSIONSMENU , PluginDescriptor.WHERE_PLUGINMENU ] ,
icon = "../lesson_01/ihad_tut.png",
fnc = pluginOpen)
Alles anzeigen