1 from enigma import loadPNG
3 class PluginDescriptor:
4 """An object to describe a plugin."""
6 # where to list the plugin. Note that there are different call arguments,
7 # so you might not be able to combine them.
9 # supported arguments are:
14 # you have to ignore unknown kwargs!
20 # argument: session, serviceref (currently selected)
25 # reason (0: start, 1: end)
28 # start as wizard. In that case, fnc must be a screen class!
31 # like autostart, but for a session. currently, only session starts are
32 # delivered, and only on pre-loaded plugins
33 WHERE_SESSIONSTART = 7
35 # start as teletext plugin. arguments: session, serviceref
38 def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None):
40 if type(where) is list:
43 self.where = [ where ]
44 self.description = description
46 if type(icon) is str or icon is None:
54 def updateIcon(self, path):
55 if type(self.iconstr) is str:
56 self.icon = loadPNG(path + "/" + self.iconstr)
60 def __eq__(self, other):
61 return self.__call__ == other.__call__