mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
♻️ Refactored strings
This commit is contained in:
committed by
Nikhil Badyal
parent
507390bd88
commit
6dd960b147
+9
-7
@@ -5,12 +5,14 @@ from typing import Self
|
|||||||
|
|
||||||
from environs import Env
|
from environs import Env
|
||||||
|
|
||||||
from src.utils import default_build
|
from src.utils import (
|
||||||
|
default_build,
|
||||||
default_cli = "https://github.com/revanced/revanced-cli/releases/latest"
|
default_cli,
|
||||||
default_patches = "https://github.com/revanced/revanced-patches/releases/latest"
|
default_integrations,
|
||||||
default_patches_json = default_patches
|
default_patches,
|
||||||
default_integrations = "https://github.com/revanced/revanced-integrations/releases/latest"
|
default_patches_json,
|
||||||
|
resource_folder,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class RevancedConfig(object):
|
class RevancedConfig(object):
|
||||||
@@ -18,7 +20,7 @@ class RevancedConfig(object):
|
|||||||
|
|
||||||
def __init__(self: Self, env: Env) -> None:
|
def __init__(self: Self, env: Env) -> None:
|
||||||
self.env = env
|
self.env = env
|
||||||
self.temp_folder_name = "apks"
|
self.temp_folder_name = resource_folder
|
||||||
self.temp_folder = Path(self.temp_folder_name)
|
self.temp_folder = Path(self.temp_folder_name)
|
||||||
self.ci_test = env.bool("CI_TEST", False)
|
self.ci_test = env.bool("CI_TEST", False)
|
||||||
self.rip_libs_apps: list[str] = []
|
self.rip_libs_apps: list[str] = []
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ from tqdm import tqdm
|
|||||||
|
|
||||||
from src.app import APP
|
from src.app import APP
|
||||||
from src.config import RevancedConfig
|
from src.config import RevancedConfig
|
||||||
from src.downloader.utils import implement_method
|
|
||||||
from src.exceptions import DownloadError
|
from src.exceptions import DownloadError
|
||||||
from src.utils import handle_request_response, session
|
from src.utils import handle_request_response, implement_method, session
|
||||||
|
|
||||||
|
|
||||||
class Downloader(object):
|
class Downloader(object):
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
"""Utility class."""
|
|
||||||
|
|
||||||
implement_method = "Please implement the method"
|
|
||||||
status_code_200 = 200
|
|
||||||
+7
-1
@@ -20,7 +20,6 @@ if TYPE_CHECKING:
|
|||||||
from src.app import APP
|
from src.app import APP
|
||||||
|
|
||||||
from src.downloader.sources import APK_MIRROR_APK_CHECK
|
from src.downloader.sources import APK_MIRROR_APK_CHECK
|
||||||
from src.downloader.utils import status_code_200
|
|
||||||
from src.exceptions import ScrapingError
|
from src.exceptions import ScrapingError
|
||||||
|
|
||||||
default_build = [
|
default_build = [
|
||||||
@@ -35,6 +34,10 @@ request_header = {
|
|||||||
"Authorization": "Basic YXBpLWFwa3VwZGF0ZXI6cm01cmNmcnVVakt5MDRzTXB5TVBKWFc4",
|
"Authorization": "Basic YXBpLWFwa3VwZGF0ZXI6cm01cmNmcnVVakt5MDRzTXB5TVBKWFc4",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
|
default_cli = "https://github.com/revanced/revanced-cli/releases/latest"
|
||||||
|
default_patches = "https://github.com/revanced/revanced-patches/releases/latest"
|
||||||
|
default_patches_json = default_patches
|
||||||
|
default_integrations = "https://github.com/revanced/revanced-integrations/releases/latest"
|
||||||
bs4_parser = "html.parser"
|
bs4_parser = "html.parser"
|
||||||
changelog_file = "changelog.md"
|
changelog_file = "changelog.md"
|
||||||
changelog_json_file = "changelog.json"
|
changelog_json_file = "changelog.json"
|
||||||
@@ -49,6 +52,9 @@ integration_version_key = "integrations_version"
|
|||||||
patches_version_key = "patches_version"
|
patches_version_key = "patches_version"
|
||||||
cli_version_key = "cli_version"
|
cli_version_key = "cli_version"
|
||||||
patches_json_version_key = "patches_json_version"
|
patches_json_version_key = "patches_json_version"
|
||||||
|
implement_method = "Please implement the method"
|
||||||
|
status_code_200 = 200
|
||||||
|
resource_folder = "apks"
|
||||||
|
|
||||||
|
|
||||||
def update_changelog(name: str, response: dict[str, str]) -> None:
|
def update_changelog(name: str, response: dict[str, str]) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user