From 45a9953eb277a89e3e5863c52edb79e8950f5e05 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Tue, 20 Jun 2023 18:55:03 +0700 Subject: [PATCH] fix: make constants constants ALL CAPS --- vollerei/constants.py | 4 ++-- vollerei/hsr/constants.py | 8 ++++---- vollerei/hsr/patcher.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vollerei/constants.py b/vollerei/constants.py index b711d29..43a5de1 100644 --- a/vollerei/constants.py +++ b/vollerei/constants.py @@ -1,5 +1,4 @@ -# Common -telemetry_hosts = [ +TELEMETRY_HOSTS = [ # Global "log-upload-os.hoyoverse.com", "sg-public-data-api.hoyoverse.com", @@ -8,3 +7,4 @@ telemetry_hosts = [ "log-upload.mihoyo.com", "public-data-api.mihoyo.com", ] +HDIFFPATCH_GIT_URL = "https://github.com/sisong/HDiffPatch" diff --git a/vollerei/hsr/constants.py b/vollerei/hsr/constants.py index 49a3713..317752e 100644 --- a/vollerei/hsr/constants.py +++ b/vollerei/hsr/constants.py @@ -1,5 +1,5 @@ -latest_version = (1, 1, 0) -md5sums = { +LATEST_VERSION = (1, 1, 0) +MD5SUMS = { "1.0.5": { "cn": { "StarRailBase.dll": "66c42871ce82456967d004ccb2d7cf77", @@ -12,5 +12,5 @@ md5sums = { } } # Patches -astra_repo = "https://notabug.org/mkrsym1/astra" -jadeite_repo = "https://codeberg.org/mkrsym1/jadeite/" +ASTRA_REPO = "https://notabug.org/mkrsym1/astra" +JADEITE_REPO = "https://codeberg.org/mkrsym1/jadeite/" diff --git a/vollerei/hsr/patcher.py b/vollerei/hsr/patcher.py index ae4a2d7..7b0f647 100644 --- a/vollerei/hsr/patcher.py +++ b/vollerei/hsr/patcher.py @@ -11,7 +11,7 @@ from vollerei.exceptions.patcher import ( from vollerei.hsr.launcher.game import Game, GameChannel from vollerei.utils import download_and_extract, Git, Xdelta3 from vollerei.paths import tools_data_path -from vollerei.hsr.constants import astra_repo, jadeite_repo +from vollerei.hsr.constants import ASTRA_REPO, JADEITE_REPO class PatchType(Enum): @@ -49,10 +49,10 @@ class Patcher(PatcherABC): self._patch_type = value def _update_astra(self): - self._git.pull_or_clone(astra_repo, self._astra) + self._git.pull_or_clone(ASTRA_REPO, self._astra) def _update_jadeite(self): - release_info = self._git.get_latest_release(jadeite_repo) + release_info = self._git.get_latest_release(JADEITE_REPO) file = self._git.get_latest_release_dl(release_info)[0] file_version = release_info["tag_name"][1:] # Remove "v" prefix current_version = None