👷 Updated Docs

This commit is contained in:
Nikhil Badyal
2022-10-13 21:13:29 +05:30
parent c096c0408f
commit f5148464ea
2 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ def main() -> None:
logger.info("Trying to build %s" % app) logger.info("Trying to build %s" % app)
app_all_patches, version, is_experimental = patcher.get_app_configs(app) app_all_patches, version, is_experimental = patcher.get_app_configs(app)
version = downloader.download_apk_to_patch(version, 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}") logger.info(f"Downloaded {app}, version {version}")
parser.patch_app(app=app, version=version, is_experimental=is_experimental) parser.patch_app(app=app, version=version, is_experimental=is_experimental)
except Exception as e: except Exception as e:
+9 -8
View File
@@ -127,14 +127,15 @@ class Patches(object):
logger.debug("No recommended version.") logger.debug("No recommended version.")
return patches, version return patches, version
def include_and_exclude_patches( # noinspection IncorrectFormatting
self, app: str, arg_parser: Any, app_patches: List[Dict[str, str]] def include_exclude_patch(
self, app: str, parser: Any, patches: List[Dict[str, str]]
) -> None: ) -> None:
"""Include and exclude patches for a given app. """Include and exclude patches for a given app.
:param app: Name of the app :param app: Name of the app
:param arg_parser: Parser Obj :param parser: Parser Obj
:param app_patches: All the patches of a given app :param patches: All the patches of a given app
""" """
logger.debug(f"Excluding patches for app {app}") logger.debug(f"Excluding patches for app {app}")
if self.config.build_extended and app in self.config.extended_apps: if self.config.build_extended and app in self.config.extended_apps:
@@ -143,11 +144,11 @@ class Patches(object):
) )
else: else:
excluded_patches = self.config.env.list(f"EXCLUDE_PATCH_{app}".upper(), []) excluded_patches = self.config.env.list(f"EXCLUDE_PATCH_{app}".upper(), [])
for patch in app_patches: for patch in patches:
arg_parser.include(patch["name"]) if patch[ parser.include(patch["name"]) if patch[
"name" "name"
] not in excluded_patches else arg_parser.exclude(patch["name"]) ] not in excluded_patches else parser.exclude(patch["name"])
excluded = arg_parser.get_excluded_patches() excluded = parser.get_excluded_patches()
if excluded: if excluded:
logger.debug(f"Excluded patches {excluded} for {app}") logger.debug(f"Excluded patches {excluded} for {app}")
else: else: