Skip to content

textual_fspicker.base_dialog

The base dialog code for the other dialogs in the library.

ButtonLabel module-attribute

ButtonLabel = str | Callable[[str], str]

The type for a button label value.

Dialog

Bases: Vertical

Layout class for the main dialog area.

FileSystemPickerScreen

FileSystemPickerScreen(
    location=".",
    title="",
    select_button="",
    cancel_button="",
)

Bases: ModalScreen[Path | None]

Base screen for the dialogs in this library.

Parameters:

Name Type Description Default

location

str | Path

Optional starting location.

'.'

title

str

Optional title.

''

select_button

ButtonLabel

Label or format function for the select button.

''

cancel_button

ButtonLabel

Label or format function for the cancel button.

''

BINDINGS class-attribute instance-attribute

BINDINGS = [
    Binding("full_stop", "hidden"),
    Binding("escape", "dismiss(None)"),
]

The bindings for the dialog.

ERROR_PERMISSION_ERROR class-attribute instance-attribute

ERROR_PERMISSION_ERROR = 'Permission error'

Error to tell there user there was a problem with permissions.

InputBar

Bases: Horizontal

The input bar area of the dialog.