Skip to content

Commit

Permalink
Remove TreeNode as a pseudo-widget
Browse files Browse the repository at this point in the history
This encourages importing it from `textual.widgets.tree` instead, keeping it
in line with the other changes made for #1637.

Note this is a breaking change.
  • Loading branch information
davep committed Jan 23, 2023
1 parent d4c7158 commit 4adfe69
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion examples/json_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from rich.text import Text

from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Tree, TreeNode
from textual.widgets import Header, Footer, Tree
from textual.widgets.tree import TreeNode


class TreeApp(App):
Expand Down
2 changes: 0 additions & 2 deletions src/textual/widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from ._static import Static
from ._text_log import TextLog
from ._tree import Tree
from ._tree_node import TreeNode
from ._welcome import Welcome
from ..widget import Widget

Expand All @@ -44,7 +43,6 @@
"Static",
"TextLog",
"Tree",
"TreeNode",
"Welcome",
]

Expand Down
1 change: 0 additions & 1 deletion src/textual/widgets/_tree_node.py

This file was deleted.

3 changes: 2 additions & 1 deletion tests/tree/test_tree_node_children.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from textual.widgets import Tree, TreeNode
from textual.widgets import Tree
from textual.widgets.tree import TreeNode


def label_of(node: TreeNode[None]):
Expand Down
3 changes: 2 additions & 1 deletion tests/tree/test_tree_node_label.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from textual.widgets import Tree, TreeNode
from textual.widgets import Tree
from textual.widgets.tree import TreeNode
from rich.text import Text


Expand Down
2 changes: 1 addition & 1 deletion tests/tree/test_tree_node_parent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from textual.widgets import TreeNode, Tree
from textual.widgets import Tree


def test_tree_node_parent() -> None:
Expand Down

0 comments on commit 4adfe69

Please sign in to comment.