new plugin interface
[enigma2.git] / lib / python / Plugins / tuxboxplugins / plugin.py
index b700566..01d5745 100644 (file)
@@ -1,3 +1,4 @@
+# must be fixed for the new plugin interface
 from enigma import *
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
@@ -7,31 +8,41 @@ from Components.Label import Label
 import os
 
 def getPlugins():
-       dir = os.listdir("/usr/lib/tuxbox/plugins/")
-       
        pluginlist = []
-       for x in dir:
-               try:
-                       if x[-3:] == "cfg":
-                               params = getPluginParams(x)
-                               pluginlist.append((params["name"], params["desc"], "function", "main", x))
-               except:
-                       pass
+
+       try:
+               dir = os.listdir("/usr/lib/tuxbox/plugins/")
+       
+               for x in dir:
+                       try:
+                               if x[-3:] == "cfg":
+                                       params = getPluginParams(x)
+                                       pluginlist.append((params["name"], params["desc"], "function", "main", x))
+                       except:
+                               pass
+       except:
+               print "no tuxbox plugins found"
        return pluginlist
 
 def getPicturePaths():
        list = []
-       dir = os.listdir("/usr/lib/tuxbox/plugins/")
-       for x in dir: list.append("tuxbox.png")
+       try:
+               dir = os.listdir("/usr/lib/tuxbox/plugins/")
+               for x in dir: list.append("tuxbox.png")
+       except:
+               print "no tuxbox plugins found"
        return list
 
 def getPluginParams(file):
        params = {}
-       file = open("/usr/lib/tuxbox/plugins/" + file, "r")
-       for x in file.readlines():
-               split = x.split("=")
-               params[split[0]] = split[1]
-       file.close()
+       try:
+               file = open("/usr/lib/tuxbox/plugins/" + file, "r")
+               for x in file.readlines():
+                       split = x.split("=")
+                       params[split[0]] = split[1]
+               file.close()
+       except:
+               print "not tuxbox plugins found"
 
        return params