🐛 Fix calendar model parse (#7)

Co-authored-by: brian <brian@xtaolabs.com>
This commit is contained in:
brian 2023-03-18 13:51:51 +08:00 committed by GitHub
parent f64e072552
commit d2417fb906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -109,8 +109,11 @@ def parse_weeks_and_sections(text: str) -> Tuple[List[int], int, int]:
if section_range.startswith("傍晚"):
start_num = 9
sections = 1
else:
elif "-" in section_range:
start_num = int(section_range.split("-")[0])
end = int(section_range.split("-")[1])
sections = end - start_num + 1
else:
start_num = int(section_range)
sections = 1
return weeks_list, start_num, sections

View File

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup(
name="cqwu", # 用自己的名替换其中的YOUR_USERNAME_
version="0.0.7", # 包版本号,便于维护版本
version="0.0.8", # 包版本号,便于维护版本
author="omg-xtao", # 作者,可以写自己的姓名
author_email="xtao@xtaolink.cn", # 作者联系方式,可写自己的邮箱地址
description="A cqwu ehall client.", # 包的简述