]> git.pld-linux.org Git - packages/gDesklets.git/commitdiff
- patch fixing invalid disksize information problem
authorkrolik <krolik@pld-linux.org>
Fri, 13 Aug 2004 20:04:08 +0000 (20:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gDesklets-disksize.patch -> 1.1

gDesklets-disksize.patch [new file with mode: 0644]

diff --git a/gDesklets-disksize.patch b/gDesklets-disksize.patch
new file mode 100644 (file)
index 0000000..b417802
--- /dev/null
@@ -0,0 +1,41 @@
+diff -urN gDesklets-0.26.2.orig/libdesklets/Disk.py gDesklets-0.26.2/libdesklets/Disk.py
+--- gDesklets-0.26.2.orig/libdesklets/Disk.py  2004-08-13 21:56:22.113232392 +0200
++++ gDesklets-0.26.2/libdesklets/Disk.py       2004-08-13 21:56:51.983691392 +0200
+@@ -1,6 +1,6 @@
+ import glibtop
+ import polling
+-
++import os
+ class Disk:
+@@ -43,15 +43,20 @@
+     #:/function
+     #
+     def __poll_size(self, partition):
+-
+-        blocks, bfree, bavail, files, ffree = glibtop.get_fsusage(partition)
+-        free = float(bfree * 512)
+-        total = float(blocks * 512)
+-        used = total - free
+-
+-        return (total, used)#, free)
+-
+-
++                                                                                                                                
++          try:
++              import statvfs
++              statvfs_data = os.statvfs(partition)
++              free = float(statvfs_data[statvfs.F_BFREE] * statvfs_data[statvfs.F_FRSIZE])
++              total = float(statvfs_data[statvfs.F_BLOCKS] * statvfs_data[statvfs.F_FRSIZE])
++          except:
++              blocks, bfree, bavail, files, ffree = glibtop.get_fsusage(partition)
++              free = float(bfree * 512)
++              total = float(blocks * 512)
++                                                                                                                                
++          used = total - free
++                                                                                                                                
++          return (total, used)#, free)
+     #
+     #:function get_fs | partition | Returns the filesystem for the given
This page took 0.257841 seconds and 4 git commands to generate.