Example #1
0
    def setUp(self):
        self.disktype = {}
        type = _ped.disk_type_get_next()
        self.disktype[type.name] = type

        while True:
            try:
                type = _ped.disk_type_get_next(type)
                self.disktype[type.name] = type
            except:
                break
Example #2
0
    def setUp(self):
        self.disktype = {}
        ty = _ped.disk_type_get_next()
        self.disktype[ty.name] = ty

        while True:
            try:
                ty = _ped.disk_type_get_next(ty)
                self.disktype[ty.name] = ty
            except (IndexError, TypeError, _ped.UnknownTypeException):
                break
Example #3
0
    def setUp(self):
        self.disktype = {}
        ty = _ped.disk_type_get_next()
        self.disktype[ty.name] = ty

        while True:
            try:
                ty = _ped.disk_type_get_next(ty)
                self.disktype[ty.name] = ty
            except (IndexError, TypeError, _ped.UnknownTypeException):
                break
Example #4
0
    def setUp(self):
        self.disktype = {}
        type = _ped.disk_type_get_next()
        self.disktype[type.name] = type

        while True:
            try:
                type = _ped.disk_type_get_next(type)
                self.disktype[type.name] = type
            except:
                break
Example #5
0
        """Return a Partition object associated with the partition device
           path, such as /dev/sda1.  Returns None if no partition is found."""
        for partition in self.partitions:
            if partition.path == path:
                return partition

        return None

    def getPedDisk(self):
        """Return the _ped.Disk object contained in this Disk.  For internal
           module use only."""
        return self.__disk

# collect all disk types and store them in a hash
diskType = {}
__type = _ped.disk_type_get_next()
diskType[__type.name] = __type

while True:
    try:
        __type = _ped.disk_type_get_next(__type)
        diskType[__type.name] = __type
    except:
        break

# collect all disk flags and store them in a hash
diskFlag = {}
__flag = _ped.disk_flag_next(0)
diskFlag[__flag] = _ped.disk_flag_get_name(__flag)
__readFlags = True
Example #6
0
        """Return a Partition object associated with the partition device
           path, such as /dev/sda1.  Returns None if no partition is found."""
        for partition in self.partitions:
            if partition.path == path:
                return partition

        return None

    def getPedDisk(self):
        """Return the _ped.Disk object contained in this Disk.  For internal
           module use only."""
        return self.__disk

# collect all disk types and store them in a hash
diskType = {}
__type = _ped.disk_type_get_next()
diskType[__type.name] = __type

while True:
    try:
        __type = _ped.disk_type_get_next(__type)
        diskType[__type.name] = __type
    except (IndexError, TypeError, _ped.UnknownTypeException):
        break

# collect all disk flags and store them in a hash
diskFlag = {}
__flag = _ped.disk_flag_next(0)
diskFlag[__flag] = _ped.disk_flag_get_name(__flag)
__readFlags = True