On Tue, Aug 17, 2010 at 7:38 PM, Jasper Hartline
<[email protected]> wrote:
> On Tue, Aug 17, 2010 at 1:06 PM, Jasper Hartline
> <[email protected]> wrote:
>> On Tue, Aug 17, 2010 at 7:07 AM, Richard Shaw <[email protected]> wrote:
>>>>> It's probably overkill but I know there's the optparse module for
>>>>> passing arguments and options. Not really necessary since the script
>>>>> requires exactly 3 arguments but it would add somewhat automagically
>>>>> things like --help and --version.
>>>>
>>>> Right, these should be added.
>
> Ok Richard. I don't know where the pyparted docs are.
> If you know how to partition devices, with pyparted
> I am more than glad to listen.
>
> Here is what I have now, attached.
> In setup()
> After I mkimage() and do losetup()
> I need to partition that device, which will be a /dev/loop device.
>
> Any suggestions?

I also found the documentation to be lacking for pyparted. It may be
out there, but I couldn't find it easily. I did, however find a module
inspector recepie. Attached is the output for pyparted (package name)
/ parted (module name).I'll try to take a look at it tonight and see
what I can grok.

I did some updating to the script but I'll merge it with what you just
sent before posting it back to the list. (In other words, when I get a
chance after the kids go to bed :) )

Richard
[Module: parted]

     +Class: Alignment
         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: getPedAlignment
                getPedAlignment is an instance method
                -Method Arguments: []

         +Method: alignDown
                alignDown is an instance method
                -Method Arguments: ['geom', 'sector']

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: isAligned
                isAligned is an instance method
                -Method Arguments: ['geom', 'sector']

         +Method: intersect
                intersect is an instance method
                -Method Arguments: ['b']

         +Method: alignNearest
                alignNearest is an instance method
                -Method Arguments: ['geom', 'sector']

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: []
                -Positional Args Param: args
                -Keyword Args Param: kwargs

         +Method: alignUp
                alignUp is an instance method
                -Method Arguments: ['geom', 'sector']


     +Class: AlignmentException
         (No members)

     +Class: Constraint
         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: solveMax
                solveMax is an instance method
                -Method Arguments: []

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: isSolution
                isSolution is an instance method
                -Method Arguments: ['geom']

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: getPedConstraint
                getPedConstraint is an instance method
                -Method Arguments: []

         +Method: solveNearest
                solveNearest is an instance method
                -Method Arguments: ['geom']

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: []
                -Positional Args Param: args
                -Keyword Args Param: kwargs

         +Method: intersect
                intersect is an instance method
                -Method Arguments: ['b']


     +Class: ConstraintException
         (No members)

     +Class: CreateException
         (No members)

     +Class: Device
         +Method: beginExternalAccess
                beginExternalAccess is an instance method
                -Method Arguments: []

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: __getCHS
                __getCHS is an instance method
                -Method Arguments: ['geometry']

         +Method: sync
                sync is an instance method
                -Method Arguments: ['fast']
                --Default arguments: [('fast', False)]

         +Method: getSize
                getSize is an instance method
                -Method Arguments: ['unit']
                --Default arguments: [('unit', 'MB')]

         +Method: clobber
                clobber is an instance method
                -Method Arguments: []

         +Method: close
                close is an instance method
                -Method Arguments: []

         +Method: open
                open is an instance method
                -Method Arguments: []

         +Method: check
                check is an instance method
                -Method Arguments: ['start', 'count']

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['path', 'PedDevice']
                --Default arguments: [('path', None), ('PedDevice', None)]

         +Method: endCylinderToSector
                endCylinderToSector is an instance method
                -Method Arguments: ['cylinder']

         +Method: write
                write is an instance method
                -Method Arguments: ['buffer', 'start', 'count']

         +Method: startSectorToCylinder
                startSectorToCylinder is an instance method
                -Method Arguments: ['sector']

         +Method: destroy
                destroy is an instance method
                -Method Arguments: []

         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: read
                read is an instance method
                -Method Arguments: ['start', 'count']

         +Method: endSectorToCylinder
                endSectorToCylinder is an instance method
                -Method Arguments: ['sector']

         +Method: removeFromCache
                removeFromCache is an instance method
                -Method Arguments: []

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: startCylinderToSector
                startCylinderToSector is an instance method
                -Method Arguments: ['cylinder']

         +Method: getConstraint
                getConstraint is an instance method
                -Method Arguments: []

         +Method: endExternalAccess
                endExternalAccess is an instance method
                -Method Arguments: []

         +Method: getPedDevice
                getPedDevice is an instance method
                -Method Arguments: []


     +Class: DeviceException
         (No members)

     +Class: Disk
         +Method: unsetFlag
                unsetFlag is an instance method
                -Method Arguments: ['flag']

         +Method: commitToOS
                commitToOS is an instance method
                -Method Arguments: []

         +Method: getFlag
                getFlag is an instance method
                -Method Arguments: ['flag']

         +Method: isFlagAvailable
                isFlagAvailable is an instance method
                -Method Arguments: ['flag']

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: __filterPartitions
                __filterPartitions is an instance method
                -Method Arguments: ['fn']

         +Method: getPrimaryPartitions
                getPrimaryPartitions is an instance method
                -Method Arguments: []

         +Method: getRaidPartitions
                getRaidPartitions is an instance method
                -Method Arguments: []

         +Method: deleteAllPartitions
                deleteAllPartitions is an instance method
                -Method Arguments: []

         +Method: check
                check is an instance method
                -Method Arguments: []

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['device', 'PedDisk']
                --Default arguments: [('device', None), ('PedDisk', None)]

         +Method: getPedDisk
                getPedDisk is an instance method
                -Method Arguments: []

         +Method: commitToDevice
                commitToDevice is an instance method
                -Method Arguments: []

         +Method: duplicate
                duplicate is an instance method
                -Method Arguments: []

         +Method: calculateMaxPartitionGeometry
                calculateMaxPartitionGeometry is an instance method
                -Method Arguments: ['partition', 'constraint']
                --Default arguments: [('partition', None), ('constraint', None)]

         +Method: setFlag
                setFlag is an instance method
                -Method Arguments: ['flag']

         +Method: getLVMPartitions
                getLVMPartitions is an instance method
                -Method Arguments: []

         +Method: removePartition
                removePartition is an instance method
                -Method Arguments: ['partition']
                --Default arguments: [('partition', None)]

         +Method: getExtendedPartition
                getExtendedPartition is an instance method
                -Method Arguments: []

         +Method: destroy
                destroy is an instance method
                -Method Arguments: []

         +Method: _hasSameParts
                _hasSameParts is an instance method
                -Method Arguments: ['other']

         +Method: setPartitionGeometry
                setPartitionGeometry is an instance method
                -Method Arguments: ['partition', 'constraint', 'start', 'end']
                --Default arguments: [('partition', None), ('constraint', 
None), ('start', None), ('end', None)]

         +Method: getFreeSpaceRegions
                getFreeSpaceRegions is an instance method
                -Method Arguments: []

         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: __getPartitions
                __getPartitions is an instance method
                -Method Arguments: []

         +Method: deletePartition
                deletePartition is an instance method
                -Method Arguments: ['partition']

         +Method: getPartitionBySector
                getPartitionBySector is an instance method
                -Method Arguments: ['sector']

         +Method: getPartitionByPath
                getPartitionByPath is an instance method
                -Method Arguments: ['path']

         +Method: supportsFeature
                supportsFeature is an instance method
                -Method Arguments: ['feature']

         +Method: getFreeSpacePartitions
                getFreeSpacePartitions is an instance method
                -Method Arguments: []

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: getMaxLogicalPartitions
                getMaxLogicalPartitions is an instance method
                -Method Arguments: []

         +Method: addPartition
                addPartition is an instance method
                -Method Arguments: ['partition', 'constraint']
                --Default arguments: [('partition', None), ('constraint', None)]

         +Method: getFirstPartition
                getFirstPartition is an instance method
                -Method Arguments: []

         +Method: maximizePartition
                maximizePartition is an instance method
                -Method Arguments: ['partition', 'constraint']
                --Default arguments: [('partition', None), ('constraint', None)]

         +Method: minimizeExtendedPartition
                minimizeExtendedPartition is an instance method
                -Method Arguments: []

         +Method: commit
                commit is an instance method
                -Method Arguments: []

         +Method: getLogicalPartitions
                getLogicalPartitions is an instance method
                -Method Arguments: []


     +Class: DiskException
         (No members)

     +Class: FileSystem
         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: getResizeConstraint
                getResizeConstraint is an instance method
                -Method Arguments: []

         +Method: close
                close is an instance method
                -Method Arguments: []

         +Method: copy
                copy is an instance method
                -Method Arguments: ['geometry']

         +Method: open
                open is an instance method
                -Method Arguments: []

         +Method: check
                check is an instance method
                -Method Arguments: []

         +Method: getPedFileSystem
                getPedFileSystem is an instance method
                -Method Arguments: []

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: create
                create is an instance method
                -Method Arguments: []

         +Method: clobber
                clobber is an instance method
                -Method Arguments: []

         +Method: resize
                resize is an instance method
                -Method Arguments: ['geometry']

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['type', 'geometry', 'checked', 
'PedFileSystem']
                --Default arguments: [('type', None), ('geometry', None), 
('checked', False), ('PedFileSystem', None)]


     +Class: FileSystemException
         (No members)

     +Class: Geometry
         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: getPedGeometry
                getPedGeometry is an instance method
                -Method Arguments: []

         +Method: map
                map is an instance method
                -Method Arguments: ['src', 'sector']

         +Method: read
                read is an instance method
                -Method Arguments: ['offset', 'count']

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: overlapsWith
                overlapsWith is an instance method
                -Method Arguments: ['b']

         +Method: sync
                sync is an instance method
                -Method Arguments: ['fast']
                --Default arguments: [('fast', False)]

         +Method: getSize
                getSize is an instance method
                -Method Arguments: ['unit']
                --Default arguments: [('unit', 'MB')]

         +Method: containsSector
                containsSector is an instance method
                -Method Arguments: ['sector']

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: check
                check is an instance method
                -Method Arguments: ['offset', 'granularity', 'count', 'timer']
                --Default arguments: [('timer', None)]

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['device', 'start', 'length', 'end', 
'PedGeometry']
                --Default arguments: [('device', None), ('start', None), 
('length', None), ('end', None), ('PedGeometry', None)]

         +Method: contains
                contains is an instance method
                -Method Arguments: ['b']

         +Method: write
                write is an instance method
                -Method Arguments: ['buf', 'offset', 'count']

         +Method: intersect
                intersect is an instance method
                -Method Arguments: ['b']


     +Class: GeometryException
         (No members)

     +Class: IOException
         (No members)

     +Class: NotNeededException
         (No members)

     +Class: PartedException
         (No members)

     +Class: Partition
         +Method: unsetFlag
                unsetFlag is an instance method
                -Method Arguments: ['flag']

         +Method: __ne__
                __ne__ is an instance method
                -Method Arguments: ['other']

         +Method: getFlag
                getFlag is an instance method
                -Method Arguments: ['flag']

         +Method: __str__
                __str__ is an instance method
                -Method Arguments: []

         +Method: getMaxAvailableSize
                getMaxAvailableSize is an instance method
                -Method Arguments: ['unit']
                --Default arguments: [('unit', 'MB')]

         +Method: getSize
                getSize is an instance method
                -Method Arguments: ['unit']
                --Default arguments: [('unit', 'MB')]

         +Method: getDeviceNodeName
                getDeviceNodeName is an instance method
                -Method Arguments: []

         +Method: getPedPartition
                getPedPartition is an instance method
                -Method Arguments: []

         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['disk', 'type', 'fs', 'geometry', 
'PedPartition']
                --Default arguments: [('disk', None), ('type', None), ('fs', 
None), ('geometry', None), ('PedPartition', None)]

         +Method: __eq__
                __eq__ is an instance method
                -Method Arguments: ['other']

         +Method: isFlagAvailable
                isFlagAvailable is an instance method
                -Method Arguments: ['flag']

         +Method: setFlag
                setFlag is an instance method
                -Method Arguments: ['flag']

         +Method: getMaxGeometry
                getMaxGeometry is an instance method
                -Method Arguments: ['constraint']

         +Method: nextPartition
                nextPartition is an instance method
                -Method Arguments: []

         +Method: __writeOnly
                __writeOnly is an instance method
                -Method Arguments: ['property']

         +Method: getFlagsAsString
                getFlagsAsString is an instance method
                -Method Arguments: []


     +Class: PartitionException
         (No members)

     +Class: ReadOnlyProperty
         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['property']
                --Default arguments: [('property', '')]


     +Class: TimerException
         (No members)

     +Class: UnknownDeviceException
         (No members)

     +Class: UnknownTypeException
         (No members)

     +Class: WriteOnlyProperty
         +Method: __init__
                __init__ is an instance method
                -Method Arguments: ['property']
                --Default arguments: [('property', '')]


     +Function: freeAllDevices

     +Function: freshDisk
        -Method Arguments: ['device', 'ty']

     +Function: getAllDevices

     +Function: getDevice
        -Method Arguments: ['path']

     +Function: localeC
        -Method Arguments: ['fn']

     +Function: probeFileSystem
        -Method Arguments: ['geometry']

     +Function: probeForSpecificFileSystem
        -Method Arguments: ['fstype', 'geometry']

     +Function: version

--
livecd mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/livecd

Reply via email to