retune after sending a diseqc command in the positioner setup plugin
[enigma2.git] / lib / python / Plugins / Plugin.py
index d363509189cc8f4204deebcc76f5171d5d466193..b2808c8ec6838da15733c38824560ab53b7838e7 100644 (file)
@@ -1,3 +1,5 @@
+from enigma import loadPNG
+
 class PluginDescriptor:
        """An object to describe a plugin."""
        
@@ -9,6 +11,8 @@ class PluginDescriptor:
        #   servicereference
        #   reason
        
+       # you have to ignore unknown kwargs!
+       
        # argument: session
        WHERE_BLUEMENU = 0
        WHERE_MAINMENU = 1
@@ -24,6 +28,13 @@ class PluginDescriptor:
        # start as wizard. In that case, fnc must be a screen class!
        WHERE_WIZARD = 6
        
+       # like autostart, but for a session. currently, only session starts are 
+       # delivered, and only on pre-loaded plugins
+       WHERE_SESSIONSTART = 7
+       
+       # start as teletext plugin. arguments: session, serviceref
+       WHERE_TELETEXT = 8
+       
        def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None):
                self.name = name
                if type(where) is list:
@@ -31,8 +42,20 @@ class PluginDescriptor:
                else:
                        self.where = [ where ]
                self.description = description
-               if type(fnc) is str:
-                       self.icon = loadPNG("..")
+
+               if type(icon) is str or icon is None:
+                       self.iconstr = icon
+                       self.icon = None
                else:
                        self.icon = icon
+
                self.__call__ = fnc
+
+       def updateIcon(self, path):
+               if type(self.iconstr) is str:
+                       self.icon = loadPNG(path + "/" + self.iconstr)
+               else:
+                       self.icon = None
+
+       def __eq__(self, other):
+               return self.__call__ == other.__call__