📝 Added doc string

This commit is contained in:
Nikhil Badyal
2022-10-11 22:52:10 +05:30
parent 9384fc9856
commit 2f53645d13
6 changed files with 101 additions and 1 deletions
+21
View File
@@ -1,3 +1,4 @@
"""Revanced Parser."""
import sys
from subprocess import PIPE, Popen
from time import perf_counter
@@ -10,6 +11,8 @@ from src.patches import Patches
class Parser(object):
"""Revanced Parser."""
def __init__(self, patcher: Patches, config: RevancedConfig) -> None:
self._PATCHES: List[str] = []
self._EXCLUDED: List[str] = []
@@ -17,16 +20,34 @@ class Parser(object):
self.config = config
def include(self, name: str) -> None:
"""Include a given patch.
:param name: Name of the patch
"""
self._PATCHES.extend(["-i", name])
def exclude(self, name: str) -> None:
"""Exclude a given patch.
:param name: Name of the patch to exclude
"""
self._PATCHES.extend(["-e", name])
self._EXCLUDED.append(name)
def get_excluded_patches(self) -> List[str]:
"""
Getter to get all excluded patches
:return: List of excluded patches
"""
return self._EXCLUDED
def patch_app(self, app: str, version: str, is_experimental: bool = False) -> None:
"""Revanced APP Patcher.
:param app: Name of the app
:param version: Version of the application
:param is_experimental: Whether to enable experimental support
"""
logger.debug(f"Sending request to revanced cli for building {app} revanced")
cli = self.config.normal_cli_jar
patches = self.config.normal_patches_jar