textual_fspicker.path_filters
Code to handle the filters for the dialogs.
FilterFunction
module-attribute
Type of a path filter function.
Filter
Bases: NamedTuple
A path filter.
name
instance-attribute
name
The name of the filter.
This is the text that will be presented to the user in the filtering dropdown widget inside any dialog
tester
instance-attribute
tester
The test function for the filter.
This is the function that will be called to test of a particular
Path
passes the filter.
Filters
Filters(*filters)
A path filter collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Filter | tuple[str, FilterFunction]
|
The initial set of filters. |
()
|
__bool__
__bool__()
__getitem__
__getitem__(filter_id)
Get a filter given its numeric ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
int
|
The numeric ID for the filter. |
required |
Returns:
Type | Description |
---|---|
Filter
|
The filter with that ID. |
This is intended to be used in conjunction with
selections
; where the
return value for that will include a numeric ID for each filter that
can be used with a Textual Select
widget.