mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
📝 Updated inclusion logic
This commit is contained in:
committed by
Nikhil Badyal
parent
c0b34db784
commit
639382ed38
+8
-10
@@ -107,7 +107,7 @@ class Parser(object):
|
||||
self: Self,
|
||||
app: APP,
|
||||
patches: list[dict[str, str]],
|
||||
patches_dict: dict[str, str],
|
||||
patches_dict: dict[str, list[dict[str, str]]],
|
||||
) -> None:
|
||||
"""The function `include_exclude_patch` includes and excludes patches for a given app."""
|
||||
if app.space_formatted:
|
||||
@@ -116,18 +116,16 @@ class Parser(object):
|
||||
self.include(patch["name"]) if normalized_patch not in app.exclude_request else self.exclude(
|
||||
patch["name"],
|
||||
)
|
||||
for normalized_patch in app.include_request:
|
||||
self.include(normalized_patch.lower().replace("-", " ")) if normalized_patch not in patches_dict[
|
||||
"universal_patch"
|
||||
] else ()
|
||||
for patch in patches_dict["universal_patch"]:
|
||||
normalized_patch = patch["name"].lower().replace(" ", "-")
|
||||
self.include(patch["name"]) if normalized_patch in app.include_request else ()
|
||||
else:
|
||||
for patch in patches:
|
||||
normalized_patch = patch["name"].lower().replace(" ", "-")
|
||||
self.include(normalized_patch) if normalized_patch not in app.exclude_request else self.exclude(
|
||||
normalized_patch,
|
||||
self.include(patch["name"]) if patch["name"] not in app.exclude_request else self.exclude(
|
||||
patch["name"],
|
||||
)
|
||||
for normalized_patch in app.include_request:
|
||||
self.include(normalized_patch) if normalized_patch not in patches_dict["universal_patch"] else ()
|
||||
for patch in patches_dict["universal_patch"]:
|
||||
self.include(patch["name"]) if patch["name"] in app.include_request else ()
|
||||
|
||||
@staticmethod
|
||||
def is_new_cli(cli_path: Path) -> tuple[bool, str]:
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ class Patches(object):
|
||||
app.no_of_patches = len(self.patches_dict[app.app_name])
|
||||
|
||||
def __init__(self: Self, config: RevancedConfig, app: APP) -> None:
|
||||
self.patches_dict: dict[str, Any] = {"universal_patch": []}
|
||||
self.patches_dict: dict[str, list[dict[str, str]]] = {"universal_patch": []}
|
||||
self.fetch_patches(config, app)
|
||||
|
||||
def get(self: Self, app: str) -> tuple[list[dict[str, str]], str]:
|
||||
|
||||
Reference in New Issue
Block a user