Jump to content


Photo

Problem with PluginList


  • Please log in to reply
1 reply to this topic

#1 canymed112

  • Member
  • 23 posts

0
Neutral

Posted 24 March 2013 - 21:13

Hi

I modified the PluginList.py a bit, that I can use Alphablend.

Now, the PluginBrowser is working perfect, but if I choose Downloading Plugins or Delete Plugins, I got a GS.

I'm a beginner in python, so don't laught about me :D

Can someone find, what is causing the issue?

from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont
from Tools.LoadPixmap import LoadPixmap
def PluginEntryComponent(plugin):
res = [ plugin ]

if plugin.icon is None:
  png = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "MetrixFullHD/pluginbrowser/plugin.png"))
else:
  png = plugin.icon

res.append((eListboxPythonMultiContent.TYPE_TEXT, 144,  0, 632, 42, 0, RT_HALIGN_LEFT, plugin.name))
res.append((eListboxPythonMultiContent.TYPE_TEXT, 144, 37, 632, 42, 1, RT_HALIGN_LEFT, plugin.description))
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 24, 20, 100, 40, png))

return res
def PluginCategoryComponent(name, png):
res = [ name ]

res.append((eListboxPythonMultiContent.TYPE_TEXT, 124, 0, 1116, 80, 0, RT_HALIGN_LEFT, name))
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 24, 0, 80, 80, png))

return res
def PluginDownloadComponent(plugin, name, version=None):
res = [ name ]

if plugin.icon is None:
  png = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "MetrixFullHD/pluginbrowser/plugin.png"))
else:
  png = plugin.icon
if version:
  if "+git" in version:
   # remove git "hash"
   version = "+".join(version.split("+")[:2])
  elif version.startswith('experimental-'):
   version = version[13:]
  name += "  (" + version + ")"

res.append((eListboxPythonMultiContent.TYPE_TEXT, 124,  0, 1116, 42, 0, RT_HALIGN_LEFT, name))
res.append((eListboxPythonMultiContent.TYPE_TEXT, 124, 37, 1116, 42, 1, RT_HALIGN_LEFT, plugin.description))
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 24, 0, 80, 80, png))

return res
class PluginList(MenuList):
def __init__(self, list, selection = 0, enableWrapAround=False):
  MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
  self.l.setFont(0, gFont("RegularSemilight", 34))
  self.l.setFont(1, gFont("Regular", 30))
  self.l.setItemHeight(80)
  self.selection = selection

def postWidgetCreate(self, instance):
  MenuList.postWidgetCreate(self, instance)
  self.moveToIndex(self.selection)

greets
canymed112

ET9200, OpenPli 3.0, 3.8.7


Re: Problem with PluginList #2 jimux

  • Member
  • 33 posts

+1
Neutral

Posted 29 March 2013 - 14:11

Start by running a debug session.  Open a telnet session and run init 4 && enigma2.sh  so all the print statements show in your tty console.   Then at the crash you will see a trance back of the last statement executed and some rudimentary diagnostics.  Stuff a few diagnostic writes in just before this  ie print 'Got to this point and fred is ', fred

 

but one obvious error is

def PluginEntryComponent(plugin):
res = [ plugin ]

The second line should be indented.


Technomate box user (TM9100, TM800HD) and moderator on allsats.co.uk Linux/unix fan for many years.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users