add WHERE_WIZARD plugins
[openblackhole/openblackhole-enigma2.git] / lib / python / Plugins / Plugin.py
1 class PluginDescriptor:
2         """An object to describe a plugin."""
3         
4         # where to list the plugin. Note that there are different call arguments,
5         # so you might not be able to combine them.
6         
7         # supported arguments are:
8         #   session
9         #   servicereference
10         #   reason
11         
12         # argument: session
13         WHERE_BLUEMENU = 0
14         WHERE_MAINMENU = 1
15         WHERE_PLUGINMENU  = 2
16         # argument: session, serviceref (currently selected)
17         WHERE_MOVIELIST = 3
18         # ...
19         WHERE_SETUP    = 4
20         
21         # reason (0: start, 1: end)
22         WHERE_AUTOSTART = 5
23         
24         # start as wizard. In that case, fnc must be a screen class!
25         WHERE_WIZARD = 6
26         
27         def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None):
28                 self.name = name
29                 if type(where) is list:
30                         self.where = where
31                 else:
32                         self.where = [ where ]
33                 self.description = description
34                 if type(fnc) is str:
35                         self.icon = loadPNG("..")
36                 else:
37                         self.icon = icon
38                 self.__call__ = fnc