Until now it wasn't really possible to know *which* DirectoryTree widget had
sent a given message; this makes it available by providing the `node`, which
in turn will provide the `tree`.
A couple of things come with this, at least one being a breaking change of
sorts:
- DirectoryTree now has a path attribute
- DirectoryTree.path is a reactive
- When DirectoryTree.path is assigned to it rebuilds the tree content
- DirectoryTree.path can be assigned a str or Path but always evaluates to a Path
- DirEntry.path is now typed as a Path
- DirEntry drops is_dir (Directory.path.is_dir() does that job)
- DirectoryTree.FileSelected.path is now always a Path
This is the first of what might be a few changes here; the main thrust of
this commit being to allow changing a DirectoryTree to view a different
directory, and also to move to a Path-first approach.
* Export types used in app.py
* Export more linked types/errors/classes.
* Remove custom template.
* Address review comments.
We need to have explicit 'Returns:' sections in properties if we want to link to the return type while https://github.com/mkdocstrings/python/issues/65 is open.
* Improve docs.
In doing so this removes the file similarity value, and as such the key that
the failure report was sorted on. This was done because, given how many
snapshot tests we have now, if lots failed, it would take a long time (often
many minutes) to compile the report.
The report is now sorted on the test name.
Now, no matter how many snapshots fail, the report should be produced pretty
much instantly.
This is a series of tests for checking styles that have sub-styles, or
sub-parts, or whatever the correct name would be; the testing being that if
!important is applied to the whole, that it works.
Starting with #2420 it became apparent that this didn't work as intended,
and once that work started it became obvious that it affected more than just
border.
So these tests test all of the styles that can be specified as a single
whole, or as a set of parts (sides, directions, etc).
See https://github.com/Textualize/textual/pull/2442#issuecomment-1529512891
This changes the original PR so that, rather than calling a private watcher
instead of a public, as originally issued, we now call public and private,
if they're both there.
If they are both there private is called first.
This change allows for private watch methods. By convention they start with
an underscore. If a reactive or var has a private watch method, it will be
used in preference to a public watch method.
With this change it becomes easier to have a private reactive/var whose
watcher is also private. For example:
_counter = var(0)
"""This is a private counter, it won't appear in the docs."
...
def _watch__counter(self) -> None:
"""Watch _counter, but don't appear in the docs either."
...
See #2382.