WiFi Pineapple Python Opkg Helpers
Table of contents
Introduction
Python API
Classes
class OpkgJob(Job[bool])
Methods
def do_work(self, logger: Logger) -> bool
Parameters
- logger: An optional instance of logger to log output from opkg as debug.
Returns
- bool: True if no errors, False if error.
def stop(self)
Functions
def update_repository(logger: Optional[Logger] = None) -> Tuple[bool, str]
Parameters
- logger: Optional instance of logger to log output from opkg as debug.
Returns
- bool: True if successful, False if it was not.
- str: Empty if successful, error message if it was not.
def check_if_installed(package: str, logger: Optional[Logger] = None) -> bool
Parameters
- package: The name of the package to search for.
- logger: An optional instance of logger to log output from opkg as debug.
Returns
- bool: True if package installed, False if it is not.
def install_dependency(package: str, logger: Optional[Logger] = None, skip_repo_update: bool = False) -> [bool, str]
Parameters
- package: The name of the package to install.
- logger: An optional instance of logger to log output from opkg as debug.
- skip_repo_update: True to skip running `opkg update`. An internet connection will still be checked for.
Returns
- bool: True if the package was installed, False if it as not.
- str: Empty if successful, error message if it was not.
def uninstall_dependency(package: str, logger: Optional[Logger] = None) -> [bool, str]
Parameters
- package: The name of the package to install.
- logger: An optional instance of logger to log output from opkg as debug.
Returns
- bool: True if the package was installed, False if it as not.
- str: Empty if successful, error message if it was not.