module documentation

Stick firmware package handler

Class ManifestV1App Manifest V1 Class
Exception ManifestParseError Undocumented
Exception NotEnoughFlash Undocumented
Exception PackageReadFailed Undocumented
Exception PackageSizeTooHigh Undocumented
Exception UnknownManifestVersion Undocumented
Function check_version_from_class Get manifest version from class
Function clean_pack_file Cleans pack file to not start with dot (.) or slash (/)
Function get_manifest Gets manifest class from zip package
Function get_packed_file Gets file from zip archive
Function get_packed_file_bytes Slightly better file getter
Function install Install app package
Function open_file Context menu gui installer
Constant _FLASH_FREE_SPACE_MULTI Undocumented
Constant _MAX_PACKAGE_SIZE Undocumented
def check_version_from_class(obj) -> int:

Get manifest version from class Args: obj (any): Manifest class Return: int: Manifest version or 0 if unknown

def clean_pack_file(path: str) -> str:

Cleans pack file to not start with dot (.) or slash (/) Args: path (str): Path Return: str: Cleaned up path

def get_manifest(zip_package: str) -> any:

Gets manifest class from zip package Args: zip_package (str): Path to app archive Return: any: Manifest class

def get_packed_file(zip_path, filename):

Gets file from zip archive Args: zip_path (str): Path to zip archive filename (str): Path to file in zip archive (were / is the root of zip archive) Return: str | None: File content or None if failed to unpack

def get_packed_file_bytes(zip_path, filename, chunk_size=1024):

Slightly better file getter Args: zip_path (str): Path to zip archive filename (str): Path to file in zip archive (were / is the root of zip archive) Return: str | None: File content or None if failed to unpack

def install(zip_package, delete_app_package=True):

Install app package Args: zip_package (str): Path to app package delete_app_package (bool, optional): True if you want to delete app package after successful install Return: bool: True if success, False if failed

def open_file(path):

Context menu gui installer Args: path (str): Path to app package

_FLASH_FREE_SPACE_MULTI: float =

Undocumented

Value
2.5
_MAX_PACKAGE_SIZE =

Undocumented

Value
128 * 1024