def trees(): tree_list = [] with open(TREE_PATHS["first"], "r") as handle: tree_list.append(i3Tree(json.load(handle))) with open(TREE_PATHS["second"], "r") as handle: tree_list.append(i3Tree(json.load(handle))) return tree_list
def test_tree_created(json_tree): tree = i3Tree(json_tree) assert tree.raw_tree assert tree.root assert tree.root.children assert tree.root.children_dict assert tree.root.has_focus assert tree.root.focused_child
def main(): """ Entry point """ parser = ArgumentParser() parser.add_argument("direction", choices=("up", "down", "left", "right", "next", "prev"), help="Direction to put the focus on") args = parser.parse_args() tree = i3Tree() con = None if args.direction in ("next", "prev"): con = cycle_outputs(tree, args.direction) else: con = cycle_windows(tree, args.direction) if con: i3.focus(con_id=con.id)
def main(): """ Entry point """ parser = ArgumentParser() parser.add_argument("direction", choices=( "up", "down", "left", "right", "next", "prev" ), help="Direction to put the focus on") args = parser.parse_args() tree = i3Tree() con = None if args.direction in ("next", "prev"): con = cycle_outputs(tree, args.direction) else: con = cycle_windows(tree, args.direction) if con: i3.focus(con_id=con.id)
def tree(json_tree): return i3Tree(json_tree)