Hi!
I'm a newbi about python and plugin.
I need to write a file in my enigma box from ir-remote input.
I have found this plugin that display an input box, how can I add this keyboar input in a file on my box?
from Screens.Screen import Screen
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.Input import Input
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
###########################################################################
class MsgInput(Screen):
skin = """
<screen position="130,150" size="460,150" title="Insert input" >
<widget name="myLabel" position="10,60" size="200,40"
font="Regular;20"/>
</screen>"""
def __init__(self, session, args = 0):
self.session = session
Screen.__init__(self, session)
self["myLabel"] = Label(_("please press OK"))
self["myActionMap"] = ActionMap(["SetupActions"],
{
"ok": self.myInput,
"cancel": self.cancel
}, -1)
def myInput(self):
self.session.openWithCallback(self.askForWord, InputBox,
title=_("Insert input"), text=" " * 55, maxSize=55,
type=Input.TEXT)
def askForWord(self, word):
if word is None:
pass
else:
self.session.open(MessageBox,_(word), MessageBox.TYPE_INFO)
def cancel(self):
print "\n[MsgInput] cancel\n"
self.close(None)
###########################################################################
def main(session, **kwargs):
print "\n[MsgInput] start\n"
session.open(MsgInput)
###########################################################################
def Plugins(**kwargs):
return PluginDescriptor(
name="Insert input",
description="Insert input",
where = PluginDescriptor.WHERE_PLUGINMENU,
icon="../ihad_tut.png",
fnc=main)
thks a lot!
I'm a newbi about python and plugin.
I need to write a file in my enigma box from ir-remote input.
I have found this plugin that display an input box, how can I add this keyboar input in a file on my box?
from Screens.Screen import Screen
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.Input import Input
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
###########################################################################
class MsgInput(Screen):
skin = """
<screen position="130,150" size="460,150" title="Insert input" >
<widget name="myLabel" position="10,60" size="200,40"
font="Regular;20"/>
</screen>"""
def __init__(self, session, args = 0):
self.session = session
Screen.__init__(self, session)
self["myLabel"] = Label(_("please press OK"))
self["myActionMap"] = ActionMap(["SetupActions"],
{
"ok": self.myInput,
"cancel": self.cancel
}, -1)
def myInput(self):
self.session.openWithCallback(self.askForWord, InputBox,
title=_("Insert input"), text=" " * 55, maxSize=55,
type=Input.TEXT)
def askForWord(self, word):
if word is None:
pass
else:
self.session.open(MessageBox,_(word), MessageBox.TYPE_INFO)
def cancel(self):
print "\n[MsgInput] cancel\n"
self.close(None)
###########################################################################
def main(session, **kwargs):
print "\n[MsgInput] start\n"
session.open(MsgInput)
###########################################################################
def Plugins(**kwargs):
return PluginDescriptor(
name="Insert input",
description="Insert input",
where = PluginDescriptor.WHERE_PLUGINMENU,
icon="../ihad_tut.png",
fnc=main)
thks a lot!