nonebot-plugin-cnrail 0.2.2.dev1__tar.gz → 0.2.2.post1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-cnrail
3
- Version: 0.2.2.dev1
3
+ Version: 0.2.2.post1
4
4
  Summary: NoneBot2 plugin for query the train time table
5
5
  Home-page: https://github.com/lgc-NB2Dev/nonebot-plugin-cnrail
6
6
  Author-Email: student_2333 <lgc2333@126.com>, XieXiLin <support@xiexilin.com>
@@ -131,7 +131,11 @@ plugins = [
131
131
 
132
132
  ### 效果图
133
133
 
134
- ![效果图](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/cnrail/g3720.png)
134
+ <details>
135
+
136
+ ![效果图](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/cnrail/t301.png)
137
+
138
+ </details>
135
139
 
136
140
  ## 📞 联系
137
141
 
@@ -142,27 +146,25 @@ Telegram:[@lgc2333](https://t.me/lgc2333)
142
146
 
143
147
  ## 💡 鸣谢
144
148
 
145
- ### [海兰德小助手](https://qun.qq.com/qunpro/robot/qunshare?robot_uin=3889001607) & [Train-QQbot 插件](https://github.com/staytomorrow/FindTrain)
149
+ ### [海兰德小助手](https://qun.qq.com/qunpro/robot/qunshare?robot_uin=3889001607) & [Train-QQBot 插件](https://github.com/staytomorrow/FindTrain)
146
150
 
147
151
  灵感来源
148
152
 
149
- ### [12306](https://www.12306.cn)
153
+ ### [MoeFactory 提供的查询 API](https://train.moefactory.com/)
150
154
 
151
155
  数据来源
152
156
 
153
157
  ## 💰 赞助
154
158
 
155
- 感谢大家的赞助!你们的赞助将是我继续创作的动力!
159
+ **[赞助我](https://blog.lgc2333.top/donate)**
156
160
 
157
- - [爱发电](https://afdian.net/@lgc2333)
158
- - <details>
159
- <summary>赞助二维码(点击展开)</summary>
161
+ 感谢大家的赞助!你们的赞助将是我继续创作的动力!
160
162
 
161
- ![讨饭](https://raw.githubusercontent.com/lgc2333/ShigureBotMenu/master/src/imgs/sponsor.png)
163
+ ## 📝 更新日志
162
164
 
163
- </details>
165
+ ### 0.2.2
164
166
 
165
- ## 📝 更新日志
167
+ - 修复列车行驶进度条计算问题(fix by [@This-is-XiaoDeng](https://github.com/This-is-XiaoDeng))
166
168
 
167
169
  ### 0.2.1
168
170
 
@@ -114,7 +114,11 @@ plugins = [
114
114
 
115
115
  ### 效果图
116
116
 
117
- ![效果图](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/cnrail/g3720.png)
117
+ <details>
118
+
119
+ ![效果图](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/cnrail/t301.png)
120
+
121
+ </details>
118
122
 
119
123
  ## 📞 联系
120
124
 
@@ -125,27 +129,25 @@ Telegram:[@lgc2333](https://t.me/lgc2333)
125
129
 
126
130
  ## 💡 鸣谢
127
131
 
128
- ### [海兰德小助手](https://qun.qq.com/qunpro/robot/qunshare?robot_uin=3889001607) & [Train-QQbot 插件](https://github.com/staytomorrow/FindTrain)
132
+ ### [海兰德小助手](https://qun.qq.com/qunpro/robot/qunshare?robot_uin=3889001607) & [Train-QQBot 插件](https://github.com/staytomorrow/FindTrain)
129
133
 
130
134
  灵感来源
131
135
 
132
- ### [12306](https://www.12306.cn)
136
+ ### [MoeFactory 提供的查询 API](https://train.moefactory.com/)
133
137
 
134
138
  数据来源
135
139
 
136
140
  ## 💰 赞助
137
141
 
138
- 感谢大家的赞助!你们的赞助将是我继续创作的动力!
142
+ **[赞助我](https://blog.lgc2333.top/donate)**
139
143
 
140
- - [爱发电](https://afdian.net/@lgc2333)
141
- - <details>
142
- <summary>赞助二维码(点击展开)</summary>
144
+ 感谢大家的赞助!你们的赞助将是我继续创作的动力!
143
145
 
144
- ![讨饭](https://raw.githubusercontent.com/lgc2333/ShigureBotMenu/master/src/imgs/sponsor.png)
146
+ ## 📝 更新日志
145
147
 
146
- </details>
148
+ ### 0.2.2
147
149
 
148
- ## 📝 更新日志
150
+ - 修复列车行驶进度条计算问题(fix by [@This-is-XiaoDeng](https://github.com/This-is-XiaoDeng))
149
151
 
150
152
  ### 0.2.1
151
153
 
@@ -6,7 +6,7 @@ require("nonebot_plugin_htmlrender")
6
6
  from . import __main__ as __main__ # noqa: E402
7
7
  from .config import ConfigModel # noqa: E402
8
8
 
9
- __version__ = "0.2.2.dev1"
9
+ __version__ = "0.2.2.post1"
10
10
  __plugin_meta__ = PluginMetadata(
11
11
  name="CNRail",
12
12
  description="查询 12306 列车时刻表",
@@ -1,6 +1,6 @@
1
1
  import string
2
2
  from contextlib import suppress
3
- from datetime import date, datetime
3
+ from datetime import date, datetime, timedelta
4
4
  from typing import Optional
5
5
 
6
6
  from arclet.alconna import Alconna, Args, Arparma, CommandMeta
@@ -31,9 +31,17 @@ def parse_date(date_str: str) -> date:
31
31
  .replace(year=today_date.year)
32
32
  .date() # noqa: DTZ007
33
33
  )
34
- if parsed < today_date:
35
- parsed = parsed.replace(year=today_date.year + 1)
36
- return parsed
34
+ for parsed_date in [
35
+ parsed,
36
+ parsed.replace(year=today_date.year - 1),
37
+ parsed.replace(year=today_date.year + 1),
38
+ ]:
39
+ if (
40
+ (today_date - timedelta(days=2))
41
+ <= parsed_date
42
+ <= (today_date + timedelta(days=14))
43
+ ):
44
+ return parsed_date
37
45
  return None
38
46
 
39
47
  date_formats = ("%m/%d", "%m-%d", "%m月%d日", "%m月%d号", "%m月%d")
@@ -333,8 +333,8 @@
333
333
  <tr>
334
334
  <th></th>
335
335
  <th>停靠站</th>
336
- <th>开点</th>
337
336
  <th>到点</th>
337
+ <th>开点</th>
338
338
  <th>停留</th>
339
339
  <th>车次</th>
340
340
  </tr>
@@ -16,7 +16,7 @@ dependencies = [
16
16
  ]
17
17
  requires-python = ">=3.9,<4.0"
18
18
  readme = "README.md"
19
- version = "0.2.2.dev1"
19
+ version = "0.2.2.post1"
20
20
 
21
21
  [project.license]
22
22
  text = "MIT"