From cde1e966e7f9ac84fcbd4f5b87f795b400975255 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Sat, 27 Dec 2025 23:12:37 +0800 Subject: [PATCH] =?UTF-8?q?chore(gui.batchs):=20=E5=B0=86=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=84=9A=E6=9C=AC=E7=9A=84=E9=94=99=E8=AF=AF=E5=91=BD?= =?UTF-8?q?=E5=90=8D=20complie=5F*.bat/sh=20=E4=BF=AE=E6=94=B9=E4=B8=BA=20?= =?UTF-8?q?compile=5F*.bat/sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 4 +-- .../batchs/{complie_rc.bat => compile_rc.bat} | 26 +++++++++---------- .../batchs/{complie_rc.sh => compile_rc.sh} | 26 +++++++++---------- .../batchs/{complie_ui.bat => compile_ui.bat} | 12 ++++----- .../batchs/{complie_ui.sh => compile_ui.sh} | 12 ++++----- 5 files changed, 40 insertions(+), 40 deletions(-) rename src/gui/batchs/{complie_rc.bat => compile_rc.bat} (53%) rename src/gui/batchs/{complie_rc.sh => compile_rc.sh} (59%) rename src/gui/batchs/{complie_ui.bat => compile_ui.bat} (53%) rename src/gui/batchs/{complie_ui.sh => compile_ui.sh} (55%) diff --git a/readme.md b/readme.md index 30481e4..8a34269 100644 --- a/readme.md +++ b/readme.md @@ -58,8 +58,8 @@ 1. 确保系统安装了 Python 3.13 版本 (推荐,过低或高版本会导致兼容问题)。 2. 安装 pyside6 selenium ddddocr 库,命令为 `pip install pyside6 selenium ddddocr`。 -3. 在 `src/gui/batchs` 目录下运行 `complie_ui.bat` (linux 和 macOS 系统使用 `complie_ui.sh`) 文件来编译 Qt 的 UI 文件。 -4. 在上一步相同目录内运行 `complie_rc.bat` (linux 和 macOS 系统使用 `complie_rc.sh`) 文件来编译 Qt 的资源文件。 +3. 在 `src/gui/batchs` 目录下运行 `compile_ui.bat` (linux 和 macOS 系统使用 `compile_ui.sh`) 文件来编译 Qt 的 UI 文件。 +4. 在上一步相同目录内运行 `compile_rc.bat` (linux 和 macOS 系统使用 `compile_rc.sh`) 文件来编译 Qt 的资源文件。 5. 待上述步骤完成后,运行 `src/Main.py` 文件即可。 *注意 1*:如果 python 使用的是虚拟环境,请在虚拟环境安装依赖后,在激活的虚拟环境终端中使用 `cd src/gui/batchs` 命令切换到 `batchs` 目录下,再运行编译脚本。否则会提示缺少必要的 Qt PySide 依赖库。 diff --git a/src/gui/batchs/complie_rc.bat b/src/gui/batchs/compile_rc.bat similarity index 53% rename from src/gui/batchs/complie_rc.bat rename to src/gui/batchs/compile_rc.bat index 83c2389..6003b11 100644 --- a/src/gui/batchs/complie_rc.bat +++ b/src/gui/batchs/compile_rc.bat @@ -4,32 +4,32 @@ setlocal enabledelayedexpansion cd /d "%~dp0.." -echo [AutoLibrary complie] 检查翻译文件... +echo [AutoLibrary compile] 检查翻译文件... if exist translators ( cd translators set ts_count=0 for %%f in (*.ts) do set /a ts_count+=1 if !ts_count! gtr 0 ( - echo [AutoLibrary complie] 找到 !ts_count! 个 .ts 文件,开始编译翻译文件... + echo [AutoLibrary compile] 找到 !ts_count! 个 .ts 文件,开始编译翻译文件... for %%f in (*.ts) do ( set "qm_filename=%%~nf.qm" - echo [AutoLibrary complie] 正在编译翻译文件: "%%f" -> "!qm_filename!" + echo [AutoLibrary compile] 正在编译翻译文件: "%%f" -> "!qm_filename!" pyside6-lrelease "%%f" if !errorlevel! equ 0 ( - echo [AutoLibrary complie] 翻译文件 "%%f" ✓ 编译成功,输出文件: "!qm_filename!" + echo [AutoLibrary compile] 翻译文件 "%%f" ✓ 编译成功,输出文件: "!qm_filename!" ) else ( - echo [AutoLibrary complie] 翻译文件 "%%f" ✗ 编译失败 + echo [AutoLibrary compile] 翻译文件 "%%f" ✗ 编译失败 ) ) echo. ) else ( - echo [AutoLibrary complie] 未找到任何 .ts 翻译文件 + echo [AutoLibrary compile] 未找到任何 .ts 翻译文件 ) cd .. ) else ( - echo [AutoLibrary complie] 未找到 translators 目录 + echo [AutoLibrary compile] 未找到 translators 目录 ) echo. @@ -37,26 +37,26 @@ set count=0 for %%f in (*.qrc) do set /a count+=1 if %count% equ 0 ( - echo [AutoLibrary complie] 错误: 未找到任何 .qrc 文件 + echo [AutoLibrary compile] 错误: 未找到任何 .qrc 文件 pause exit /b 1 ) -echo [AutoLibrary complie] 找到 %count% 个 .qrc 文件,开始编译... +echo [AutoLibrary compile] 找到 %count% 个 .qrc 文件,开始编译... echo. for %%f in (*.qrc) do ( set "filename=%%~nf" set "output_file=!filename!.py" - echo [AutoLibrary complie] 正在编译: "%%f" -> "!output_file!" + echo [AutoLibrary compile] 正在编译: "%%f" -> "!output_file!" pyside6-rcc "%%f" -o "!output_file!" if !errorlevel! equ 0 ( - echo [AutoLibrary complie] 文件 "%%f" ✓ 编译成功,输出文件: "!output_file!" + echo [AutoLibrary compile] 文件 "%%f" ✓ 编译成功,输出文件: "!output_file!" ) else ( - echo [AutoLibrary complie] 文件 "%%f" ✗ 编译失败 + echo [AutoLibrary compile] 文件 "%%f" ✗ 编译失败 ) echo. ) -echo [AutoLibrary complie] 所有操作完成。 \ No newline at end of file +echo [AutoLibrary compile] 所有操作完成。 \ No newline at end of file diff --git a/src/gui/batchs/complie_rc.sh b/src/gui/batchs/compile_rc.sh similarity index 59% rename from src/gui/batchs/complie_rc.sh rename to src/gui/batchs/compile_rc.sh index 8497951..befcbc7 100644 --- a/src/gui/batchs/complie_rc.sh +++ b/src/gui/batchs/compile_rc.sh @@ -4,7 +4,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PARENT_DIR="$(dirname "$SCRIPT_DIR")" cd "$PARENT_DIR" -echo "[AutoLibrary complie] 检查翻译文件..." +echo "[AutoLibrary compile] 检查翻译文件..." if [ -d "translators" ]; then cd translators ts_files=(*.ts) @@ -16,49 +16,49 @@ if [ -d "translators" ]; then fi if [ $ts_count -gt 0 ]; then - echo "[AutoLibrary complie] 找到 $ts_count 个 .ts 文件,开始编译翻译文件..." + echo "[AutoLibrary compile] 找到 $ts_count 个 .ts 文件,开始编译翻译文件..." for file in *.ts; do base_name=$(basename "$file" .ts) qm_file="${base_name}.qm" - echo "[AutoLibrary complie] 正在编译翻译文件: \"$file\" -> \"$qm_file\"" + echo "[AutoLibrary compile] 正在编译翻译文件: \"$file\" -> \"$qm_file\"" if pyside6-lrelease "$file"; then - echo "[AutoLibrary complie] 翻译文件 \"$file\" ✓ 编译成功,输出文件: \"$qm_file\"" + echo "[AutoLibrary compile] 翻译文件 \"$file\" ✓ 编译成功,输出文件: \"$qm_file\"" else - echo "[AutoLibrary complie] 翻译文件 \"$file\" ✗ 编译失败" + echo "[AutoLibrary compile] 翻译文件 \"$file\" ✗ 编译失败" fi done echo else - echo "[AutoLibrary complie] 未找到任何 .ts 翻译文件" + echo "[AutoLibrary compile] 未找到任何 .ts 翻译文件" fi cd .. else - echo "[AutoLibrary complie] 未找到 translators 目录" + echo "[AutoLibrary compile] 未找到 translators 目录" fi echo file_count=$(ls *.qrc 2>/dev/null | wc -l) if [ $file_count -eq 0 ]; then - echo "[AutoLibrary complie] 错误: 未找到任何 .qrc 文件" + echo "[AutoLibrary compile] 错误: 未找到任何 .qrc 文件" exit 1 fi -echo "[AutoLibrary complie] 找到 $file_count 个 .qrc 文件,开始编译..." +echo "[AutoLibrary compile] 找到 $file_count 个 .qrc 文件,开始编译..." echo for file in *.qrc; do base_name=$(basename "$file" .qrc) output_file="${base_name}.py" - echo "[AutoLibrary complie] 正在编译: \"$file\" -> \"$output_file\"" + echo "[AutoLibrary compile] 正在编译: \"$file\" -> \"$output_file\"" if pyside6-rcc "$file" -o "$output_file"; then - echo "[AutoLibrary complie] 文件 \"$file\" ✓ 编译成功,输出文件: \"$output_file\"" + echo "[AutoLibrary compile] 文件 \"$file\" ✓ 编译成功,输出文件: \"$output_file\"" else - echo "[AutoLibrary complie] 文件 \"$file\" ✗ 编译失败" + echo "[AutoLibrary compile] 文件 \"$file\" ✗ 编译失败" fi echo done -echo "[AutoLibrary complie] 所有操作完成。" \ No newline at end of file +echo "[AutoLibrary compile] 所有操作完成。" \ No newline at end of file diff --git a/src/gui/batchs/complie_ui.bat b/src/gui/batchs/compile_ui.bat similarity index 53% rename from src/gui/batchs/complie_ui.bat rename to src/gui/batchs/compile_ui.bat index 0449ec5..3f02efd 100644 --- a/src/gui/batchs/complie_ui.bat +++ b/src/gui/batchs/compile_ui.bat @@ -8,26 +8,26 @@ set count=0 for %%f in (*.ui) do set /a count+=1 if %count% equ 0 ( - echo [AutoLibrary complie] 错误: 未找到任何 .ui 文件 + echo [AutoLibrary compile] 错误: 未找到任何 .ui 文件 pause exit /b 1 ) -echo [AutoLibrary complie] 找到 %count% 个 .ui 文件,开始编译... +echo [AutoLibrary compile] 找到 %count% 个 .ui 文件,开始编译... echo. for %%f in (*.ui) do ( set "filename=%%~nf" set "output_file=Ui_!filename!.py" - echo [AutoLibrary complie] 正在编译: "%%f" -> "!output_file!" + echo [AutoLibrary compile] 正在编译: "%%f" -> "!output_file!" pyside6-uic "%%f" -o "!output_file!" if !errorlevel! equ 0 ( - echo [AutoLibrary complie] 文件 "%%f" ✓ 编译成功,输出文件: "!output_file!" + echo [AutoLibrary compile] 文件 "%%f" ✓ 编译成功,输出文件: "!output_file!" ) else ( - echo [AutoLibrary complie] 文件 "%%f" ✗ 编译失败 + echo [AutoLibrary compile] 文件 "%%f" ✗ 编译失败 ) echo. ) -echo [AutoLibrary complie] 所有操作完成。 \ No newline at end of file +echo [AutoLibrary compile] 所有操作完成。 \ No newline at end of file diff --git a/src/gui/batchs/complie_ui.sh b/src/gui/batchs/compile_ui.sh similarity index 55% rename from src/gui/batchs/complie_ui.sh rename to src/gui/batchs/compile_ui.sh index 0c4b70f..0c8d38a 100644 --- a/src/gui/batchs/complie_ui.sh +++ b/src/gui/batchs/compile_ui.sh @@ -7,24 +7,24 @@ cd "$PARENT_DIR" file_count=$(ls *.ui 2>/dev/null | wc -l) if [ $file_count -eq 0 ]; then - echo "[AutoLibrary complie] 错误: 未找到任何 .ui 文件" + echo "[AutoLibrary compile] 错误: 未找到任何 .ui 文件" exit 1 fi -echo "[AutoLibrary complie] 找到 $file_count 个 .ui 文件,开始编译..." +echo "[AutoLibrary compile] 找到 $file_count 个 .ui 文件,开始编译..." echo for file in *.ui; do base_name=$(basename "$file" .ui) output_file="Ui_${base_name}.py" - echo "[AutoLibrary complie] 正在编译: \"$file\" -> \"$output_file\"" + echo "[AutoLibrary compile] 正在编译: \"$file\" -> \"$output_file\"" if pyside6-uic "$file" -o "$output_file"; then - echo "[AutoLibrary complie] 文件 \"$file\" ✓ 编译成功,输出文件: \"$output_file\"" + echo "[AutoLibrary compile] 文件 \"$file\" ✓ 编译成功,输出文件: \"$output_file\"" else - echo "[AutoLibrary complie] 文件 \"$file\" ✗ 编译失败" + echo "[AutoLibrary compile] 文件 \"$file\" ✗ 编译失败" fi echo done -echo "[AutoLibrary complie] 所有操作完成。" \ No newline at end of file +echo "[AutoLibrary compile] 所有操作完成。" \ No newline at end of file