summaryrefslogtreecommitdiffstats
path: root/deskutils/gdesklets/files/patch-libdesklets::Disk.py
blob: 0b4a640d965aeb16d4a07ed13c53c952e2f59780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- libdesklets/Disk.py.orig	Mon Feb 23 10:52:50 2004
+++ libdesklets/Disk.py	Mon Feb 23 10:54:31 2004
@@ -1,6 +1,6 @@
 import glibtop
 import polling
-
+import os
 
 class Disk:
 
@@ -21,14 +21,19 @@
     #
     def __poll_partitions(self):
 
-        data = glibtop.get_mountlist(0)
+        fd = os.popen("mount -p")
+        data = fd.readlines()
+        fd.close()
+
         partitions = []
-        for size, device, mpoint, fstype in data:
-            if (fstype in ("ext2", "ext3", "msdos", "vfat", "ntfs", "hpfs"
-                           "jfs", "reiserfs", "xfs", "qnx4", "adfs", "ffs",
-                           "hfs", "befs", "bfs", "efs", "iso9660", "minix",
-                           "sysv", "coda", "nfs", "udf", "ufs", "xiafs")):
-                partitions.append((device, mpoint))
+        for lines in data:
+           fields = lines.strip().replace("\t", " ").split()
+           if (fields[2] in ("ext2", "ext3", "msdos", "vfat", "ntfs", "hpfs"
+                          "jfs", "reiserfs", "xfs", "qnx4", "adfs", "ffs",
+                          "hfs", "befs", "bfs", "efs", "iso9660", "minix",
+                          "sysv", "coda", "nfs", "udf", "ufs", "xiafs")):
+               partitions.append((fields[0], fields[1]))
+
 
         return partitions
             
OpenPOWER on IntegriCloud