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.
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/PKG-INFO +13 -11
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/README.md +12 -10
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/nonebot_plugin_cnrail/__init__.py +1 -1
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/nonebot_plugin_cnrail/__main__.py +12 -4
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/nonebot_plugin_cnrail/templates/train_table.html.jinja +1 -1
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/pyproject.toml +1 -1
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/LICENSE +0 -0
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/nonebot_plugin_cnrail/config.py +0 -0
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/nonebot_plugin_cnrail/data_source.py +0 -0
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.2.post1}/nonebot_plugin_cnrail/models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nonebot-plugin-cnrail
|
|
3
|
-
Version: 0.2.2.
|
|
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
|
-
|
|
134
|
+
<details>
|
|
135
|
+
|
|
136
|
+

|
|
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-
|
|
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
|
-
### [
|
|
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
|
-
|
|
158
|
-
- <details>
|
|
159
|
-
<summary>赞助二维码(点击展开)</summary>
|
|
161
|
+
感谢大家的赞助!你们的赞助将是我继续创作的动力!
|
|
160
162
|
|
|
161
|
-
|
|
163
|
+
## 📝 更新日志
|
|
162
164
|
|
|
163
|
-
|
|
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
|
-
|
|
117
|
+
<details>
|
|
118
|
+
|
|
119
|
+

|
|
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-
|
|
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
|
-
### [
|
|
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
|
-
|
|
141
|
-
- <details>
|
|
142
|
-
<summary>赞助二维码(点击展开)</summary>
|
|
144
|
+
感谢大家的赞助!你们的赞助将是我继续创作的动力!
|
|
143
145
|
|
|
144
|
-
|
|
146
|
+
## 📝 更新日志
|
|
145
147
|
|
|
146
|
-
|
|
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.
|
|
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
|
-
|
|
35
|
-
parsed
|
|
36
|
-
|
|
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")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|