sepal_ui.sepalwidgets.inputs.FileInput#

class sepal_ui.sepalwidgets.inputs.FileInput(**kwargs)[source]#

Custom input field to select a file in the sepal folders.

Parameters:
  • extensions (List[str]) – the list of the allowed extensions. the FileInput will only display these extension and folders

  • folder (Path) – the starting folder of the file input

  • label (str) – the label of the input

  • v_model (Unicode) – the default value

  • clearable (bool) – whether or not to make the widget clearable. default to False

  • root (Unicode) – the root folder from which you cannot go higher in the tree.

  • kwargs – any parameter from a v.Flex abject. If set, ‘children’ will be overwritten.

Attributes

ICON_STYLE

the style applied to the icons in the file menu

clear

clear btn to remove everything and set back to the ini folder

close_menu

extensions

the extensions list

file

the current file

file_list

the list of files and folder that are available in the current folder

file_menu

the menu that hide and show the file_list

folder

the current folder

initial_folder

the starting point of the file input

loading

loading top bar of the menu component

reload

reload btn to reload the file list on the current folder

root

the root folder from which you cannot go higher in the tree.

selected_file

the textfield where the file pathname is stored

v_model

the v_model of the input

Methods

__init__

Custom input field to select a file in the sepal folders.

reset

Clear the File selection and move to the root folder.

select_file

Manually select a file from it's path.

FileInput.__init__(extensions=[], folder=PosixPath('/home/docs'), label='search file', v_model='', clearable=False, root='', cache=False, **kwargs)[source]#

Custom input field to select a file in the sepal folders.

Parameters:
  • extensions (List[str]) – the list of the allowed extensions. the FileInput will only display these extension and folders

  • folder (str | Path) – the starting folder of the file input

  • label (str) – the label of the input

  • v_model (str) – the default value

  • clearable (bool) – whether or not to make the widget clearable. default to False

  • root (str | Path) – the root folder from which you cannot go higher in the tree.

  • kwargs – any parameter from a v.Flex abject. If set, ‘children’ will be overwritten.

Return type:

None

FileInput.reset(*args)[source]#

Clear the File selection and move to the root folder.

Return type:

Self

FileInput.select_file(path)[source]#

Manually select a file from it’s path. No verification on the extension is performed.

Parameters:

path (str | Path) – the path to the file

Return type:

Self