mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
♻️ Fixed update checker
This commit is contained in:
+10
-12
@@ -97,7 +97,7 @@ class Patches(object):
|
|||||||
a string, which is the package name corresponding to the given app name.
|
a string, which is the package name corresponding to the given app name.
|
||||||
"""
|
"""
|
||||||
for package, app_name in Patches.revanced_package_names.items():
|
for package, app_name in Patches.revanced_package_names.items():
|
||||||
if app_name == app:
|
if app_name.upper() == app.upper():
|
||||||
return package
|
return package
|
||||||
msg = f"App {app} not supported officially yet. Please provide package name in env to proceed."
|
msg = f"App {app} not supported officially yet. Please provide package name in env to proceed."
|
||||||
raise AppNotFoundError(msg)
|
raise AppNotFoundError(msg)
|
||||||
@@ -150,27 +150,25 @@ class Patches(object):
|
|||||||
self.fetch_patches(config, app)
|
self.fetch_patches(config, app)
|
||||||
|
|
||||||
def get(self: Self, app: str) -> tuple[list[dict[str, str]], str]:
|
def get(self: Self, app: str) -> tuple[list[dict[str, str]], str]:
|
||||||
"""
|
"""The function `get` returns all patches and version for a given application.
|
||||||
Returns all patches and the latest version for a given application.
|
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
app : str
|
app : str
|
||||||
The name of the application for which patches need to be retrieved.
|
The `app` parameter is a string that represents the name of the application for which you want
|
||||||
|
to retrieve patches.
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
tuple[list[dict[str, str]], str]
|
a tuple containing two elements. The first element is a list of dictionaries representing
|
||||||
A tuple containing:
|
patches for the given app. The second element is a string representing the version of the
|
||||||
- A list of dictionaries representing patches for the given app.
|
patches.
|
||||||
- A string representing the latest version of the patches.
|
|
||||||
"""
|
"""
|
||||||
patches = self.patches_dict[app]
|
patches = self.patches_dict[app]
|
||||||
|
version = "latest"
|
||||||
with contextlib.suppress(StopIteration):
|
with contextlib.suppress(StopIteration):
|
||||||
return patches, next(i["version"] for i in patches if i["version"] != "all")
|
version = next(i["version"] for i in patches if i["version"] != "all")
|
||||||
|
return patches, version
|
||||||
return patches, "latest"
|
|
||||||
|
|
||||||
def get_app_configs(self: Self, app: "APP") -> list[dict[str, str]]:
|
def get_app_configs(self: Self, app: "APP") -> list[dict[str, str]]:
|
||||||
"""The function `get_app_configs` returns configurations for a given app.
|
"""The function `get_app_configs` returns configurations for a given app.
|
||||||
|
|||||||
Reference in New Issue
Block a user