Creating a plugin

cyberss

Vu+ Newbie
Hello guys,

I am trying to create a plugin for vu+ blackhole 2.0.5. I started with a simple plugin that will show a message box when you click OK button and when it show the message below the text box wiill show the green and red button with download and exit actions in this two buttons.

The plugin code is correct, it is showing in plugins menu of the receiver but when i click the OK button the receiver crash with error:

Looking for embedded skin
Traceback (most recent call last):
File "/usr/lib/enigma2/python/Components/ActionMap.py", line 46, in action
res = self.actions[action]()
File "/usr/lib/enigma2/python/Blackhole/BhGreen.py", line 44, in save
File "/usr/lib/enigma2/python/Blackhole/BhGreen.py", line 50, in run
File "/usr/lib/enigma2/python/Plugins/Extensions/LiveCameras/plugin.py", line 52, in main
session.open(CallMyMsg)
File "/usr/lib/enigma2/python/mytest.py", line 312, in open
dlg = self.current_dialog = self.instantiateDialog(screen, *arguments, **kwargs)
File "/usr/lib/enigma2/python/mytest.py", line 247, in instantiateDialog
return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)
File "/usr/lib/enigma2/python/mytest.py", line 272, in doInstantiateDialog
readSkin(dlg, None, dlg.skinName, desktop)
File "/usr/lib/enigma2/python/skin.py", line 523, in readSkin
raise SkinError("component with name '" + wname + "' was not found in skin of screen '" + name + "'!")
skin.SkinError: {skin.xml}: component with name 'menu' was not found in skin of screen '<embedded-in-'CallMyMsg'>'!
(PyObject_CallObject(<bound method ActionMap.action of <Components.ActionMap.ActionMap instance at 0x1b2aee0>>,('WizardActions', 'ok')) failed)
getResolvedKey config.plugins.crashlogautosubmit.sendAnonCrashlog failed !! (Typo??)
resolve: resolve ${sysconfdir}/enigma2/settings
resolve: -> /etc/enigma2/settings
getResolvedKey config.plugins.crashlogautosubmit.addNetwork failed !! (Typo??)
resolve: resolve ${sysconfdir}/enigma2/settings
resolve: -> /etc/enigma2/settings
getResolvedKey config.plugins.crashlogautosubmit.addWlan failed !! (Typo??)
resolve: resolve ${sysconfdir}/enigma2/settings
resolve: -> /etc/enigma2/settings
]]>
</enigma2crashlog>
<pythonMD5sum>
Any help will be appreciated because i cannot find any error or problem in my code.

Thank you in advance.
 

cyberss

Vu+ Newbie
My code is:

from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.Label import Label
import xml.dom.minidom
import os
class CallMyMsg(Screen):
skin = """
<screen position="130,150" size="460,150" title="Live Cameras" >
<widget name="menu" position="10,60" size="400,120" font="Regular;20"/>
</screen>
"""
def __init__(self, session):
self.skin = CallMyMsg.skin
self.session = session
Screen.__init__(self, session)
self["menu"] = Label(_("please press OK to select"))
self["statusbar"] = StaticText(_("Select a bouquet to add a channel to"))
self["key_red"] = StaticText(_("Cancel"))
self["key_green"] = StaticText(_("Ok"))
self["actions"] = ActionMap(["SetupActions"],
{
"ok": self.myMsg,
"cancel": self.keyCancel,
"green": self.myMsg,
"red": self.keyCancel,
}, -2)
def callMyMsg(self, result):
print "\n[CallMyMsg] checking result\n"
if result:
print "\n[CallMyMsg] cancel\n"
self.close(None)
else:
self.session.open(MessageBox,_("My plugin is working!\n;-)"), MessageBox.TYPE_INFO)
def myMsg(self):
print "\n[CallMyMsg] OK pressed \n"
self.session.openWithCallback(self.callMyMsg, MessageBox, _("Do you want to exit the plugin?"), MessageBox.TYPE_YESNO)
def keyCancel(self):
print "\n[CallMyMsg] cancel\n"
self.close(None)
###########################################################################
def main(session, **kwargs):
print "\n[CallMyMsg] start\n"
session.open(CallMyMsg)
###########################################################################
def Plugins(**kwargs):
return PluginDescriptor(
name="Live Cameras",
description="View Live Cameras",
where = [ PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU ],
#where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart)
icon = "plugin.png", fnc = main)
 
Top