class documentation
class FileBrowser:
Constructor: FileBrowser(view_manager, mode, start_directory, allowed_extensions)
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 |
Undocumented |
| Constant | ACT |
Undocumented |
| Constant | ACT |
Undocumented |
| Constant | ACT |
Undocumented |
| Constant | ACT |
Undocumented |
| Constant | ACT |
Undocumented |
| Constant | ACT |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | MODE |
Undocumented |
| Constant | OPTIONS |
Undocumented |
| Constant | PANE |
Undocumented |
| Constant | PANE |
Undocumented |
| Constant | TEXT |
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 |
Start editing a text file. |
| Method | __file |
View a file (image or text) based on its extension. |
| Method | __load |
Load the contents of a directory. |
| Method | __loading |
Run a loading animation with a title and percentage completion. |
| Method | __menu |
Construct a pop-up context menu overlaid on the main interface. |
| Method | __refresh |
Refresh the file lists for both panes. |
| Method | __render |
Draw the UI based on the current state. |
| Method | __save |
Save user settings. |
| Method | __sx |
Scale a width/X coordinate. |
| Method | __sy |
Scale a height/Y coordinate. |
| Instance Variable | _add |
Undocumented |
| Instance Variable | _allowed |
Undocumented |
| Instance Variable | _app |
Undocumented |
| Instance Variable | _confirm |
Undocumented |
| Instance Variable | _context |
Undocumented |
| Instance Variable | _context |
Undocumented |
| Instance Variable | _cursor |
Undocumented |
| Instance Variable | _edit |
Undocumented |
| Instance Variable | _edit |
Undocumented |
| Instance Variable | _editor |
Undocumented |
| Instance Variable | _five |
Undocumented |
| Instance Variable | _image |
Undocumented |
| Instance Variable | _image |
Undocumented |
| Instance Variable | _info |
Undocumented |
| Instance Variable | _info |
Undocumented |
| Instance Variable | _input |
Undocumented |
| Instance Variable | _input |
Undocumented |
| Instance Variable | _input |
Undocumented |
| Instance Variable | _input |
Undocumented |
| Instance Variable | _is |
Undocumented |
| Instance Variable | _is |
Undocumented |
| Instance Variable | _is |
Undocumented |
| Instance Variable | _is |
Undocumented |
| Instance Variable | _is |
Undocumented |
| Instance Variable | _is |
Undocumented |
| Instance Variable | _jpeg |
Undocumented |
| Instance Variable | _loading |
Undocumented |
| Instance Variable | _mode |
Undocumented |
| Instance Variable | _needs |
Undocumented |
| Instance Variable | _opt |
Undocumented |
| Instance Variable | _pending |
Undocumented |
| Instance Variable | _pending |
Undocumented |
| Instance Variable | _screen |
Undocumented |
| Instance Variable | _screen |
Undocumented |
| Instance Variable | _show |
Undocumented |
| Instance Variable | _show |
Undocumented |
| Instance Variable | _stat |
Undocumented |
| Instance Variable | _text |
Undocumented |
| Instance Variable | _text |
Undocumented |
| Instance Variable | _vm |
Undocumented |
def __init__(self, view_manager, mode=FILE_BROWSER_SELECTOR, start_directory='', allowed_extensions=[]):
¶
Initialize the file browser.
| Parameters | |
viewViewManager | The view manager context. |
mode:int | The browser mode. Defaults to FILE_BROWSER_SELECTOR. |
startstr | The starting directory path. Defaults to "". |
allowedlist | Extensions of files to show. Defaults to []. |
Start editing a text file.
| Parameters | |
path:str | The path to the text file to edit. |
| Returns | |
bool | True if editing started, False otherwise. |
Load the contents of a directory.
| Parameters | |
path:str | The directory path to read. |
| Returns | |
list | The sorted list of entry names. |
Run a loading animation with a title and percentage completion.
| Parameters | |
title:str | The loading message to display. |
percentage:float | Completion from 0.0 to 1.0. |