Logo Search packages:      
Sourcecode: guidance-power-manager version File versions

def powermanage::PowerManage::_findDisks (   self  )  [private]

Scan /sys/block for non-removable and non-ramdisks, used for hdparm actions, 
    currently not implemented in the powermanager frontend. 

Definition at line 158 of file powermanage.py.

00158                         :
        """ Scan /sys/block for non-removable and non-ramdisks, used for hdparm actions, 
            currently not implemented in the powermanager frontend. """
        self.disks = []
        blk_path = "/sys/block/"
        for d in os.listdir(blk_path):
            # No RAM disks, no DM-RAID
            if d.startswith("ram") or d.startswith("dm"):
                continue
            fhandle = open(blk_path+d+"/removable")
            if fhandle.readlines()[0][:-1] == "0":
                self.disks.append(d)
        debug("Detected disks: "+" ".join(self.disks))

    def onBattery(self):


Generated by  Doxygen 1.6.0   Back to index