def has_ident(ident_spec: IdentSpec) -> Callable[[SimpleView], bool]: ident = ensure_ident_or_generate(ident_spec) def has_ident(view: SimpleView) -> bool: return view.ident == ident return has_ident
def match_ident(spec: IdentSpec) -> Callable[[ViewTree[L, P]], bool]: ident = ensure_ident_or_generate(spec) def match_ident(tree: ViewTree[L, P]) -> bool: return tree.data.ident == ident return match_ident
def cons( ident: IdentSpec, id: int = None, ) -> 'Session': return Session( ensure_ident_or_generate(ident), Maybe.check(id), )
def cons( ident: IdentSpec, id: int = None, ) -> 'Pane': return Pane( ensure_ident_or_generate(ident), Maybe.check(id), )
def cons( ident: IdentSpec, id: int = None, ) -> 'Window': return Window( ensure_ident_or_generate(ident), Maybe.check(id), )
def cons( ident: IdentSpec = None, state: ViewState = None, geometry: ViewGeometry = None, vertical: bool = True, ) -> 'SimpleLayout': return SimpleLayout( ensure_ident_or_generate(ident), state or ViewState.cons(), geometry or ViewGeometry.cons(), Boolean(vertical), )
def cons( ident: IdentSpec = None, state: ViewState = None, geometry: ViewGeometry = None, open: bool = False, cwd: Path = None, pin: bool = False, ) -> 'SimplePane': return SimplePane( ensure_ident_or_generate(ident), state or ViewState.cons(), geometry or ViewGeometry.cons(), Boolean(open), Maybe.optional(cwd), Boolean(pin), )
def has_ident(self, a: A, ident: IdentSpec) -> bool: return self.ident(a) == ensure_ident_or_generate(ident)