enigma Crash Log
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/enigma2/python/mytest.py", line 560, in ?
runScreenTest()
File "/usr/lib/enigma2/python/mytest.py", line 490, in runScreenTest
runNextScreen(session, screensToRun)
File "/usr/lib/enigma2/python/mytest.py", line 486, in runNextScreen
session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen)
File "/usr/lib/enigma2/python/mytest.py", line 267, in openWithCallback
dlg = self.open(screen, *arguments, **kwargs)
File "/usr/lib/enigma2/python/mytest.py", line 277, in open
dlg = self.current_dialog = self.instantiateDialog(screen, *arguments, **kwargs)
File "/usr/lib/enigma2/python/mytest.py", line 200, in instantiateDialog
return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)
File "/usr/lib/enigma2/python/mytest.py", line 225, in doInstantiateDialog
readSkin(dlg, None, dlg.skinName, desktop)
File "/usr/lib/enigma2/python/skin.py", line 329, in readSkin
raise SkinError("component with name '" + wname + "' was not found in skin of screen '" + name + "'!")
SkinError: component with name 'myowntext' was not found in skin of screen 'InfoBar'!
------------------------------------------------------------
Alles anzeigen
in In my skin.xml
<widget name="myowntext" render="Label" position="345,86" zPosition="2" size="290,20" font="Regular;18" valign="top" halign="right" transparent="1" foregroundColor="LabelForegroundText_1"/>
Source:
And inside my simple code
class MySkin(Screen):
skin = """
<screen position="180,100" size="300,410" title="Tracer Menu" >
<widget name="menu" position="10,10" size="490,390" scrollbarMode="showOnDemand" />
</screen>"""
def __init__(self, session, args = 0):
self.skin = MySkin.skin
self.session = session
Screen.__init__(self, session)
self.menu = args
list = []
list.append((_("1st menu"), "0_1"))
self["actions"] = ActionMap(["WizardActions", "DirectionActions"],{"ok": self.go,"back": self.close,}, -1)
self["myowntext"] = Label(_('MyOwnText!'))
def go(self):
returnValue = self["menu"].l.getCurrentSelection()[1]
if returnValue is not None:
if returnValue is "o_1":
self.session.open(1)
Alles anzeigen
For example
my "wdiget" it will be name of somethink from file
myfile = os.path.exists('/tmp/text.info'
if myfile:
myfile = file('/tmp/text.info', 'r')
thisfile = myfile.read()
myfile.close()
self["myowntext"] = Label(thisfile)
else:
self["myowntext"] = Label(_('Sorry file does not exist!'))
And I can not this widgets shows in Infobar it should re-read file like eTimer in enigma 1
myfile = file('/tmp/text.info', 'r')
Thx for Help