X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FDiskInfo.py;h=07a6aa4b44a9c06dd090492e5e3ec7c6a31c4366;hb=f1186b323fe59536ceb717a799839e9cbc48b30a;hp=9490a0f818789740bcf99ea53328530ca791d2fd;hpb=abd961024accfc54ffea8a36999417b44861c52b;p=vuplus_dvbapp diff --git a/lib/python/Components/DiskInfo.py b/lib/python/Components/DiskInfo.py index 9490a0f..07a6aa4 100644 --- a/lib/python/Components/DiskInfo.py +++ b/lib/python/Components/DiskInfo.py @@ -1,12 +1,12 @@ -from GUIComponent import * -from VariableText import * -import os +from GUIComponent import GUIComponent +from VariableText import VariableText +from os import statvfs from enigma import eLabel # TODO: Harddisk.py has similiar functions, but only similiar. # fix this to use same code -class DiskInfo(GUIComponent, VariableText): +class DiskInfo(VariableText, GUIComponent): FREE = 0 USED = 1 SIZE = 2 @@ -21,13 +21,12 @@ class DiskInfo(GUIComponent, VariableText): 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