From 2c5933da0b1ca728b5e9a6b19ad5578ed285eb00 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Mon, 15 Jan 2024 22:35:14 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4updater=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=BD=BF=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/utils/updater.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/pkg/utils/updater.py b/pkg/utils/updater.py index 3881298c..ec6e93a8 100644 --- a/pkg/utils/updater.py +++ b/pkg/utils/updater.py @@ -25,18 +25,6 @@ def check_dulwich_closure(): raise Exception("dulwich模块未安装,请查看 https://github.com/RockChinQ/QChatGPT/issues/77") -def pull_latest(repo_path: str) -> bool: - """拉取最新代码""" - check_dulwich_closure() - - from dulwich import porcelain - - repo = porcelain.open_repo(repo_path) - porcelain.pull(repo) - - return True - - def is_newer(new_tag: str, old_tag: str): """判断版本是否更新,忽略第四位版本和第一位版本""" if new_tag == old_tag: @@ -254,35 +242,6 @@ def get_current_version_info() -> str: return "未知版本" -def get_commit_id_and_time_and_msg() -> str: - """获取当前提交id和时间和提交信息""" - check_dulwich_closure() - - from dulwich import porcelain - - repo = porcelain.open_repo('.') - - for entry in repo.get_walker(): - tz = datetime.timezone(datetime.timedelta(hours=entry.commit.commit_timezone // 3600)) - dt = datetime.datetime.fromtimestamp(entry.commit.commit_time, tz) - return str(entry.commit.id)[2:9] + " " + dt.strftime('%Y-%m-%d %H:%M:%S') + " [" + str(entry.commit.message, encoding="utf-8").strip()+"]" - - -def get_current_commit_id() -> str: - """检查是否有新版本""" - check_dulwich_closure() - - from dulwich import porcelain - - repo = porcelain.open_repo('.') - current_commit_id = "" - for entry in repo.get_walker(): - current_commit_id = str(entry.commit.id)[2:-1] - break - - return current_commit_id - - def is_new_version_available() -> bool: """检查是否有新版本""" # 从github获取release列表