How to write file from plugin

melindo

Vu+ Newbie
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!
 

AlexWilMac

Moderator
Even if your message it's not very clear, it seems you need to edit some python files.
Do you know how to connect by a FTP client (like Filezilla or the like) to your VU+?
If so, many of the files you mentioned are in the folders under
/usr/lib/enigma2/python
but they are compiled python files. In order to edit them, you need to decompile them.
Consider that you can make your enigma2 system impossible to boot if you do something wrong. You may consider to perform a full backup before doing these experiments ;)
Otherwise you'll have to reflash your box (if it's a STB you have, because you did not tell us anything).
 
Top