コード例 #1
0
ファイル: test_i3_cycle.py プロジェクト: wwalker/i3-cycle
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
コード例 #2
0
ファイル: test_i3_tree.py プロジェクト: mota/i3-tree
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
コード例 #3
0
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)
コード例 #4
0
ファイル: i3_cycle.py プロジェクト: mota/i3-cycle
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)
コード例 #5
0
ファイル: test_i3_tree.py プロジェクト: mota/i3-tree
def tree(json_tree):
    return i3Tree(json_tree)