git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of fraxinas@git.opendreambox.org:/git/enigma2
[enigma2.git]
/
lib
/
python
/
Components
/
DiskInfo.py
diff --git
a/lib/python/Components/DiskInfo.py
b/lib/python/Components/DiskInfo.py
index 9bd774b16f18b679976874073f37bc8faf98333a..07a6aa4b44a9c06dd090492e5e3ec7c6a31c4366 100644
(file)
--- a/
lib/python/Components/DiskInfo.py
+++ b/
lib/python/Components/DiskInfo.py
@@
-1,32
+1,32
@@
-from GUIComponent import
*
-from VariableText import
*
-
import o
s
+from GUIComponent import
GUIComponent
+from VariableText import
VariableText
+
from os import statvf
s
from enigma import eLabel
# TODO: Harddisk.py has similiar functions, but only similiar.
# fix this to use same code
from enigma import eLabel
# TODO: Harddisk.py has similiar functions, but only similiar.
# fix this to use same code
-class DiskInfo(
GUIComponent, VariableTex
t):
+class DiskInfo(
VariableText, GUIComponen
t):
FREE = 0
USED = 1
SIZE = 2
FREE = 0
USED = 1
SIZE = 2
- def __init__(self, path, type):
+ def __init__(self, path, type
, update = True
):
GUIComponent.__init__(self)
VariableText.__init__(self)
self.type = type
self.path = path
GUIComponent.__init__(self)
VariableText.__init__(self)
self.type = type
self.path = path
- self.update()
+ if update:
+ self.update()
def update(self):
try:
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
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