module documentation

Storage tools for the agent.

Function storage_listdir List the contents of a directory on the SD card.
Function storage_mkdir Create a directory on the SD card.
Function storage_read Read the contents of a file from the SD card.
Function storage_remove Remove a file or directory from the SD card.
Function storage_write Write data to a file on the SD card.
Constant TOOL_STORAGE_LISTDIR Undocumented
Constant TOOL_STORAGE_MKDIR Undocumented
Constant TOOL_STORAGE_READ Undocumented
Constant TOOL_STORAGE_REMOVE Undocumented
Constant TOOL_STORAGE_WRITE Undocumented
def storage_listdir(view_manager, dir_path) -> list[str]:

List the contents of a directory on the SD card.

Parameters
view_manager:ViewManagerThe view manager for storage access.
dir_path:strThe directory path.
Returns
list[str]A list of filenames.
def storage_mkdir(view_manager, dir_path) -> bool:

Create a directory on the SD card.

Parameters
view_manager:ViewManagerThe view manager for storage access.
dir_path:strThe directory path to create.
Returns
boolTrue on success.
def storage_read(view_manager, file_path, mode: str = 'r', index: int = 0, count: int = 0):

Read the contents of a file from the SD card.

Parameters
view_manager:ViewManagerThe view manager for storage access.
file_path:strThe file path.
mode:strThe read mode. Defaults to "r".
index:intThe byte index to start from. Defaults to 0.
count:intThe number of bytes to read. Defaults to 0.
Returns
str or bytesThe file contents.
def storage_remove(view_manager, file_path) -> bool:

Remove a file or directory from the SD card.

Parameters
view_manager:ViewManagerThe view manager for storage access.
file_path:strThe path to remove.
Returns
boolTrue on success.
def storage_write(view_manager, file_path, data, mode: str = 'w') -> bool:

Write data to a file on the SD card.

Parameters
view_manager:ViewManagerThe view manager for storage access.
file_path:strThe file path.
data:str or bytesThe data to write.
mode:strThe write mode. Defaults to "w".
Returns
boolTrue on success.
TOOL_STORAGE_LISTDIR =

Undocumented

Value
Tool(name='storage_listdir',
     description='List the contents of a directory on the SD card.',
     parameters=Parameters(properties=[Property(name='dir_path',
                                                type='string',
                                                description='The path to the dir
ectory on the SD card.',
                                                required=True)]))
TOOL_STORAGE_MKDIR =

Undocumented

Value
Tool(name='storage_mkdir',
     description='Create a directory on the SD card.',
     parameters=Parameters(properties=[Property(name='dir_path',
                                                type='string',
                                                description='The path to the dir
ectory on the SD card.',
                                                required=True)]))
TOOL_STORAGE_READ =

Undocumented

Value
Tool(name='storage_read',
     description='Read the contents of a file from the SD card.',
     parameters=Parameters(properties=[Property(name='file_path',
                                                type='string',
                                                description='The path to the fil
e on the SD card.',
                                                required=True),
...
TOOL_STORAGE_REMOVE =

Undocumented

Value
Tool(name='storage_remove',
     description='Remove a file or directory from the SD card.',
     parameters=Parameters(properties=[Property(name='file_path',
                                                type='string',
                                                description='The path to the fil
e or directory on the SD card.',
                                                required=True)]))
TOOL_STORAGE_WRITE =

Undocumented

Value
Tool(name='storage_write',
     description='Write data to a file on the SD card.',
     parameters=Parameters(properties=[Property(name='file_path',
                                                type='string',
                                                description='The path to the fil
e on the SD card.',
                                                required=True),
...