Ejemplo n.º 1
0
 def autoPartition(self, widget):
     if len(self.path) == 3:
         pass
     elif len(self.path) == 1 and self.scheme is None:
         self.schemeEditor(None)
         self.update()
     elif len(self.path) == 1:
         autoDiskPartition(self.slice, self.size, self.scheme)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
     elif self.slice == 'freespace':
         autoFreeSpace(self.path, self.size)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
     elif len(self.path) == 2:
         pass
     else:
         print("not work")
Ejemplo n.º 2
0
 def autoPartition(self, widget):
     if len(self.path) == 3:
         pass
     elif len(self.path) == 1 and self.scheme is None:
         self.schemeEditor(None)
         self.update()
     elif len(self.path) == 1:
         autoDiskPartition(self.slice, self.size, self.scheme)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
     elif self.slice == 'freespace':
         autoFreeSpace(self.path, self.size)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
     elif len(self.path) == 2:
         pass
     else:
         pass
     self.update()
Ejemplo n.º 3
0
 def autoSchemePartition(self, widget):
     diskSchemeChanger(self.scheme, self.path, self.slice, self.size)
     self.update()
     autoDiskPartition(self.slice, self.size, self.scheme)
     self.update()
     self.window.hide()
Ejemplo n.º 4
0
 def autoSchemePartition(self, widget):
     diskSchemeChanger(self.scheme, self.path, self.slice, self.size)
     self.update()
     autoDiskPartition(self.slice, self.size, self.scheme)
     self.update()
     self.window.hide()
Ejemplo n.º 5
0
 def autoPartition(self, widget):
     if len(self.path) == 3:
         pass
     elif len(self.path) == 1 and self.scheme is None:
         self.schemeEditor(None)
         self.update()
     elif len(self.path) == 1:
         autoDiskPartition(self.slice, self.size, self.scheme)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
         partlabel = '%spartlabel' % tmp
         if os.path.exists(partlabel):
             rd = open(partlabel, 'r')
             part = rd.readlines()
             # Find GPT scheme.
             rschm = open(disk_schem, 'r')
             schm = rschm.readlines()[0]
             if 'GPT' in schm:
                 fs = part[1]
                 boot = part[0]
                 print fs
                 if 'BOOT' in boot:
                     pass
                 else:
                     self.button3.set_sensitive(False)
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
             else:
                 fs = part[0].split()[-1]
                 print fs
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
         else:
             self.button3.set_sensitive(False)
     elif self.slice == 'freespace':
         print self.path
         print self.size
         autoFreeSpace(self.path, self.size)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
         partlabel = '%spartlabel' % tmp
         if os.path.exists(partlabel):
             rd = open(partlabel, 'r')
             part = rd.readlines()
             # Find GPT scheme.
             rschm = open(disk_schem, 'r')
             schm = rschm.readlines()[0]
             if 'GPT' in schm:
                 fs = part[1]
                 boot = part[0]
                 print fs
                 if 'BOOT' in boot:
                     pass
                 else:
                     self.button3.set_sensitive(False)
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
             else:
                 fs = part[0]
                 print fs
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
         else:
             self.button3.set_sensitive(False)
     elif len(self.path) == 2:
         pass
     else:
         print("not work")
Ejemplo n.º 6
0
 def autoPartition(self, widget):
     if len(self.path) == 3:
         pass
     elif len(self.path) == 1 and self.scheme is None:
         self.schemeEditor(None)
         self.update()
     elif len(self.path) == 1:
         autoDiskPartition(self.slice, self.size, self.scheme)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
         partlabel = '%spartlabel' % tmp
         if os.path.exists(partlabel):
             rd = open(partlabel, 'r')
             part = rd.readlines()
             # Find GPT scheme.
             rschm = open(disk_schem, 'r')
             schm = rschm.readlines()[0]
             if 'GPT' in schm:
                 fs = part[1]
                 boot = part[0]
                 print fs
                 if 'BOOT' in boot:
                     pass
                 else:
                     self.button3.set_sensitive(False)
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
             else:
                 fs = part[0].split()[-1]
                 print fs
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
         else:
             self.button3.set_sensitive(False)
     elif self.slice == 'freespace':
         print self.path
         print self.size
         autoFreeSpace(self.path, self.size)
         self.Tree_Store()
         self.treeview.expand_all()
         self.treeview.set_cursor(self.path)
         partlabel = '%spartlabel' % tmp
         if os.path.exists(partlabel):
             rd = open(partlabel, 'r')
             part = rd.readlines()
             # Find GPT scheme.
             rschm = open(disk_schem, 'r')
             schm = rschm.readlines()[0]
             if 'GPT' in schm:
                 fs = part[1]
                 boot = part[0]
                 print fs
                 if 'BOOT' in boot:
                     pass
                 else:
                     self.button3.set_sensitive(False)
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
             else:
                 fs = part[0]
                 print fs
                 if '/' in fs:
                     self.button3.set_sensitive(True)
                 else:
                     self.button3.set_sensitive(False)
         else:
             self.button3.set_sensitive(False)
     elif len(self.path) == 2:
         pass
     else:
         print("not work")