Skip to content

Commit 016eae2

Browse files
committed
chore: 升级版本号并优化日志记录
- 将项目版本从1.1.27更新至1.1.28 - 在generate.py中引入funutil.getLogger进行日志管理 - 使用logger.info替换原有的print语句输出进度信息 - 添加文件上传成功后的日志记录,显示数据量和文件路径 - 增加空数据处理的continue逻辑,避免不必要的文件上传操作 这些改进提升了代码的可维护性和运行时日志的可读性,同时保持了原有功能不变。
1 parent 3b2ee79 commit 016eae2

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "funread"
3-
version = "1.1.27"
3+
version = "1.1.28"
44
description = "一个用于管理和处理阅读源(Legado 阅读 APP 的书源和 RSS 源)的 Python 工具库"
55
readme = "README.md"
66
requires-python = ">=3.8"

src/funread/legado/manage/download/generate.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
from funfile import funos
66
from funsecret import read_secret
77
from funtask import Task
8+
from funutil import getLogger
9+
810
from funread.legado.manage.download.rss import RSSSourceDownload
911

12+
logger = getLogger("funread")
1013
"""
1114
dominate example: https://blog.csdn.net/wumingxiaoyao/article/details/122894671
1215
"""
@@ -171,17 +174,18 @@ def split_and_upload(self):
171174
i = 1000
172175
for data in runner.export_sources(size=3000):
173176
if len(data) > 0:
174-
self.drive.upload_file(
175-
content=data, git_path=f"{self.dir_path}/progress-{i}.json"
176-
)
177+
git_path = f"{self.dir_path}/progress-{i}.json"
178+
self.drive.upload_file(content=data, git_path=git_path)
177179
i += 1
180+
logger.success(f"dump {len(data)} into {git_path}")
181+
else:
182+
continue
178183

179184
def update_rss(self):
180-
print("update source rss")
185+
logger.info("update source rss")
181186
self.drive.upload_file(
182187
git_path=f"{self.dir_path}/index.html", content=self.generate_html_report()
183188
)
184-
print(len(self.generate_html_report()))
185189

186190

187191
class GenerateSourceTask(Task):

0 commit comments

Comments
 (0)