textual_fspicker.file_save
Provides a file save dialog.
FileSave
FileSave(
location=".",
title="Save as",
*,
save_button="",
cancel_button="",
filters=None,
can_overwrite=True,
default_file=None,
)
Bases: BaseFileDialog
A file save dialog.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str | Path
|
Optional starting location. |
'.'
|
|
str
|
Optional title. |
'Save as'
|
|
ButtonLabel
|
The label for the save button. |
''
|
|
ButtonLabel
|
The label for the cancel button. |
''
|
|
Filters | None
|
Optional filters to show in the dialog. |
None
|
|
bool
|
Flag to say if an existing file can be overwritten. |
True
|
|
str | Path | None
|
The default filename to place in the input. |
None
|
Notes
open_button
and cancel_button
can either be strings that
set the button label, or they can be functions that take the
default button label as a parameter and return the label to use.
ERROR_OVERWRITE_IS_NOT_ALLOWED
class-attribute
instance-attribute
ERROR_OVERWRITE_IS_NOT_ALLOWED = 'Overwrite is not allowed'
The error to show if the user attempts to overwrite a file.