Skip to content

Commit

Permalink
chore: 删除updater中不再使用的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Jan 15, 2024
1 parent 77bc6fb commit 2c5933d
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions pkg/utils/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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列表
Expand Down

0 comments on commit 2c5933d

Please sign in to comment.