bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [urgent] Parted 1.4.4


From: Matt Wilson
Subject: Re: [urgent] Parted 1.4.4
Date: Thu, 30 Nov 2000 14:12:44 -0500
User-agent: Mutt/1.2.5i

On Thu, Nov 30, 2000 at 03:02:16PM +1100, Andrew Clausen wrote:
>
> BTW, I don't like receiving patches, without hearing about them
> beforehand.  If there are any changes, other than adding new
> files (i.e. internal changes to libparted), then these should
> be discussed on the list.  In fact, I think it's best if the
> entire development/design is discussed on the list.

This will be the rewritten-for-1.4.x ia64 efi gpt partitioning scheme
support that we've talked about already (but not on list, I think).
It's only new files - no internal changes so far.

My python module is also only new files (so far - I've not found
anything impossible to do without a internals change).  So far I have
(for example):

import parted

def exception_handler(exception):
    print "%s: %s" % (exception.type_string, exception.message)
    return parted.EXCEPTION_UNHANDLED

parted.exception_set_handler (exception_handler)

path = '/dev/hda'
dev = parted.device_get (path)
disk = parted.disk_open (dev)

print "%s: length %ld" % (path, dev.length)

part = disk.next_partition()
if part:
    print "Device       Type         Start      End        Length"
while part:
    if (part.type == parted.PARTITION_PRIMARY
        or part.type == parted.PARTITION_EXTENDED
        or part.type == parted.PARTITION_LOGICAL):
        print ("%s%d    %-12s %-10ld %-10ld %-10ld"
               % (path, part.num, part.type_name, part.geom.start,
                  part.geom.end, part.geom.length))
    part = disk.next_partition(part)

Example of the output:
address@hidden python]# ./test.py 
/dev/hda: length 19999728
Device       Type         Start      End        Length
/dev/hda1    primary      63         4096574    4096512   
/dev/hda2    extended     4096575    19984859   15888285  
/dev/hda5    logical      4096638    4369679    273042    
/dev/hda6    logical      4369743    19984859   15615117  

This doesn't show all of the functionality yet, I'd say I'm about 35%
done with the binding.

Matt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]