From f5148464eac0ec2390469c77e92717ba4c6abdce Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Thu, 13 Oct 2022 21:13:29 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Updated=20Docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 2 +- src/patches.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 241534a..929c752 100644 --- a/main.py +++ b/main.py @@ -25,7 +25,7 @@ def main() -> None: logger.info("Trying to build %s" % app) app_all_patches, version, is_experimental = patcher.get_app_configs(app) version = downloader.download_apk_to_patch(version, app) - patcher.include_and_exclude_patches(app, parser, app_all_patches) + patcher.include_exclude_patch(app, parser, app_all_patches) logger.info(f"Downloaded {app}, version {version}") parser.patch_app(app=app, version=version, is_experimental=is_experimental) except Exception as e: diff --git a/src/patches.py b/src/patches.py index 1591fd5..d6eeb8a 100644 --- a/src/patches.py +++ b/src/patches.py @@ -127,14 +127,15 @@ class Patches(object): logger.debug("No recommended version.") return patches, version - def include_and_exclude_patches( - self, app: str, arg_parser: Any, app_patches: List[Dict[str, str]] + # noinspection IncorrectFormatting + def include_exclude_patch( + self, app: str, parser: Any, patches: List[Dict[str, str]] ) -> None: """Include and exclude patches for a given app. :param app: Name of the app - :param arg_parser: Parser Obj - :param app_patches: All the patches of a given app + :param parser: Parser Obj + :param patches: All the patches of a given app """ logger.debug(f"Excluding patches for app {app}") if self.config.build_extended and app in self.config.extended_apps: @@ -143,11 +144,11 @@ class Patches(object): ) else: excluded_patches = self.config.env.list(f"EXCLUDE_PATCH_{app}".upper(), []) - for patch in app_patches: - arg_parser.include(patch["name"]) if patch[ + for patch in patches: + parser.include(patch["name"]) if patch[ "name" - ] not in excluded_patches else arg_parser.exclude(patch["name"]) - excluded = arg_parser.get_excluded_patches() + ] not in excluded_patches else parser.exclude(patch["name"]) + excluded = parser.get_excluded_patches() if excluded: logger.debug(f"Excluded patches {excluded} for {app}") else: