From ed67cd8b873c606ad562dece581f34fcf710f52d Mon Sep 17 00:00:00 2001 From: muzing Date: Thu, 4 Jan 2024 21:59:23 +0800 Subject: [PATCH] Update README --- README.md | 2 +- dev_scripts/build.py | 35 ++--------------------------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 58b15f9..e6b78a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Py2exe-GUI Logo](https://raw.githubusercontent.com/muziing/Py2exe-GUI/main/https://raw.githubusercontent.com/muziing/Py2exe-GUI/main/docs/source/images/py2exe-gui_logo_big.png) +![Py2exe-GUI Logo](https://raw.githubusercontent.com/muziing/Py2exe-GUI/main/docs/source/images/py2exe-gui_logo_big.png)

Easy-to-use Python GUI packaging tool

diff --git a/dev_scripts/build.py b/dev_scripts/build.py index 65831f1..2d0e46d 100644 --- a/dev_scripts/build.py +++ b/dev_scripts/build.py @@ -2,7 +2,6 @@ """ import subprocess -from pathlib import Path from dev_scripts.check_funcs import ( check_license_statement, @@ -11,34 +10,7 @@ from dev_scripts.check_funcs import ( check_version_num, ) from dev_scripts.clear_cache import clear_pycache, clear_pyinstaller_dist -from dev_scripts.path_constants import PROJECT_ROOT, README_FILE_LIST, SRC_PATH - - -def process_md_images(md_file_list: list[Path]) -> None: - """处理 Markdown 文档中的图片链接 - - 在构建前替换为 GitHub 图床链接,在构建后替换回本地目录中的路径 - - :param md_file_list: Markdown 文件列表 - """ - - md_uri = "docs/source/images/" - github_uri = ( - "https://github.com/muziing/Py2exe-GUI/raw/main" + "/docs/source/images/" - ) - - for md_file in md_file_list: - with open(md_file, "r+", encoding="UTF-8") as f: - all_text = f.read() - if github_uri not in all_text: - print(f"将 {md_file} 中的本地图片路径替换为GitHub在线路径") - all_text_new = all_text.replace(md_uri, github_uri) - else: - print(f"将 {md_file} 中的GitHub在线路径替换为本地图片路径") - all_text_new = all_text.replace(github_uri, md_uri) - f.seek(0) - f.write(all_text_new) - # FIXME 会在文件尾部多出来莫名其妙的行 +from dev_scripts.path_constants import PROJECT_ROOT, SRC_PATH def export_requirements() -> int: @@ -73,7 +45,6 @@ def build_py2exe_gui() -> None: # 准备工作 clear_pyinstaller_dist(SRC_PATH) clear_pycache(SRC_PATH) - process_md_images(README_FILE_LIST) # compile_resources() export_requirements() print(f"pre-commit 检查完毕,返回码:{check_pre_commit()}。") @@ -89,13 +60,11 @@ def build_py2exe_gui() -> None: print(f"Poetry build 完毕,返回码:{result.returncode}。") finally: # 清理 - process_md_images(README_FILE_LIST) + pass else: print("有未通过的检查项,不进行构建") if __name__ == "__main__": - # process_md_images() - # compile_resources() # export_requirements() build_py2exe_gui()