mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
📝 Insert enable patch in front
This commit is contained in:
+3
-7
@@ -31,14 +31,15 @@ class Parser(object):
|
|||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
def include(self: Self, name: str) -> None:
|
def include(self: Self, name: str) -> None:
|
||||||
"""The function `include` adds a given patch to a list of patches.
|
"""
|
||||||
|
The function `include` adds a given patch to the front of a list of patches.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
name : str
|
name : str
|
||||||
The `name` parameter is a string that represents the name of the patch to be included.
|
The `name` parameter is a string that represents the name of the patch to be included.
|
||||||
"""
|
"""
|
||||||
self._PATCHES.extend(["-e", name])
|
self._PATCHES[:0] = ["-e", name]
|
||||||
|
|
||||||
def exclude(self: Self, name: str) -> None:
|
def exclude(self: Self, name: str) -> None:
|
||||||
"""The `exclude` function adds a given patch to the list of excluded patches.
|
"""The `exclude` function adds a given patch to the list of excluded patches.
|
||||||
@@ -135,11 +136,6 @@ class Parser(object):
|
|||||||
for patch in patches_dict["universal_patch"]:
|
for patch in patches_dict["universal_patch"]:
|
||||||
self.include(patch["name"]) if patch["name"] in app.include_request else ()
|
self.include(patch["name"]) if patch["name"] in app.include_request else ()
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def is_new_cli() -> bool:
|
|
||||||
"""Check if new cli is being used."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
# noinspection IncorrectFormatting
|
# noinspection IncorrectFormatting
|
||||||
def patch_app(
|
def patch_app(
|
||||||
self: Self,
|
self: Self,
|
||||||
|
|||||||
+2
-2
@@ -124,12 +124,12 @@ class Patches(object):
|
|||||||
The `app` parameter is of type `APP`. It represents an instance of the `APP` class.
|
The `app` parameter is of type `APP`. It represents an instance of the `APP` class.
|
||||||
"""
|
"""
|
||||||
self.patches_dict[app.app_name] = []
|
self.patches_dict[app.app_name] = []
|
||||||
app.patches = convert_command_output_to_json(
|
patches = convert_command_output_to_json(
|
||||||
f"{config.temp_folder}/{app.resource["cli"]["file_name"]}",
|
f"{config.temp_folder}/{app.resource["cli"]["file_name"]}",
|
||||||
f"{config.temp_folder}/{app.resource["patches"]["file_name"]}",
|
f"{config.temp_folder}/{app.resource["patches"]["file_name"]}",
|
||||||
)
|
)
|
||||||
|
|
||||||
for patch in app.patches:
|
for patch in patches:
|
||||||
if not patch["compatiblePackages"]:
|
if not patch["compatiblePackages"]:
|
||||||
p = {x: patch[x] for x in ["name", "description"]}
|
p = {x: patch[x] for x in ["name", "description"]}
|
||||||
p["app"] = "universal"
|
p["app"] = "universal"
|
||||||
|
|||||||
Reference in New Issue
Block a user