From d2417fb906797ee9b753773c7988cbf8b2b6256d Mon Sep 17 00:00:00 2001 From: brian <90851827+wobeitaoleshigexuruo@users.noreply.github.com> Date: Sat, 18 Mar 2023 13:51:51 +0800 Subject: [PATCH] :bug: Fix calendar model parse (#7) Co-authored-by: brian --- cqwu/methods/webvpn/get_calendar.py | 5 ++++- setup.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cqwu/methods/webvpn/get_calendar.py b/cqwu/methods/webvpn/get_calendar.py index b5901e3..44cbd2b 100644 --- a/cqwu/methods/webvpn/get_calendar.py +++ b/cqwu/methods/webvpn/get_calendar.py @@ -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 diff --git a/setup.py b/setup.py index ad84acd..4f3e864 100644 --- a/setup.py +++ b/setup.py @@ -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.", # 包的简述