fix and simplify PluginList
[enigma2.git] / lib / python / Components / DiskInfo.py
index be1521cf304fa3a92ca20b289b1b763d8e8f16dd..07a6aa4b44a9c06dd090492e5e3ec7c6a31c4366 100644 (file)
@@ -1,6 +1,6 @@
-from GUIComponent import *
-from VariableText import *
-import os
+from GUIComponent import GUIComponent
+from VariableText import VariableText
+from os import statvfs
 
 from enigma import eLabel
 
@@ -21,13 +21,12 @@ class DiskInfo(VariableText, GUIComponent):
        
        def update(self):
                try:
-                       stat = os.statvfs(self.path)
+                       stat = statvfs(self.path)
                except OSError:
                        return -1
                
                if self.type == self.FREE:
                        free = stat.f_bfree / 1000 * stat.f_bsize / 1000
-                       self.setText(("%dMB " + _("free diskspace")) % (free))
+                       self.setText(("%d MB " + _("free diskspace")) % (free))
 
-       def createWidget(self, parent):
-               return eLabel(parent)
+       GUI_WIDGET = eLabel