def __init__(self, device, part, os, their_size, our_size): BaseDiskOp.__init__(self, device) self.their_size = their_size self.our_size = our_size self.part = part.partition their_new_sz = format_size_local(their_size, True) their_old_sz = format_size_local(part.size, True) self.desc = "Resize {} ({}) from {} to {}".format( os, part.path, their_old_sz, their_new_sz)
def __init__(self, device, part, os, their_size, our_size): BaseDiskOp.__init__(self, device) self.their_size = their_size self.our_size = our_size self.part = part.partition their_new_sz = format_size_local(their_size, True) their_old_sz = format_size_local(part.size, True) self.desc = "Resize {} ({}) from {} to {}".format( os, part.path, their_old_sz, their_new_sz)
def push_swap(self, part): model = self.treeview.get_model() partSizeActual = part.getLength() * part.disk.device.sectorSize partSize = format_size_local(partSizeActual) swp = SwapPartition(part) model.append([ part.path, "swap", None, False, NO_HAZ_ASSIGN, partSize, None, swp, partSizeActual ])
def update_strategy(self, info): self.info = info info.owner.set_can_next(True) os = info.strategy.sel_os self.image.set_from_icon_name(os.icon_name, Gtk.IconSize.DIALOG) self.image.set_pixel_size(64) self.label.set_markup("<big>{}</big>".format(os.name)) used = info.strategy.candidate_part.min_size avail = info.strategy.candidate_part.size GB = 1000.0 * 1000.0 * 1000.0 min_gb = MIN_REQUIRED_SIZE dmin = float(used / GB) dmax = float((avail - min_gb) / GB) # Set upper minimum size for the new Solus adju = Gtk.Adjustment.new(dmin, dmin, dmax, 1, 10, 0) self.spin.set_adjustment(adju) self.spin.set_digits(2) os_name = os.name # We need this much min_we_needs = format_size_local(min_gb, double_precision=True) # They need this much min_they_needs = format_size_local(used, double_precision=True) # Total of this much max_avail = format_size_local(avail - used, double_precision=True) total_size = format_size_local(avail, double_precision=True) l = "Resize the partition containing {} to make room for the " \ "new Solus installation.\n" \ "Solus requires a minimum of {} disk space for the installation" \ ", so free up <b>at least {}</b>\nfrom the maximum available " \ "{}\n{} will require a minimum of {} from the total {}".format( os_name, min_we_needs, min_we_needs, max_avail, "Your currently installed operating system", min_they_needs, total_size) self.info_label.set_markup(l)
def update_strategy(self, info): self.info = info info.owner.set_can_next(True) os = info.strategy.sel_os self.image.set_from_icon_name(os.icon_name, Gtk.IconSize.DIALOG) self.image.set_pixel_size(64) self.label.set_markup("<big>{}</big>".format(os.name)) used = info.strategy.candidate_part.min_size avail = info.strategy.candidate_part.size GB = 1000.0 * 1000.0 * 1000.0 min_gb = MIN_REQUIRED_SIZE dmin = float(used / GB) dmax = float((avail - min_gb) / GB) # Set upper minimum size for the new Solus adju = Gtk.Adjustment.new(dmin, dmin, dmax, 1, 10, 0) self.spin.set_adjustment(adju) self.spin.set_digits(2) os_name = os.name # We need this much min_we_needs = format_size_local(min_gb, double_precision=True) # They need this much min_they_needs = format_size_local(used, double_precision=True) # Total of this much max_avail = format_size_local(avail - used, double_precision=True) total_size = format_size_local(avail, double_precision=True) l = "Resize the partition containing {} to make room for the " \ "new Solus installation.\n" \ "Solus requires a minimum of {} disk space for the installation" \ ", so free up <b>at least {}</b>\nfrom the maximum available " \ "{}\n{} will require a minimum of {} from the total {}".format( os_name, min_we_needs, min_we_needs, max_avail, "Your currently installed operating system", min_they_needs, total_size) self.info_label.set_markup(l)
def on_value_changed(self, spin, w=None): if not self.info: return val = self.spin.get_value() avail = self.info.strategy.candidate_part.size GB = 1000.0 * 1000.0 * 1000.0 nval = (avail / GB) - val ssize = format_size_local(nval * GB, double_precision=True) self.size_label.set_markup(ssize) self.info.strategy.set_our_size(nval * GB) self.info.strategy.set_their_size(avail - (nval * GB))
def on_value_changed(self, spin, w=None): if not self.info: return val = self.spin.get_value() avail = self.info.strategy.candidate_part.size GB = 1000.0 * 1000.0 * 1000.0 nval = (avail / GB) - val ssize = format_size_local(nval * GB, double_precision=True) self.size_label.set_markup(ssize) self.info.strategy.set_our_size(nval * GB) self.info.strategy.set_their_size(avail - (nval * GB))
def push_swap(self, part): model = self.treeview.get_model() partSizeActual = part.getLength() * part.disk.device.sectorSize partSize = format_size_local(partSizeActual) model.append([ part.path, "swap", None, False, NO_HAZ_ASSIGN, partSize, None, None, partSizeActual ])
def describe(self): return "Create {} physical volume on {}".format( format_size_local(self.size, True), self.device.path)
def describe(self): return "Create {} LUKS container on {}".format( format_size_local(self.size, True), self.device.path)
def describe(self): return "Create {} root partition on {}".format( format_size_local(self.size, True), self.device.path)
def describe(self): return "Create {} root partition on {}".format( format_size_local(self.size, True), self.device.path)