Ejemplo n.º 1
0
    def runTest(self):
        for f in [_ped.DISK_CYLINDER_ALIGNMENT]:
            self.assertNotEqual(_ped.disk_flag_get_name(f), "",
                                "Could not get name for flag %s" % f)

        self.assertRaises(ValueError, _ped.disk_flag_get_name, -1)
        self.assertRaises(_ped.PartedException, _ped.disk_flag_get_name, 1000)
Ejemplo n.º 2
0
    def runTest(self):
        for f in [_ped.DISK_CYLINDER_ALIGNMENT]:
            self.assertNotEqual(_ped.disk_flag_get_name(f), "", "Could not get name for flag %s" % f)

        self.assertRaises(ValueError, _ped.disk_flag_get_name, -1)
        self.assertRaises(ValueError, _ped.disk_flag_get_name, 1000)
Ejemplo n.º 3
0
    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

while __readFlags:
    __flag = _ped.disk_flag_next(__flag)
    if not __flag:
        __readFlags = False
    else:
        diskFlag[__flag] = _ped.disk_flag_get_name(__flag)
Ejemplo n.º 4
0
    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

while __readFlags:
    __flag = _ped.disk_flag_next(__flag)
    if not __flag:
        __readFlags = False
    else:
        diskFlag[__flag] = _ped.disk_flag_get_name(__flag)