bug-parted
[Top][All Lists]
Advanced

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

libparted stuff in creating partition (Python)


From: Jesus Rivero
Subject: libparted stuff in creating partition (Python)
Date: Thu, 11 Nov 2004 14:35:18 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.7.2) Gecko/20040810 Debian/1.7.2-2

   Hello all,

I don't know if this is the right place to ask this question, but i don't quite know where to go... If this, then just tell me and i'll stop asking python questions.

Im currently working on a new linux distro based on Knoppix live CD. Im developing a replacement (GUI) for QTParted (totally Open Source, which rules!!!), and im developing using pytho2.3 libparted1.4 and python-parted from PGI.

I'm able to do all sorts of things with parted.. I can list devices, disks, partitions, And i can erase a stuff... but when I want to create a new partition, then i get a Segment Fault, and my app just dies. I don't know if i'm doing the right thing, cause i'm a newbie in developing partitioning apps and to libparted, basically, im just creating a new partition, say (python) parted.partition(Disk, Type, FSType,Start, End) and here is the Segmentation Fault...

Here is a piece of the code... to see if i have to do extra-things like a Constraint or Alignment (which by the way.. i don't have a clue about what are they..)

def CreatePartition(self, widget):
     if self.GlobalAvSpace != None:
        if self.WnewP_type_part.get_child().get_text() == "Primaria":
           Tipo       = parted.PARTITION_PRIMARY
           FS         = self.WnewP_type_system.get_child().get_text()
           Label      = self.WnewP_label.get_text()
           Start      = self.GlobalAvSpaceStart
#Size = int((self.WnewP_spin_size.get_value() * 1000000) / 512)
           Size       = int((self.WnewP_spin_size.get_value()))
           #Length    = ((self.GlobalAvSpace * 1000000) * 512)
           #try:
              #FSType = self.FSTypes[str(FS)]
#FSType = FS if FS == "":
               print "Error in FS.1"
           else:
################### REVISAR QUE SE ESTA HACIENDO CON LOS TAMAÑOS DE LAS PARTICIONES#######################
              FSTypeR    = parted.file_system_type_get(FS)
              print "FSTYPE: ",FSTypeR
              End        = int(Start + Size)
              print "Valores "+str(Start) + "-->" + str(End)
NPartition = parted.Partition(self.GlobalDisk,Tipo,FSTypeR,Start,End)
              print "Partition created, adding..."
              self.GlobalDisk.add_partition(NPartition)
           #except:
           print "Error in FS.2"
           #pass
##########################################################################################################
        else:
           print "Unknown Type... exiting!"
     else:
        pass
     self.WnewP.hide()
     #--->
     return




Thanks a Lot... And Sorry again is I'm in a very wrong place for asking about this...

Jesús Rivero
team Latinux




reply via email to

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