nonebot-plugin-cnrail 0.2.2.dev1__tar.gz → 0.2.3__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.3}/PKG-INFO +16 -10
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/README.md +15 -9
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/__init__.py +1 -1
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/__main__.py +12 -4
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/data_source.py +1 -1
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/templates/train_table.html.jinja +3 -4
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/pyproject.toml +1 -1
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/LICENSE +0 -0
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/config.py +0 -0
- {nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/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.
|
|
3
|
+
Version: 0.2.3
|
|
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,29 @@ 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
|
|
|
159
|
+
**[赞助我](https://blog.lgc2333.top/donate)**
|
|
160
|
+
|
|
155
161
|
感谢大家的赞助!你们的赞助将是我继续创作的动力!
|
|
156
162
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
## 📝 更新日志
|
|
164
|
+
|
|
165
|
+
### 0.2.3
|
|
160
166
|
|
|
161
|
-
|
|
167
|
+
- 更换上游 API 域名
|
|
162
168
|
|
|
163
|
-
|
|
169
|
+
### 0.2.2
|
|
164
170
|
|
|
165
|
-
|
|
171
|
+
- 修复列车行驶进度条计算问题(fix by [@This-is-XiaoDeng](https://github.com/This-is-XiaoDeng))
|
|
166
172
|
|
|
167
173
|
### 0.2.1
|
|
168
174
|
|
|
@@ -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,29 @@ 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
|
|
|
142
|
+
**[赞助我](https://blog.lgc2333.top/donate)**
|
|
143
|
+
|
|
138
144
|
感谢大家的赞助!你们的赞助将是我继续创作的动力!
|
|
139
145
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
## 📝 更新日志
|
|
147
|
+
|
|
148
|
+
### 0.2.3
|
|
143
149
|
|
|
144
|
-
|
|
150
|
+
- 更换上游 API 域名
|
|
145
151
|
|
|
146
|
-
|
|
152
|
+
### 0.2.2
|
|
147
153
|
|
|
148
|
-
|
|
154
|
+
- 修复列车行驶进度条计算问题(fix by [@This-is-XiaoDeng](https://github.com/This-is-XiaoDeng))
|
|
149
155
|
|
|
150
156
|
### 0.2.1
|
|
151
157
|
|
{nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/__init__.py
RENAMED
|
@@ -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.
|
|
9
|
+
__version__ = "0.2.3"
|
|
10
10
|
__plugin_meta__ = PluginMetadata(
|
|
11
11
|
name="CNRail",
|
|
12
12
|
description="查询 12306 列车时刻表",
|
{nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/__main__.py
RENAMED
|
@@ -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")
|
|
@@ -12,7 +12,7 @@ from playwright.async_api import Request, Route
|
|
|
12
12
|
from .config import config
|
|
13
13
|
from .models import ReturnData, TrainDetailData, TrainSearchResult, TrainSNData
|
|
14
14
|
|
|
15
|
-
MOERAIL_API_BASE = "https://
|
|
15
|
+
MOERAIL_API_BASE = "https://rail.moefactory.com/api/"
|
|
16
16
|
|
|
17
17
|
TEMPLATE_PATH = Path(__file__).parent / "templates" / "train_table.html.jinja"
|
|
18
18
|
|
|
@@ -343,15 +343,14 @@
|
|
|
343
343
|
{% for station in detail.via_stations -%}
|
|
344
344
|
<tr>
|
|
345
345
|
<td>
|
|
346
|
-
|
|
347
346
|
<div class="station-point{% if detail.arrived(loop.index0, train_date) %} arrived{% endif %}"></div>
|
|
348
347
|
</td>
|
|
349
348
|
<td>{{ station.station_name }}</td>
|
|
350
349
|
<td>
|
|
351
|
-
{% if loop.
|
|
350
|
+
{% if loop.last %}-{% else %}{{ station.departure_time }}{% endif %}
|
|
352
351
|
</td>
|
|
353
352
|
<td>
|
|
354
|
-
{% if loop.
|
|
353
|
+
{% if loop.first %}-{% else %}{{ station.arrival_time}}{% endif %}
|
|
355
354
|
</td>
|
|
356
355
|
<td>{% if loop.first %}始发站{% elif loop.last %}终点站{% else %}{{ station.stop_minutes }} 分{% endif %}</td>
|
|
357
356
|
<td>{{ station.train_number }}</td>
|
|
@@ -585,4 +584,4 @@
|
|
|
585
584
|
main();
|
|
586
585
|
</script>
|
|
587
586
|
|
|
588
|
-
</html>
|
|
587
|
+
</html>
|
|
File without changes
|
{nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/config.py
RENAMED
|
File without changes
|
{nonebot_plugin_cnrail-0.2.2.dev1 → nonebot_plugin_cnrail-0.2.3}/nonebot_plugin_cnrail/models.py
RENAMED
|
File without changes
|