From 13da7b3f960b79fce5e83bc2a57de77d79c0b5e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sun, 16 Apr 2023 17:30:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#73:=20=E4=BC=B4=E5=A5=8F=E4=BA=BA?= =?UTF-8?q?=E5=A3=B0=E5=88=86=E7=A6=BB=E6=97=B6=E6=8A=A5=E9=94=99=EF=BC=9A?= =?UTF-8?q?FileNotFoundError=20(#74)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix #73: 伴奏人声分离时报错:FileNotFoundError * Apply Code Formatter Change --------- Co-authored-by: fumiama --- i18n/locale_diff.py | 8 +++++--- uvr5_pack/utils.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/i18n/locale_diff.py b/i18n/locale_diff.py index e9f8861..6419266 100644 --- a/i18n/locale_diff.py +++ b/i18n/locale_diff.py @@ -7,7 +7,9 @@ standard_file = "zh_CN.json" # Find all JSON files in the directory dir_path = "./" -languages = [f for f in os.listdir(dir_path) if f.endswith(".json") and f != standard_file] +languages = [ + f for f in os.listdir(dir_path) if f.endswith(".json") and f != standard_file +] # Load the standard file with open(standard_file, "r", encoding="utf-8") as f: @@ -35,8 +37,8 @@ for lang_file in languages: # Sort the keys of the language file to match the order of the standard file lang_data = OrderedDict( sorted(lang_data.items(), key=lambda x: list(standard_data.keys()).index(x[0])) - ) + ) # Save the updated language file with open(lang_file, "w", encoding="utf-8") as f: - json.dump(lang_data, f, ensure_ascii=False, indent=4) \ No newline at end of file + json.dump(lang_data, f, ensure_ascii=False, indent=4) diff --git a/uvr5_pack/utils.py b/uvr5_pack/utils.py index 30bc59e..1d91f96 100644 --- a/uvr5_pack/utils.py +++ b/uvr5_pack/utils.py @@ -4,7 +4,7 @@ from tqdm import tqdm import json -def load_data(file_name: str = "./uvr5_pack/data.json") -> dict: +def load_data(file_name: str = "./uvr5_pack/name_params.json") -> dict: with open(file_name, "r") as f: data = json.load(f)