Commit Graph

10 Commits

Author SHA1 Message Date
Dave Pearson
494c63a72b Tweak the unknown node ID exception
See https://github.com/Textualize/textual/pull/1535#discussion_r1065904713
and https://github.com/Textualize/textual/pull/1535#discussion_r1065909144
2023-01-10 15:28:17 +00:00
Dave Pearson
728acc27c0 Introduce an exception specific to handling an unknown node ID
See https://github.com/Textualize/textual/pull/1535#discussion_r1065873649
2023-01-10 14:57:35 +00:00
Dave Pearson
6ea68cc112 Add Tree.get_node_by_id
The thinking here is that a user of a Tree may want to relate notes to other
parts of their UI, or other data in their application. While this could be
done by keeping a reference to the node itself, it could also be beneficial
to just track the ID. Given that ID is a public property of a TreeNode, but
given it doesn't currently have any other (public) purpose, this seems to
add some useful symmetry.
2023-01-10 10:42:07 +00:00
Dave Pearson
ea8252cfcc Run black over recent Tree tests
Now that we're running black on tests...
2023-01-07 09:30:01 +00:00
Dave Pearson
82dcf62122 Merge pull request #1495 from davep/tree-node-children-prop
Add read-only access to the children of a `TreeNode`
2023-01-06 15:17:39 +00:00
Will McGugan
428ae0e14e Merge branch 'main' into tree-node-parent-prop 2023-01-06 02:11:35 -08:00
Dave Pearson
e5869b9f7b Merge branch 'main' into tree-node-children-prop 2023-01-06 06:18:15 +00:00
Dave Pearson
7779211dcf Add read-only access to the children of a TreeNode
See #1398.
2023-01-05 21:24:47 +00:00
Dave Pearson
27a7cfc489 Add a public read-only parent property to TreeNode
See #1397.
2023-01-05 10:35:25 +00:00
Dave Pearson
d39c59c414 Move the TreeNode label tests into a better-named file
There's going to be a whole bunch of tests relating to the Tree and TreeNode
coming, let's make sure this ends up being fairly granular.

(side thought: it might be a good time soon to revisit all the tests for
Textual and try and wrangle them into some tidy structure)
2023-01-05 10:01:52 +00:00