+ self.l.setItemHeight(23)
+ self.serviceHandler = eServiceCenter.getInstance()
+
+ def refreshMountpoints(self):
+ self.mountpoints = [os_path.join(p.mountpoint, "") for p in harddiskmanager.getMountedPartitions()]
+ self.mountpoints.sort(reverse = True)
+
+ def getMountpoint(self, file):
+ file = os_path.join(os_path.realpath(file), "")
+ for m in self.mountpoints:
+ if file.startswith(m):
+ return m
+ return False
+
+ def getMountpointLink(self, file):
+ if os_path.realpath(file) == file:
+ return self.getMountpoint(file)
+ else:
+ if file[-1] == "/":
+ file = file[:-1]
+ mp = self.getMountpoint(file)
+ last = file
+ file = os_path.dirname(file)
+ while last != "/" and mp == self.getMountpoint(file):
+ last = file
+ file = os_path.dirname(file)
+ return os_path.join(last, "")
+