Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fzls committed Jul 14, 2023
1 parent eae22ad commit 0fd4146
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
11 changes: 4 additions & 7 deletions _package.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# 构建发布压缩包
import os
import pathlib
import re
import shutil

from compress import compress_dir_with_bandizip
from const import db_top_dir
from log import color, logger
from util import human_readable_size, make_sure_dir_exists, show_head_line
from version import now_version
Expand All @@ -27,25 +24,25 @@ def package(dir_src, dir_all_release, release_dir_name, release_7z_name, dir_git
logger.info(color("bold_yellow") + f"将部分内容从 {dir_src} 复制到 {dir_current_release} ")
# 需要复制的文件与目录
files_to_copy = [
# 最外层文件
"config.toml",
"config.example.toml",
"DNF蚊子腿小助手.exe",
"DNF蚊子腿小助手配置工具.exe",
"DNF蚊子腿小助手配置文件.bat",
"DNF蚊子腿小助手交流群群二维码.png",

# 复制完后要移动或重命名到其他路径的文件
"CHANGELOG.MD",
"README.MD",

"utils/auto_updater.exe",
# 其他文件
"使用教程",
"付费指引",
"相关信息",

"utils/bandizip_portable",
"utils/icons",
"utils/reference_data",
"utils/auto_updater_changelog.MD",
"utils/auto_updater.exe",
"utils/hdiffz.exe",
"utils/hpatchz.exe",
"utils/不要下载增量更新文件_这个是给自动更新工具使用的.txt",
Expand Down
5 changes: 4 additions & 1 deletion _release.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def path_in_src(filepath_relative_to_src: str) -> str:
upload(local_filepath, old_version_name_prefix=history_file_prefix)
except Exception as e:
local_filename = os.path.basename(local_filepath)
logger.warning(color("bold_yellow") + f"第{try_index}/{total_try_count}次尝试上传 {local_filename} 失败,等待一会后重试", exc_info=e)
logger.warning(
color("bold_yellow") + f"第{try_index}/{total_try_count}次尝试上传 {local_filename} 失败,等待一会后重试",
exc_info=e,
)
if try_index < total_try_count:
count_down("上传到网盘", 5 * try_index)
continue
Expand Down
2 changes: 1 addition & 1 deletion djc_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9978,7 +9978,7 @@ def dnf_anniversary_ide_op(
**{
**bindData,
**extra_params,
}
},
)

# --------------------------------------------新春福袋大作战--------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion main_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import sys
import threading
import time
import webbrowser
from multiprocessing import cpu_count, freeze_support
from typing import Callable, Dict, List, Optional, Tuple

Expand Down
13 changes: 10 additions & 3 deletions qq_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ def check_and_download_chrome_ahead_windows(self):
logger.info("检查driver是否存在")
if not self.is_valid_chrome_file(self.chrome_driver_executable_path()):
logger.info(color("bold_yellow") + f"未在小助手utils目录里发现 {chrome_driver_exe_name} ,将尝试从网盘下载")
logger.info(color("bold_cyan") + f"如果速度实在太慢,可以去QQ群文件里面下载 {chrome_driver_exe_name},然后原样放到小助手的 utils 目录中,再重新启动即可")
logger.info(
color("bold_cyan") + f"如果速度实在太慢,可以去QQ群文件里面下载 {chrome_driver_exe_name},然后原样放到小助手的 utils 目录中,再重新启动即可"
)
self.download_chrome_driver(chrome_driver_exe_name)

options = Options()
Expand All @@ -418,7 +420,9 @@ def check_and_download_chrome_ahead_windows(self):

# 尝试从网盘下载合适版本的便携版chrome
if not self.is_valid_chrome_file(self.chrome_binary_7z()):
logger.info(color("bold_yellow") + f"未在小助手utils目录里发现 便携版chrome 的压缩包,尝试自动从网盘下载 {zip_name},需要下载大概80MB的压缩包,请耐心等候")
logger.info(
color("bold_yellow") + f"未在小助手utils目录里发现 便携版chrome 的压缩包,尝试自动从网盘下载 {zip_name},需要下载大概80MB的压缩包,请耐心等候"
)
logger.info(color("bold_cyan") + f"如果速度实在太慢,可以去QQ群文件里面下载 {zip_name},然后原样放到小助手的 utils 目录中,再重新启动即可")
self.download_chrome_file(zip_name)

Expand All @@ -444,7 +448,10 @@ def check_and_download_chrome_ahead_windows(self):

# 走到这里,大概率是多线程并行下载导致文件出错了,尝试重新下载
logger.info(color("bold_yellow") + "似乎chrome相关文件损坏了,尝试重新下载并解压")
logger.info(color("bold_cyan") + f"如果速度实在太慢,可以去QQ群文件里面下载 {zip_name}{chrome_driver_exe_name},然后原样放到小助手的 utils 目录中,再重新启动即可")
logger.info(
color("bold_cyan")
+ f"如果速度实在太慢,可以去QQ群文件里面下载 {zip_name}{chrome_driver_exe_name},然后原样放到小助手的 utils 目录中,再重新启动即可"
)
self.download_chrome_driver(chrome_driver_exe_name)
self.download_chrome_file(zip_name)

Expand Down

0 comments on commit 0fd4146

Please sign in to comment.