reywechat 1.0.48__py3-none-any.whl → 1.0.50__py3-none-any.whl
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.
- reywechat/__init__.py +0 -1
- reywechat/rall.py +0 -1
- reywechat/rdb.py +3 -3
- reywechat/rreceive.py +3 -4
- reywechat/rsend.py +6 -5
- reywechat/rwechat.py +3 -8
- {reywechat-1.0.48.dist-info → reywechat-1.0.50.dist-info}/METADATA +1 -1
- reywechat-1.0.50.dist-info/RECORD +16 -0
- reywechat/rschedule.py +0 -93
- reywechat-1.0.48.dist-info/RECORD +0 -17
- {reywechat-1.0.48.dist-info → reywechat-1.0.50.dist-info}/WHEEL +0 -0
- {reywechat-1.0.48.dist-info → reywechat-1.0.50.dist-info}/licenses/LICENSE +0 -0
reywechat/__init__.py
CHANGED
reywechat/rall.py
CHANGED
reywechat/rdb.py
CHANGED
@@ -19,7 +19,7 @@ from reykit.rwrap import wrap_thread
|
|
19
19
|
|
20
20
|
from .rbase import WeChatBase
|
21
21
|
from .rreceive import WeChatMessage
|
22
|
-
from .rsend import WeChatSendTypeEnum, WeChatSendParameter
|
22
|
+
from .rsend import WeChatSendTypeEnum, WeChatSendStatusEnum, WeChatSendParameter
|
23
23
|
from .rwechat import WeChat
|
24
24
|
|
25
25
|
|
@@ -1077,7 +1077,7 @@ class WeChatDatabase(WeChatBase):
|
|
1077
1077
|
"""
|
1078
1078
|
|
1079
1079
|
# Check.
|
1080
|
-
if send_param.status !=
|
1080
|
+
if send_param.status != WeChatSendStatusEnum.SENT:
|
1081
1081
|
return
|
1082
1082
|
|
1083
1083
|
# Handle parameter.
|
@@ -1206,7 +1206,7 @@ class WeChatDatabase(WeChatBase):
|
|
1206
1206
|
send_id,
|
1207
1207
|
**parameter
|
1208
1208
|
)
|
1209
|
-
send_param.status =
|
1209
|
+
send_param.status = WeChatSendStatusEnum.WAIT
|
1210
1210
|
self.wechat.sender.queue.put(send_param)
|
1211
1211
|
|
1212
1212
|
# Commit.
|
reywechat/rreceive.py
CHANGED
@@ -27,7 +27,7 @@ from reykit.rtime import now, sleep, wait, to_time, time_to
|
|
27
27
|
from reykit.rwrap import wrap_thread, wrap_exc
|
28
28
|
|
29
29
|
from .rbase import WeChatBase, WeChatTriggerError
|
30
|
-
from .rsend import WeChatSendTypeEnum
|
30
|
+
from .rsend import WeChatSendTypeEnum, WeChatSendStatusEnum
|
31
31
|
from .rwechat import WeChat
|
32
32
|
|
33
33
|
|
@@ -67,7 +67,8 @@ class WeChatMessage(WeChatBase):
|
|
67
67
|
WeChat message type.
|
68
68
|
"""
|
69
69
|
|
70
|
-
|
70
|
+
SendTypeEnum = WeChatSendTypeEnum
|
71
|
+
SendStatusEnum = WeChatSendStatusEnum
|
71
72
|
|
72
73
|
|
73
74
|
def __init__(
|
@@ -1095,8 +1096,6 @@ class WechatReceiver(WeChatBase):
|
|
1095
1096
|
WeChat receiver type.
|
1096
1097
|
"""
|
1097
1098
|
|
1098
|
-
TypeEnum = WeChatSendTypeEnum
|
1099
|
-
|
1100
1099
|
|
1101
1100
|
def __init__(
|
1102
1101
|
self,
|
reywechat/rsend.py
CHANGED
@@ -79,8 +79,8 @@ class WeChatSendParameter(WeChatBase):
|
|
79
79
|
WeChat send parameters type.
|
80
80
|
"""
|
81
81
|
|
82
|
-
|
83
|
-
|
82
|
+
SendTypeEnum = WeChatSendTypeEnum
|
83
|
+
SendStatusEnum = WeChatSendStatusEnum
|
84
84
|
|
85
85
|
|
86
86
|
@overload
|
@@ -204,7 +204,8 @@ class WeChatSender(WeChatBase):
|
|
204
204
|
WeChatSendTypeEnum : Send type enumeration.
|
205
205
|
"""
|
206
206
|
|
207
|
-
|
207
|
+
SendTypeEnum = WeChatSendTypeEnum
|
208
|
+
SendStatusEnum = WeChatSendStatusEnum
|
208
209
|
|
209
210
|
|
210
211
|
def __init__(self, wechat: WeChat) -> None:
|
@@ -267,7 +268,7 @@ class WeChatSender(WeChatBase):
|
|
267
268
|
# Save.
|
268
269
|
send_param.exc_reports.append(exc_text)
|
269
270
|
|
270
|
-
send_param.status =
|
271
|
+
send_param.status = WeChatSendStatusEnum.SENT
|
271
272
|
|
272
273
|
## Handler.
|
273
274
|
for handler in self.handlers:
|
@@ -462,7 +463,7 @@ class WeChatSender(WeChatBase):
|
|
462
463
|
receive_id,
|
463
464
|
**params
|
464
465
|
)
|
465
|
-
send_param.status =
|
466
|
+
send_param.status = WeChatSendStatusEnum.INIT
|
466
467
|
handle_handler_exception = lambda exc_text, *_: send_param.exc_reports.append(exc_text)
|
467
468
|
|
468
469
|
# Handler.
|
reywechat/rwechat.py
CHANGED
@@ -69,8 +69,7 @@ class WeChat(WeChatBase):
|
|
69
69
|
from .rdb import WeChatDatabase
|
70
70
|
from .rlog import WeChatLog
|
71
71
|
from .rreceive import WechatReceiver
|
72
|
-
from .
|
73
|
-
from .rsend import WeChatSender
|
72
|
+
from .rsend import WeChatSendTypeEnum, WeChatSendStatusEnum, WeChatSender
|
74
73
|
|
75
74
|
# Set attribute.
|
76
75
|
self.project_dir = project_dir or os_getcwd()
|
@@ -83,7 +82,6 @@ class WeChat(WeChatBase):
|
|
83
82
|
self.trigger = self.receiver.trigger
|
84
83
|
self.sender = WeChatSender(self)
|
85
84
|
self.database = WeChatDatabase(self, database)
|
86
|
-
self.schedule = WeChatSchedule(self)
|
87
85
|
|
88
86
|
## Client.
|
89
87
|
self.client_version = self.client.client_version
|
@@ -102,6 +100,8 @@ class WeChat(WeChatBase):
|
|
102
100
|
self.trigger_add_rule = self.trigger.add_rule
|
103
101
|
|
104
102
|
## Send.
|
103
|
+
self.SendTypeEnum = WeChatSendTypeEnum
|
104
|
+
self.SendstatusEnum = WeChatSendStatusEnum
|
105
105
|
self.send_add_handler = self.sender.add_handler
|
106
106
|
self.send = self.sender.send
|
107
107
|
self.send_start = self.sender.start
|
@@ -111,11 +111,6 @@ class WeChat(WeChatBase):
|
|
111
111
|
## Database.
|
112
112
|
self.database_build = self.database.build_db
|
113
113
|
|
114
|
-
## Schedule.
|
115
|
-
self.schedule_add_task = self.schedule.add_task
|
116
|
-
self.schedule_pause = self.schedule.pause
|
117
|
-
self.schedule_resume = self.schedule.resume
|
118
|
-
|
119
114
|
|
120
115
|
def start(self) -> None:
|
121
116
|
"""
|
@@ -0,0 +1,16 @@
|
|
1
|
+
reywechat/__init__.py,sha256=FXc3XSiPLLmz9bgZdiYKxeWX-7VT9RqPc_EkXp3Kk0I,476
|
2
|
+
reywechat/rall.py,sha256=5J_X-XMOyb1Vp1jyS9-oRFXGOtp2vRPX1g3tJot_Eck,371
|
3
|
+
reywechat/rbase.py,sha256=hbxn5spvcl_C_Bw8A9teulOXT9GMlxUw145_YbXIOzc,1124
|
4
|
+
reywechat/rcache.py,sha256=7UsHHfgFOgxuSqlTSAO6CprgUUOeBCXYus0kxmRBQxk,908
|
5
|
+
reywechat/rclient.py,sha256=lc1CPle9h08mwP8NlJN0ybzcNJxtpV0ma6q6cz1RIxk,22518
|
6
|
+
reywechat/rdb.py,sha256=YHkW81RZIdHCt2vvjgFKOZxU-EHyVf9F_XT_nOc7jxg,47354
|
7
|
+
reywechat/rlog.py,sha256=4EsTgrgC05JvWeKAucUaWGga638CRRJISJN6qncBCAw,5249
|
8
|
+
reywechat/rreceive.py,sha256=ezz6-RVKWmll-TuKXaAnmQRRQdn91v6DJlfpWcTuG20,36213
|
9
|
+
reywechat/rsend.py,sha256=TiSjHMccbjM2U6na3xPGKq3RhoaW23-BsgLdRyJSGEw,18047
|
10
|
+
reywechat/rtrigger.py,sha256=WdOQwobPdGPyyE9J-qtQFPd60713T0aWqKk02PLdCRE,4966
|
11
|
+
reywechat/rwechat.py,sha256=nIyrf3hB3n03picxV1f1hWNFzhFOXcV201ZuS97P3N4,4741
|
12
|
+
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
13
|
+
reywechat-1.0.50.dist-info/METADATA,sha256=AlBjYWk7HvQsccQ_YggBO5OpES7JFw8YwpgEtRNZGww,1551
|
14
|
+
reywechat-1.0.50.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
reywechat-1.0.50.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
+
reywechat-1.0.50.dist-info/RECORD,,
|
reywechat/rschedule.py
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
# !/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
"""
|
5
|
-
@Time : 2024-01-09 21:47:02
|
6
|
-
@Author : Rey
|
7
|
-
@Contact : reyxbo@163.com
|
8
|
-
@Explain : Schedule methods.
|
9
|
-
"""
|
10
|
-
|
11
|
-
|
12
|
-
from __future__ import annotations
|
13
|
-
from typing import Any, Literal
|
14
|
-
from collections.abc import Callable
|
15
|
-
from reykit.rschedule import Schedule
|
16
|
-
|
17
|
-
from .rbase import WeChatBase
|
18
|
-
from .rsend import WeChatSendTypeEnum
|
19
|
-
from .rwechat import WeChat
|
20
|
-
|
21
|
-
|
22
|
-
class WeChatSchedule(WeChatBase):
|
23
|
-
"""
|
24
|
-
WeChat schedule type.
|
25
|
-
"""
|
26
|
-
|
27
|
-
TypeEnum = WeChatSendTypeEnum
|
28
|
-
|
29
|
-
|
30
|
-
def __init__(
|
31
|
-
self,
|
32
|
-
wechat: WeChat
|
33
|
-
) -> None:
|
34
|
-
"""
|
35
|
-
Build instance attributes.
|
36
|
-
|
37
|
-
Parameters
|
38
|
-
----------
|
39
|
-
wechat : `WeChatClient` instance.
|
40
|
-
"""
|
41
|
-
|
42
|
-
# Set attribute.
|
43
|
-
self.wechat = wechat
|
44
|
-
self.rrschedule = Schedule()
|
45
|
-
|
46
|
-
# Start.
|
47
|
-
self.rrschedule.start()
|
48
|
-
|
49
|
-
|
50
|
-
def add_task(
|
51
|
-
self,
|
52
|
-
trigger: Literal['date', 'interval', 'cron'],
|
53
|
-
task: Callable[[WeChatSchedule], Any],
|
54
|
-
**trigger_kwargs: Any
|
55
|
-
) -> None:
|
56
|
-
"""
|
57
|
-
Add schedule send message task.
|
58
|
-
|
59
|
-
Parameters
|
60
|
-
----------
|
61
|
-
trigger : Trigger type.
|
62
|
-
task : Function of task. The parameter is the `WeChatSchedule` instance.
|
63
|
-
trigger_kwargs : Trigger keyword arguments.
|
64
|
-
"""
|
65
|
-
|
66
|
-
# Handle parameter.
|
67
|
-
args = (self,)
|
68
|
-
|
69
|
-
# Add.
|
70
|
-
self.rrschedule.add_task(
|
71
|
-
task,
|
72
|
-
trigger,
|
73
|
-
args,
|
74
|
-
**trigger_kwargs
|
75
|
-
)
|
76
|
-
|
77
|
-
|
78
|
-
def pause(self) -> None:
|
79
|
-
"""
|
80
|
-
Pause scheduler.
|
81
|
-
"""
|
82
|
-
|
83
|
-
# Pause.
|
84
|
-
self.rrschedule.pause()
|
85
|
-
|
86
|
-
|
87
|
-
def resume(self) -> None:
|
88
|
-
"""
|
89
|
-
Resume scheduler.
|
90
|
-
"""
|
91
|
-
|
92
|
-
# Pause.
|
93
|
-
self.rrschedule.resume
|
@@ -1,17 +0,0 @@
|
|
1
|
-
reywechat/__init__.py,sha256=jnk8xZKR7nkRXIcM7fvtX46WcDp-lPx1ctLnWvCi4S4,507
|
2
|
-
reywechat/rall.py,sha256=zEW-mLL2uP8aT2_foCMFGmMi_3RCrGl8qutnSVkmY1E,397
|
3
|
-
reywechat/rbase.py,sha256=hbxn5spvcl_C_Bw8A9teulOXT9GMlxUw145_YbXIOzc,1124
|
4
|
-
reywechat/rcache.py,sha256=7UsHHfgFOgxuSqlTSAO6CprgUUOeBCXYus0kxmRBQxk,908
|
5
|
-
reywechat/rclient.py,sha256=lc1CPle9h08mwP8NlJN0ybzcNJxtpV0ma6q6cz1RIxk,22518
|
6
|
-
reywechat/rdb.py,sha256=9WI0sxMscGMu-PnXKGxHThoO-kr2v8VPqQbxbZdjedw,47334
|
7
|
-
reywechat/rlog.py,sha256=4EsTgrgC05JvWeKAucUaWGga638CRRJISJN6qncBCAw,5249
|
8
|
-
reywechat/rreceive.py,sha256=dVKCGv6oTrmMK-v_zf5j0Zr04p0r2kbkWWAnkFYBuSY,36181
|
9
|
-
reywechat/rschedule.py,sha256=JzjYdjtFnbNNnpRGnCUJJThh3QreD271GXO6Emz216U,1865
|
10
|
-
reywechat/rsend.py,sha256=GTMAe-w8j8vEqxoqjFEb0tEg8z1qf3RtJyZgckVgvW4,17994
|
11
|
-
reywechat/rtrigger.py,sha256=WdOQwobPdGPyyE9J-qtQFPd60713T0aWqKk02PLdCRE,4966
|
12
|
-
reywechat/rwechat.py,sha256=YW8guhhZQde-Ic0akvh_NpIf3C2xNSw71sTi6CpLVo8,4877
|
13
|
-
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
14
|
-
reywechat-1.0.48.dist-info/METADATA,sha256=T58AXNaq9iq0qzYZZwPHB5cjFFqxdsxFQ7-R9mz5Aww,1551
|
15
|
-
reywechat-1.0.48.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
16
|
-
reywechat-1.0.48.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
17
|
-
reywechat-1.0.48.dist-info/RECORD,,
|
File without changes
|
File without changes
|