FileViewer
Last updated
Last updated
FileViewer
widget in Supervisely is a useful tool for inspecting and easily navigation through files in specific directory in Team files.
files_list
List[dict]
List of dicts with files and folders info
selection_type
Literal[None, "file", "folder"]
Type of data to select
extended_selection
bool
If True
method get_selected_items()
returns a list
of dict
's, instead of list
with paths
widget_id
str
ID of the widget
Determine pathes to files.
type: List[dict]
Type of data to select. If set to 'file'
- only files can be selected, if set to 'folder'
- only folders can be selected. If set to None
- both files and folders can be selected.
type: Literal[None, "file", "folder"]
default value: None
If True
method get_selected_items()
returns a list
of dict
's, instead of list
with paths.
type: bool
default value: False
ID of the widget.
type: str
default value: None
loading
Get or set loading
property.
get_selected_items()
Return selected items.
get_current_path()
Return current path to files.
update_file_tree(files_list: List[dict])
Update files tree by given files list.
@path_changed
Decorator function is handled then input path changed.
@value_changed
Decorator function is handled then input value changed.
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/selection/013_file_viewer/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
FileViewer
widgetText
widgets we will usePrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.