reywechat 1.0.33__py3-none-any.whl → 1.0.34__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/rdb.py +31 -20
- {reywechat-1.0.33.dist-info → reywechat-1.0.34.dist-info}/METADATA +1 -1
- {reywechat-1.0.33.dist-info → reywechat-1.0.34.dist-info}/RECORD +5 -5
- {reywechat-1.0.33.dist-info → reywechat-1.0.34.dist-info}/WHEEL +0 -0
- {reywechat-1.0.33.dist-info → reywechat-1.0.34.dist-info}/licenses/LICENSE +0 -0
reywechat/rdb.py
CHANGED
@@ -68,6 +68,17 @@ class WeChatDatabase(BaseWeChat):
|
|
68
68
|
case _:
|
69
69
|
throw(TypeError, rdatabase)
|
70
70
|
|
71
|
+
## Database path name.
|
72
|
+
self.path_names = {
|
73
|
+
'wechat': 'wechat',
|
74
|
+
'wechat.contact_user': 'contact_user',
|
75
|
+
'wechat.contact_room': 'contact_room',
|
76
|
+
'wechat.contact_room_user': 'contact_room_user',
|
77
|
+
'wechat.message_receive': 'message_receive',
|
78
|
+
'wechat.message_send': 'message_send',
|
79
|
+
'wechat.stats': 'stats'
|
80
|
+
}
|
81
|
+
|
71
82
|
# Check.
|
72
83
|
if 'sqlite' in (self.rdatabase_wechat.backend, self.rdatabase_file.backend):
|
73
84
|
text='not suitable for SQLite databases'
|
@@ -89,7 +100,7 @@ class WeChatDatabase(BaseWeChat):
|
|
89
100
|
|
90
101
|
def build(self) -> None:
|
91
102
|
"""
|
92
|
-
Check and build all standard databases and tables.
|
103
|
+
Check and build all standard databases and tables, by `self.path_names`.
|
93
104
|
"""
|
94
105
|
|
95
106
|
# Set parameter.
|
@@ -97,7 +108,7 @@ class WeChatDatabase(BaseWeChat):
|
|
97
108
|
## WeChatDatabase.
|
98
109
|
databases = [
|
99
110
|
{
|
100
|
-
'
|
111
|
+
'name': self.path_names['wechat']
|
101
112
|
}
|
102
113
|
]
|
103
114
|
|
@@ -106,7 +117,7 @@ class WeChatDatabase(BaseWeChat):
|
|
106
117
|
|
107
118
|
### 'contact_user'.
|
108
119
|
{
|
109
|
-
'path': ('wechat', 'contact_user'),
|
120
|
+
'path': (self.path_names['wechat'], self.path_names['wechat.contact_user']),
|
110
121
|
'fields': [
|
111
122
|
{
|
112
123
|
'name': 'create_time',
|
@@ -151,7 +162,7 @@ class WeChatDatabase(BaseWeChat):
|
|
151
162
|
|
152
163
|
### 'contact_room'.
|
153
164
|
{
|
154
|
-
'path': ('wechat', 'contact_room'),
|
165
|
+
'path': (self.path_names['wechat'], self.path_names['wechat.contact_room']),
|
155
166
|
'fields': [
|
156
167
|
{
|
157
168
|
'name': 'create_time',
|
@@ -196,7 +207,7 @@ class WeChatDatabase(BaseWeChat):
|
|
196
207
|
|
197
208
|
### 'contact_room_user'.
|
198
209
|
{
|
199
|
-
'path': ('wechat', 'contact_room_user'),
|
210
|
+
'path': (self.path_names['wechat'], self.path_names['wechat.contact_room_user']),
|
200
211
|
'fields': [
|
201
212
|
{
|
202
213
|
'name': 'create_time',
|
@@ -248,7 +259,7 @@ class WeChatDatabase(BaseWeChat):
|
|
248
259
|
|
249
260
|
### 'message_receive'.
|
250
261
|
{
|
251
|
-
'path': ('wechat', 'message_receive'),
|
262
|
+
'path': (self.path_names['wechat'], self.path_names['wechat.message_receive']),
|
252
263
|
'fields': [
|
253
264
|
{
|
254
265
|
'name': 'create_time',
|
@@ -338,7 +349,7 @@ class WeChatDatabase(BaseWeChat):
|
|
338
349
|
|
339
350
|
### 'message_send'.
|
340
351
|
{
|
341
|
-
'path': ('wechat', 'message_send'),
|
352
|
+
'path': (self.path_names['wechat'], self.path_names['wechat.message_send']),
|
342
353
|
'fields': [
|
343
354
|
{
|
344
355
|
'name': 'create_time',
|
@@ -436,7 +447,7 @@ class WeChatDatabase(BaseWeChat):
|
|
436
447
|
|
437
448
|
### 'stats'.
|
438
449
|
{
|
439
|
-
'path': ('wechat', 'stats'),
|
450
|
+
'path': (self.path_names['wechat'], self.path_names['wechat.stats']),
|
440
451
|
'items': [
|
441
452
|
{
|
442
453
|
'name': 'count_receive',
|
@@ -541,7 +552,7 @@ class WeChatDatabase(BaseWeChat):
|
|
541
552
|
## Insert.
|
542
553
|
if contact_table != []:
|
543
554
|
conn.execute_insert(
|
544
|
-
('wechat', 'contact_user'),
|
555
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_user']),
|
545
556
|
user_data,
|
546
557
|
'update'
|
547
558
|
)
|
@@ -597,7 +608,7 @@ class WeChatDatabase(BaseWeChat):
|
|
597
608
|
## Insert.
|
598
609
|
if contact_table != []:
|
599
610
|
conn.execute_insert(
|
600
|
-
('wechat', 'contact_room'),
|
611
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_room']),
|
601
612
|
room_data,
|
602
613
|
'update'
|
603
614
|
)
|
@@ -675,7 +686,7 @@ class WeChatDatabase(BaseWeChat):
|
|
675
686
|
## Insert.
|
676
687
|
if room_user_data != []:
|
677
688
|
conn.execute_insert(
|
678
|
-
('wechat', 'contact_room_user'),
|
689
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_room_user']),
|
679
690
|
room_user_data,
|
680
691
|
'update'
|
681
692
|
)
|
@@ -743,7 +754,7 @@ class WeChatDatabase(BaseWeChat):
|
|
743
754
|
|
744
755
|
## Insert.
|
745
756
|
self.rdatabase_wechat.execute_insert(
|
746
|
-
('wechat', 'contact_user'),
|
757
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_user']),
|
747
758
|
data,
|
748
759
|
'update'
|
749
760
|
)
|
@@ -784,7 +795,7 @@ class WeChatDatabase(BaseWeChat):
|
|
784
795
|
|
785
796
|
### 'contact_room'.
|
786
797
|
self.rdatabase_wechat.execute_insert(
|
787
|
-
('wechat', 'contact_room'),
|
798
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_room']),
|
788
799
|
data,
|
789
800
|
'update'
|
790
801
|
)
|
@@ -806,7 +817,7 @@ class WeChatDatabase(BaseWeChat):
|
|
806
817
|
|
807
818
|
## Update.
|
808
819
|
self.rdatabase_wechat.execute_update(
|
809
|
-
('wechat', 'contact_room'),
|
820
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_room']),
|
810
821
|
data
|
811
822
|
)
|
812
823
|
|
@@ -828,7 +839,7 @@ class WeChatDatabase(BaseWeChat):
|
|
828
839
|
|
829
840
|
## Update.
|
830
841
|
self.rdatabase_wechat.execute_update(
|
831
|
-
('wechat', 'contact_room'),
|
842
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_room']),
|
832
843
|
data
|
833
844
|
)
|
834
845
|
|
@@ -908,7 +919,7 @@ class WeChatDatabase(BaseWeChat):
|
|
908
919
|
|
909
920
|
# Insert.
|
910
921
|
self.rdatabase_wechat.execute_insert(
|
911
|
-
('wechat', 'message_receive'),
|
922
|
+
(self.path_names['wechat'], self.path_names['wechat.message_receive']),
|
912
923
|
data,
|
913
924
|
'ignore'
|
914
925
|
)
|
@@ -947,7 +958,7 @@ class WeChatDatabase(BaseWeChat):
|
|
947
958
|
|
948
959
|
# Update.
|
949
960
|
self.rdatabase_wechat.execute_update(
|
950
|
-
('wechat', 'message_send'),
|
961
|
+
(self.path_names['wechat'], self.path_names['wechat.message_send']),
|
951
962
|
data
|
952
963
|
)
|
953
964
|
|
@@ -1015,7 +1026,7 @@ class WeChatDatabase(BaseWeChat):
|
|
1015
1026
|
')'
|
1016
1027
|
)
|
1017
1028
|
result = conn.execute_select(
|
1018
|
-
('wechat', 'message_send'),
|
1029
|
+
(self.path_names['wechat'], self.path_names['wechat.message_send']),
|
1019
1030
|
['send_id', 'type', 'receive_id', 'parameter', 'file_id'],
|
1020
1031
|
where,
|
1021
1032
|
order='`plan_time` DESC, `send_id`'
|
@@ -1099,7 +1110,7 @@ class WeChatDatabase(BaseWeChat):
|
|
1099
1110
|
## User.
|
1100
1111
|
if message.room is None:
|
1101
1112
|
result = message.receiver.wechat.database.rdatabase_wechat.execute_select(
|
1102
|
-
('wechat', 'contact_user'),
|
1113
|
+
(self.path_names['wechat'], self.path_names['wechat.contact_user']),
|
1103
1114
|
['valid'],
|
1104
1115
|
'`user_id` = :user_id',
|
1105
1116
|
limit=1,
|
@@ -1251,6 +1262,6 @@ class WeChatDatabase(BaseWeChat):
|
|
1251
1262
|
|
1252
1263
|
# Insert.
|
1253
1264
|
self.rdatabase_wechat.execute_insert(
|
1254
|
-
('wechat', 'message_send'),
|
1265
|
+
(self.path_names['wechat'], self.path_names['wechat.message_send']),
|
1255
1266
|
data
|
1256
1267
|
)
|
@@ -3,7 +3,7 @@ reywechat/rall.py,sha256=zEW-mLL2uP8aT2_foCMFGmMi_3RCrGl8qutnSVkmY1E,397
|
|
3
3
|
reywechat/rbase.py,sha256=0NunIUIXra2ML2N6odwMk5oENTE0r6VSBHWXUvgI-lc,1124
|
4
4
|
reywechat/rcache.py,sha256=Hh_HE-t_KUMlrz4gEFPh1AjmhnrSgH520IFJPumWb7A,908
|
5
5
|
reywechat/rclient.py,sha256=MEvQB3pHb5ORukKbKntalRtFcKIOP9BGtDsMt5ihQfM,22524
|
6
|
-
reywechat/rdb.py,sha256=
|
6
|
+
reywechat/rdb.py,sha256=iSED-Ezxj3XaXy85muHLeqm8je7Eqpl_7AzbIq01xyU,41535
|
7
7
|
reywechat/rlog.py,sha256=x4WFLNoeKqGjPVoI81ZZNEd9ctdYToSg5hEFuESmCQY,5254
|
8
8
|
reywechat/rreceive.py,sha256=RkUwPsWz6k_Ua3ovrbXRMVajeNOJQqvpPXz_CvJyUPQ,35162
|
9
9
|
reywechat/rschedule.py,sha256=bZEEZV3K4zrJvupe1Eq6kGR7kunbVq5dfGnqFKYF3JI,1857
|
@@ -11,7 +11,7 @@ reywechat/rsend.py,sha256=UmdKCOb1cPKEmBPHt9htjxB8fPyi5jW5pGwpRQIZdKA,13720
|
|
11
11
|
reywechat/rtrigger.py,sha256=n8kUNovh62r7crlXrp33uaKvbILT-wcfvUqeyGt7YhM,4956
|
12
12
|
reywechat/rwechat.py,sha256=d9yNnLLz0YI1buatf5j4YMhj6tUH6yWsDnx91EyAhow,4926
|
13
13
|
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
14
|
-
reywechat-1.0.
|
15
|
-
reywechat-1.0.
|
16
|
-
reywechat-1.0.
|
17
|
-
reywechat-1.0.
|
14
|
+
reywechat-1.0.34.dist-info/METADATA,sha256=nWSxt-AjwWCOwKNx7vwgOyccc_q2iU7G47oMhzqmgS0,1551
|
15
|
+
reywechat-1.0.34.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
16
|
+
reywechat-1.0.34.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
17
|
+
reywechat-1.0.34.dist-info/RECORD,,
|
File without changes
|
File without changes
|