def parse_layout_names(parts: Iterable[str]) -> List[str]: from kitty.layout.interface import all_layouts ans = [] for p in parts: p = p.lower() if p in ('*', 'all'): ans.extend(sorted(all_layouts)) continue name = p.partition(':')[0] if name not in all_layouts: raise ValueError(f'The window layout {p} is unknown') ans.append(p) return uniq(ans)
def to_layout_names(raw: str) -> List[str]: from kitty.layout.interface import all_layouts parts = [x.strip().lower() for x in raw.split(',')] ans: List[str] = [] for p in parts: if p in ('*', 'all'): ans.extend(sorted(all_layouts)) continue name = p.partition(':')[0] if name not in all_layouts: raise ValueError('The window layout {} is unknown'.format(p)) ans.append(p) return uniq(ans)