def get_ui_sources_list(self, e): lst = UI.Select(name='disk') cst = True for p in backend.list_partitions(): s = p try: s += ': %s partition %s' % (backend.get_disk_vendor(p), p[-1]) except: pass sel = e != None and e.src == p cst &= not sel lst.append(UI.SelectOption(value=p, text=s, selected=sel)) for p in backend.list_partitions(): u = backend.get_partition_uuid_by_name(p) if u != '': s = 'UUID=' + u sel = e != None and e.src == s cst &= not sel lst.append( UI.SelectOption(value=s, text=p + ': ' + u, selected=sel)) lst.append( UI.SelectOption(text='proc', value='proc', selected=e.src == 'proc')) cst &= e.src != 'proc' lst.append(UI.SelectOption(text='Custom', value='custom', selected=cst)) return lst, cst
def get_ui_sources_list(self, e): lst = UI.Select(name='disk') cst = True for p in backend.list_partitions(): s = p try: s += ': %s partition %s' % (backend.get_disk_vendor(p), p[-1]) except: pass sel = e != None and e.src == p cst &= not sel lst.append(UI.SelectOption(value=p, text=s, selected=sel)) for p in backend.list_partitions(): u = backend.get_partition_uuid_by_name(p) if u != '': s = 'UUID=' + u sel = e != None and e.src == s cst &= not sel lst.append(UI.SelectOption(value=s, text=p+': '+u , selected=sel)) lst.append(UI.SelectOption(text='proc', value='proc', selected=e.src=='proc')) cst &= e.src != 'proc' lst.append(UI.SelectOption(text='Custom', value='custom', selected=cst)) return lst, cst