def __init__(self, device, size, color, show_in_bar=True): self.device = device self.title = '' if device.startswith('/'): self.title = find_in_os_prober(device) if self.title: self.title = '%s (%s)' % (self.title, device) else: self.title = device self.set_size(size) self.color = color self.show_in_bar = show_in_bar self.layout_width = 0 self.layout_height = 0
def __init__(self, path, size, fs, name=None): self.size = size self.fs = fs self.next = None self.index = None self.path = path if name is not None: self.name = name return if self.fs != 'linux-swap': # Do not go through find_in_os_prober() for swap: it returns # 'swap', which is not helpful since we show the filesystem anyway. # Better continue to the fallback of showing the partition name. name = find_in_os_prober(path) if not name: name = path.replace('/dev/', '') self.name = '%s (%s)' % (name, fs)
def name_from_path(path): return find_in_os_prober(path) or path.replace('/dev/', '')
def name_from_path(path): return find_in_os_prober(path) or path.replace("/dev/", "")