FileViewer
Introduction
FileViewer
widget in Supervisely is a useful tool for inspecting and easily navigation through files in specific directory in Team files.
Function signature
Parameters
files_list
Determine pathes to files.
type: List[dict]
selection_type
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
extended_selection
If True
method get_selected_items()
returns a list
of dict
's, instead of list
with paths.
type: bool
default value: False
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/selection/013_file_viewer/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Get Team ID from environment variables
Prepare file pathes
Initialize FileViewer
widget
FileViewer
widgetCreate Text
widgets we will use
Text
widgets we will useCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add function to control widgets from python code
Last updated