Module for handling libget packages.
Project description
py_libget 0.0.0
About^
Module for handling libget packages.
Requirements^
['py_simple_ttk']
Objects^
repository^
An object for interaction with all parts of a libget repository.
class repository(package_manager, parser, webhandler):
def __init__(self, name: str, domain: str, defer_load: bool = True, force_cached: bool = False):
...
def check_if_get_init(self) -> bool:
"""Check if the libget packages folder has been inited at target location. `Returns True if libget dir exists."""
def clean_version(self, ver: str, name: str) -> str:
"""Clean a version. `Returns a String`"""
def clear(self) -> dict:
"""Alias for parser.init `Returns a Dict mapping package names as Strings to package entries as Dicts`"""
def download(self, url: str, file: str) -> str:
"""Downloads a file at a given url to a given location.
`Returns the file name as a String`"""
def edit_info(self, name: str, key: str, value) -> None:
"""Edit a value in an installed package's info values. `Returns None`"""
def get_cached_json(self, name: str):
...
def get_icon(self, name: str, force: bool = False) -> str:
"""Downloads icon for a given package if needed. The force keyword argument forces a redownload of the file.
`Returns the icon file's path as a String`"""
def get_json(self, name: str, url: str):
...
def get_package(self, name: str) -> str:
"""Downloads the current zip for a given package. `Returns the downloaded file's path as a String`"""
def get_package_dict(self, name: str) -> dict:
"""Get entry for a given package name. `Returns a Dict, empty on failure.`"""
def get_package_entry(self, name: str) -> dict:
"""Get the contents of a package's info file. `Returns a Dict, empty on failure.`"""
def get_package_manifest(self, name: str) -> list:
"""Returns a package's manifest. `Returns a List of the real file paths as Strings`"""
def get_package_value(self, name: str, key: str) -> str | None:
"""Get a package's json file value. `Returns the value (usually a String) or None on failure."""
def get_package_version(self, name: str) -> str:
"""Get the currently installed version of a package. `Returns a String`"""
def get_packages(self) -> list:
"""Get a list of currently installed packages. `Returns a List`"""
def get_screenshot(self, name: str, force: bool = False) -> str:
"""Downloads screenshot for a given package if needed. The force keyword argument forces a redownload of the file.
`Returns the screenshot file's path as a String`"""
def init(self) -> None:
"""Reinitialize parser. `Returns a Dict mapping package names as Strings to package entries as Dicts`"""
def init_get(self) -> None:
"""Initializes the libget dir at the current install path. `Returns None.`"""
def install_package(self, package: dict, handler: Callable = None):
"""Installs a libget package, supply a callable handler to take a tuple containing a status and a message. A negative status is an error. Status is in the form of an integer from 0 to 100 during normal install progression."""
def load_cached_repo(self) -> list:
"""Loads / reloads repo from cached file. `Returns the loaded repo as a List.`"""
def load_repo(self) -> str:
"""Loads / reloads repo from file. `Returns the loaded repo as a List.`"""
def load_repo_file(self, repo_file: str) -> list:
"""Loads appstore json. `Returns a List of Dicts`"""
def reload(self) -> list:
"""Reloads the list of installed packages. `Returns a List of packages installed.`"""
def remove_store_entry(self, name: str):
"""THIS DOES NOT REMOVE THE PACKAGE FILES Removes a package entry by deleting the package folder containing the manifest and info.json"""
def set_path(self, path: str) -> list:
"""Set this to a root of an sd card if building an application or in a dir to test. `Returns a List of packages installed at the given path.`"""
def uninstall_package(self, package: dict, handler: Callable = None):
"""Uninstalls a libget package, supply a callable handler to take a tuple containing a status and a message. A negative status is an error. Status is in the form of an integer from 0 to 100 during normal install progression."""
package_manager^
Object for managing package libget package installation
class package_manager(object):
def __init__(self, webhandler, libget_dir: str = '.libget'):
...
def check_if_get_init(self) -> bool:
"""Check if the libget packages folder has been inited at target location. `Returns True if libget dir exists."""
def edit_info(self, name: str, key: str, value) -> None:
"""Edit a value in an installed package's info values. `Returns None`"""
def get_package_entry(self, name: str) -> dict:
"""Get the contents of a package's info file. `Returns a Dict, empty on failure.`"""
def get_package_manifest(self, name: str) -> list:
"""Returns a package's manifest. `Returns a List of the real file paths as Strings`"""
def get_package_value(self, name: str, key: str) -> str | None:
"""Get a package's json file value. `Returns the value (usually a String) or None on failure."""
def get_package_version(self, name: str) -> str:
"""Get the currently installed version of a package. `Returns a String`"""
def get_packages(self) -> list:
"""Get a list of currently installed packages. `Returns a List`"""
def init_get(self) -> None:
"""Initializes the libget dir at the current install path. `Returns None.`"""
def install_package(self, package: dict, handler: Callable = None):
"""Installs a libget package, supply a callable handler to take a tuple containing a status and a message. A negative status is an error. Status is in the form of an integer from 0 to 100 during normal install progression."""
def reload(self) -> list:
"""Reloads the list of installed packages. `Returns a List of packages installed.`"""
def remove_store_entry(self, name: str):
"""THIS DOES NOT REMOVE THE PACKAGE FILES Removes a package entry by deleting the package folder containing the manifest and info.json"""
def set_path(self, path: str) -> list:
"""Set this to a root of an sd card if building an application or in a dir to test. `Returns a List of packages installed at the given path.`"""
def uninstall_package(self, package: dict, handler: Callable = None):
"""Uninstalls a libget package, supply a callable handler to take a tuple containing a status and a message. A negative status is an error. Status is in the form of an integer from 0 to 100 during normal install progression."""
parser^
Object to hold and parse ligbet repo
class parser(object):
def __init__(self, ):
...
def clean_version(self, ver: str, name: str) -> str:
"""Clean a version. `Returns a String`"""
def clear(self) -> dict:
"""Alias for parser.init `Returns a Dict mapping package names as Strings to package entries as Dicts`"""
def get_package_dict(self, name: str) -> dict:
"""Get entry for a given package name. `Returns a Dict, empty on failure.`"""
def init(self) -> None:
"""Reinitialize parser. `Returns a Dict mapping package names as Strings to package entries as Dicts`"""
def load_repo_file(self, repo_file: str) -> list:
"""Loads appstore json. `Returns a List of Dicts`"""
webhandler^
Object to handle libget icon, screenshot, and package downloads.
class webhandler(object):
def __init__(self, domain: str):
...
def download(self, url: str, file: str) -> str:
"""Downloads a file at a given url to a given location.
`Returns the file name as a String`"""
def get_cached_json(self, name: str):
...
def get_icon(self, name: str, force: bool = False) -> str:
"""Downloads icon for a given package if needed. The force keyword argument forces a redownload of the file.
`Returns the icon file's path as a String`"""
def get_json(self, name: str, url: str):
...
def get_package(self, name: str) -> str:
"""Downloads the current zip for a given package. `Returns the downloaded file's path as a String`"""
def get_screenshot(self, name: str, force: bool = False) -> str:
"""Downloads screenshot for a given package if needed. The force keyword argument forces a redownload of the file.
`Returns the screenshot file's path as a String`"""
Changelog^
0.0.0^
Create Project
Generated with py_simple_readme
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py_libget-0.0.0.tar.gz
(22.2 kB
view details)
Built Distribution
py_libget-0.0.0-py3-none-any.whl
(22.7 kB
view details)
File details
Details for the file py_libget-0.0.0.tar.gz
.
File metadata
- Download URL: py_libget-0.0.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c87ac7fccea3b10802b3add5dafe594d828ee2c0d0e56680390474d9f996e77 |
|
MD5 | 120e4ab61e13de65a80aadcd94651f02 |
|
BLAKE2b-256 | 07536112b7cb85498287cdb2d6e7a2459c9ab3b43ace4760d8dda719ed6615b5 |
File details
Details for the file py_libget-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: py_libget-0.0.0-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd16d5ea589912b6d08927db51e991acbb88c08ec961c8ef71b7ef5ec0479cee |
|
MD5 | 27f2a562b164002d03fbe85a50f4b024 |
|
BLAKE2b-256 | 2ad0d069f089cb60cc3158e3ec0b4b145265130b73c26358786bda67132f373c |