class documentation

Class to handle file browsing, text editing, and image viewing within Picoware.

Method __del__ Cleanup resources to prevent RAM build-up.
Method __init__ Initialize the file browser.
Method run Run the app.
Constant ACT_AUDIO Undocumented
Constant ACT_COPY Undocumented
Constant ACT_DELETE Undocumented
Constant ACT_FLASH Undocumented
Constant ACT_MOVE Undocumented
Constant ACT_NONE Undocumented
Constant ACT_RENAME Undocumented
Constant MODE_COPY_SAME Undocumented
Constant MODE_EDITING Undocumented
Constant MODE_EXIT Undocumented
Constant MODE_MENU Undocumented
Constant MODE_MKDIR Undocumented
Constant MODE_NONE Undocumented
Constant MODE_RENAME Undocumented
Constant MODE_SELECT Undocumented
Constant OPTIONS_LABELS Undocumented
Constant PANE_LEFT Undocumented
Constant PANE_RIGHT Undocumented
Constant TEXT_EDITABLE_EXTENSIONS Undocumented
Property directory Get the current directory path.
Property mode Get the current mode of the file browser.
Property path Get the current path.
Property stats Get statistics about the current file.
Method __file_edit Start editing a text file.
Method __file_view View a file (image or text) based on its extension.
Method __load_directory_contents Load the contents of a directory.
Method __loading_run Run a loading animation with a title and percentage completion.
Method __menu_spawn Construct a pop-up context menu overlaid on the main interface.
Method __refresh_panes Refresh the file lists for both panes.
Method __render Draw the UI based on the current state.
Method __save_settings Save user settings.
Method __sx Scale a width/X coordinate.
Method __sy Scale a height/Y coordinate.
Instance Variable _add_info Undocumented
Instance Variable _allowed_extensions Undocumented
Instance Variable _app_state Undocumented
Instance Variable _confirm_menu Undocumented
Instance Variable _context_menu Undocumented
Instance Variable _context_target_path Undocumented
Instance Variable _cursor_frame Undocumented
Instance Variable _edit_file Undocumented
Instance Variable _edit_unsaved Undocumented
Instance Variable _editor_state Undocumented
Instance Variable _five Undocumented
Instance Variable _image_load_state Undocumented
Instance Variable _image_path Undocumented
Instance Variable _info_box Undocumented
Instance Variable _info_data Undocumented
Instance Variable _input_active Undocumented
Instance Variable _input_cursor Undocumented
Instance Variable _input_mode Undocumented
Instance Variable _input_text Undocumented
Instance Variable _is_caps Undocumented
Instance Variable _is_editing Undocumented
Instance Variable _is_help_screen Undocumented
Instance Variable _is_shift Undocumented
Instance Variable _is_viewing_image Undocumented
Instance Variable _is_viewing_text Undocumented
Instance Variable _jpeg_vec Undocumented
Instance Variable _loading Undocumented
Instance Variable _mode Undocumented
Instance Variable _needs_redraw Undocumented
Instance Variable _opt_idx Undocumented
Instance Variable _pending_action Undocumented
Instance Variable _pending_dest_path Undocumented
Instance Variable _screen_h Undocumented
Instance Variable _screen_w Undocumented
Instance Variable _show_info Undocumented
Instance Variable _show_options Undocumented
Instance Variable _stat_cache Undocumented
Instance Variable _text_editor Undocumented
Instance Variable _text_viewer_box Undocumented
Instance Variable _vm Undocumented
def __del__(self):

Cleanup resources to prevent RAM build-up.

def __init__(self, view_manager, mode=FILE_BROWSER_SELECTOR, start_directory='', allowed_extensions=[]):

Initialize the file browser.

Parameters
view_manager:ViewManagerThe view manager context.
mode:intThe browser mode. Defaults to FILE_BROWSER_SELECTOR.
start_directory:strThe starting directory path. Defaults to "".
allowed_extensions:listExtensions of files to show. Defaults to [].
def run(self) -> bool:

Run the app.

Returns
boolTrue to continue running, False to exit the app.
ACT_AUDIO =

Undocumented

Value
const(6)
ACT_COPY =

Undocumented

Value
const(2)
ACT_DELETE =

Undocumented

Value
const(1)
ACT_FLASH =

Undocumented

Value
const(5)
ACT_MOVE =

Undocumented

Value
const(3)
ACT_NONE =

Undocumented

Value
const(0)
ACT_RENAME =

Undocumented

Value
const(4)
MODE_COPY_SAME =

Undocumented

Value
const(3)
MODE_EDITING: int =

Undocumented

Value
0
MODE_EXIT: int =

Undocumented

Value
2
MODE_MENU: int =

Undocumented

Value
1
MODE_MKDIR =

Undocumented

Value
const(1)
MODE_NONE =

Undocumented

Value
const(0)
MODE_RENAME =

Undocumented

Value
const(2)
MODE_SELECT: int =

Undocumented

Value
3
OPTIONS_LABELS: tuple[str, ...] =

Undocumented

Value
('Hidden Files', 'Dir Enter')
PANE_LEFT =

Undocumented

Value
const(0)
PANE_RIGHT =

Undocumented

Value
const(1)
TEXT_EDITABLE_EXTENSIONS: tuple[str, ...] =

Undocumented

Value
('txt',
 'py',
 'json',
 'csv',
 'md',
 'ini',
 'log',
...
@property
directory: str =

Get the current directory path.

@property
mode: int =

Get the current mode of the file browser.

@property
path: str =

Get the current path.

@property
stats: dict =

Get statistics about the current file.

def __file_edit(self, path) -> bool:

Start editing a text file.

Parameters
path:strThe path to the text file to edit.
Returns
boolTrue if editing started, False otherwise.
def __file_view(self, path):

View a file (image or text) based on its extension.

Parameters
path:strThe path to the file to view.
def __load_directory_contents(self, path):

Load the contents of a directory.

Parameters
path:strThe directory path to read.
Returns
listThe sorted list of entry names.
def __loading_run(self, title: str, percentage: float):

Run a loading animation with a title and percentage completion.

Parameters
title:strThe loading message to display.
percentage:floatCompletion from 0.0 to 1.0.
def __menu_spawn(self, title: str, items: list):

Construct a pop-up context menu overlaid on the main interface.

Parameters
title:strThe menu title.
items:listThe menu item strings.
Returns
MenuThe constructed Menu instance.
def __refresh_panes(self):

Refresh the file lists for both panes.

def __render(self):

Draw the UI based on the current state.

def __save_settings(self) -> bool:

Save user settings.

Returns
boolTrue on success, False on failure.
def __sx(self, value: int) -> int:

Scale a width/X coordinate.

Parameters
value:intThe unscaled value.
Returns
intThe scaled value.
def __sy(self, value: int) -> int:

Scale a height/Y coordinate.

Parameters
value:intThe unscaled value.
Returns
intThe scaled value.
_add_info =

Undocumented

_allowed_extensions =

Undocumented

_app_state =

Undocumented

_confirm_menu =

Undocumented

_context_menu =

Undocumented

_context_target_path: str =

Undocumented

_cursor_frame =

Undocumented

_edit_file =

Undocumented

_edit_unsaved: bool =

Undocumented

_editor_state =

Undocumented

_five =

Undocumented

_image_load_state: int =

Undocumented

_image_path: str =

Undocumented

_info_box =

Undocumented

_info_data =

Undocumented

_input_active: bool =

Undocumented

_input_cursor: int =

Undocumented

_input_mode =

Undocumented

_input_text: str =

Undocumented

_is_caps: bool =

Undocumented

_is_editing: bool =

Undocumented

_is_help_screen: bool =

Undocumented

_is_shift: bool =

Undocumented

_is_viewing_image: bool =

Undocumented

_is_viewing_text: bool =

Undocumented

_jpeg_vec =

Undocumented

_loading =

Undocumented

_mode =

Undocumented

_needs_redraw: bool =

Undocumented

_opt_idx: int =

Undocumented

_pending_action =

Undocumented

_pending_dest_path: str =

Undocumented

_screen_h =

Undocumented

_screen_w =

Undocumented

_show_info: bool =

Undocumented

_show_options: bool =

Undocumented

_stat_cache =

Undocumented

_text_editor =

Undocumented

_text_viewer_box =

Undocumented

_vm =

Undocumented