reywechat 1.0.90__py3-none-any.whl → 1.0.92__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 CHANGED
@@ -33,7 +33,7 @@ __all__ = (
33
33
  )
34
34
 
35
35
 
36
- class DatabaseORMTableContactUser(rorm.Model, table=True):
36
+ class DatabaseORMTableContactUser(rorm.Table):
37
37
  """
38
38
  Database `contact_user` table ORM model.
39
39
  """
@@ -44,11 +44,11 @@ class DatabaseORMTableContactUser(rorm.Model, table=True):
44
44
  update_time: rorm.Datetime = rorm.Field(field_default=':update_time', index_n=True, comment='Record update time.')
45
45
  user_id: str = rorm.Field(rorm.types.VARCHAR(24), key=True, comment='User ID.')
46
46
  name: str = rorm.Field(rorm.types.VARCHAR(32), comment='User name.')
47
- contact: int = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact, 0 is no contact, 1 is contact.')
48
- valid: int = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid, 0 is invalid, 1 is valid.')
47
+ is_contact: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact.')
48
+ is_valid: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid.')
49
49
 
50
50
 
51
- class DatabaseORMTableContactRoom(rorm.Model, table=True):
51
+ class DatabaseORMTableContactRoom(rorm.Table):
52
52
  """
53
53
  Database `contact_room` table ORM model.
54
54
  """
@@ -59,11 +59,11 @@ class DatabaseORMTableContactRoom(rorm.Model, table=True):
59
59
  update_time: rorm.Datetime = rorm.Field(field_default=':update_time', index_n=True, comment='Record update time.')
60
60
  room_id: str = rorm.Field(rorm.types.VARCHAR(31), key=True, comment='Chat room ID.')
61
61
  name: str = rorm.Field(rorm.types.VARCHAR(32), comment='Chat room name.')
62
- contact: int = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact, 0 is no contact, 1 is contact.')
63
- valid: int = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid, 0 is invalid, 1 is valid.')
62
+ is_contact: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact.')
63
+ is_valid: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid.')
64
64
 
65
65
 
66
- class DatabaseORMTableContactRoomUser(rorm.Model, table=True):
66
+ class DatabaseORMTableContactRoomUser(rorm.Table):
67
67
  """
68
68
  Database `contact_room_user` table ORM model.
69
69
  """
@@ -75,11 +75,11 @@ class DatabaseORMTableContactRoomUser(rorm.Model, table=True):
75
75
  room_id: str = rorm.Field(rorm.types.VARCHAR(31), key=True, comment='Chat room ID.')
76
76
  user_id: str = rorm.Field(rorm.types.VARCHAR(24), key=True, comment='Chat room user ID.')
77
77
  name: str = rorm.Field(rorm.types.VARCHAR(32), comment='Chat room user name.')
78
- contact: int = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact, 0 is no contact, 1 is contact.')
79
- valid: int = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid, 0 is invalid, 1 is valid.')
78
+ is_contact: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the contact.')
79
+ is_valid: bool = rorm.Field(rorm.types_mysql.TINYINT(unsigned=True), field_default='1', not_null=True, comment='Is the valid.')
80
80
 
81
81
 
82
- class DatabaseORMTableMessageReceive(rorm.Model, table=True):
82
+ class DatabaseORMTableMessageReceive(rorm.Table):
83
83
  """
84
84
  Database `message_receive` table ORM model.
85
85
  """
@@ -136,7 +136,7 @@ class DatabaseORMTableMessageReceive(rorm.Model, table=True):
136
136
  file_id: int = rorm.Field(rorm.types_mysql.MEDIUMINT(unsigned=True), comment='Message file ID, from the file database.')
137
137
 
138
138
 
139
- class DatabaseORMTableMessageSend(rorm.Model, table=True):
139
+ class DatabaseORMTableMessageSend(rorm.Table):
140
140
  """
141
141
  Database `message_send` table ORM model.
142
142
  """
@@ -499,12 +499,12 @@ class WeChatDatabase(WeChatBase):
499
499
  if user_ids == []:
500
500
  sql = (
501
501
  f'UPDATE `{self.db_wechat.database}`.`contact_user`\n'
502
- 'SET `contact` = 0'
502
+ 'SET `is_contact` = 0'
503
503
  )
504
504
  else:
505
505
  sql = (
506
506
  f'UPDATE `{self.db_wechat.database}`.`contact_user`\n'
507
- 'SET `contact` = 0\n'
507
+ 'SET `is_contact` = 0\n'
508
508
  'WHERE `user_id` NOT IN :user_ids'
509
509
  )
510
510
  conn.execute(
@@ -554,12 +554,12 @@ class WeChatDatabase(WeChatBase):
554
554
  if room_ids == []:
555
555
  sql = (
556
556
  f'UPDATE `{self.db_wechat.database}`.`contact_room`\n'
557
- 'SET `contact` = 0'
557
+ 'SET `is_contact` = 0'
558
558
  )
559
559
  else:
560
560
  sql = (
561
561
  f'UPDATE `{self.db_wechat.database}`.`contact_room`\n'
562
- 'SET `contact` = 0\n'
562
+ 'SET `is_contact` = 0\n'
563
563
  'WHERE `room_id` NOT IN :room_ids'
564
564
  )
565
565
  conn.execute(
@@ -631,18 +631,18 @@ class WeChatDatabase(WeChatBase):
631
631
  if room_user_ids == []:
632
632
  sql = (
633
633
  f'UPDATE `{self.db_wechat.database}`.`contact_room_user`\n'
634
- 'SET `contact` = 0'
634
+ 'SET `is_contact` = 0'
635
635
  )
636
636
  elif room_id is None:
637
637
  sql = (
638
638
  f'UPDATE `{self.db_wechat.database}`.`contact_room_user`\n'
639
- 'SET `contact` = 0\n'
639
+ 'SET `is_contact` = 0\n'
640
640
  "WHERE CONCAT(`room_id`, ',', `user_id`) NOT IN :room_user_ids"
641
641
  )
642
642
  else:
643
643
  sql = (
644
644
  f'UPDATE `{self.db_wechat.database}`.`contact_room_user`\n'
645
- 'SET `contact` = 0\n'
645
+ 'SET `is_contact` = 0\n'
646
646
  'WHERE (\n'
647
647
  ' `room_id` = :room_id\n'
648
648
  " AND CONCAT(`room_id`, ',', `user_id`) NOT IN :room_user_ids\n"
@@ -765,7 +765,7 @@ class WeChatDatabase(WeChatBase):
765
765
  ## Generate data.
766
766
  data = {
767
767
  'room_id': message.room,
768
- 'contact': 0,
768
+ 'is_contact': 0,
769
769
  'limit': 1
770
770
  }
771
771
 
@@ -1036,7 +1036,7 @@ class WeChatDatabase(WeChatBase):
1036
1036
  if message.room is None:
1037
1037
  result = message.receiver.wechat.db.db_wechat.execute.select(
1038
1038
  'message_send',
1039
- ['valid'],
1039
+ ['is_valid'],
1040
1040
  '`user_id` = :user_id',
1041
1041
  limit=1,
1042
1042
  user_id=message.user
@@ -1046,7 +1046,7 @@ class WeChatDatabase(WeChatBase):
1046
1046
  elif message.user is None:
1047
1047
  result = message.receiver.wechat.db.db_wechat.execute.select(
1048
1048
  'message_send',
1049
- ['valid'],
1049
+ ['is_valid'],
1050
1050
  '`room_id` = :room_id',
1051
1051
  limit=1,
1052
1052
  room_id=message.room
@@ -1056,18 +1056,18 @@ class WeChatDatabase(WeChatBase):
1056
1056
  else:
1057
1057
  sql = (
1058
1058
  'SELECT (\n'
1059
- ' SELECT `valid`\n'
1059
+ ' SELECT `is_valid`\n'
1060
1060
  f' FROM `{self.db_wechat.database}`.`contact_room_user`\n'
1061
1061
  ' WHERE `room_id` = :room_id AND `user_id` = :user_id\n'
1062
1062
  ' LIMIT 1\n'
1063
- ') AS `valid`\n'
1063
+ ') AS `is_valid`\n'
1064
1064
  'FROM (\n'
1065
- ' SELECT `valid`\n'
1065
+ ' SELECT `is_valid`\n'
1066
1066
  f' FROM `{self.db_wechat.database}`.`contact_room`\n'
1067
1067
  ' WHERE `room_id` = :room_id\n'
1068
1068
  ' LIMIT 1\n'
1069
1069
  ') AS `a`\n'
1070
- 'WHERE `valid` = 1'
1070
+ 'WHERE `is_valid` = 1'
1071
1071
  )
1072
1072
  result = message.receiver.wechat.db.db_wechat.execute(
1073
1073
  sql,
@@ -1075,8 +1075,8 @@ class WeChatDatabase(WeChatBase):
1075
1075
  user_id=message.user
1076
1076
  )
1077
1077
 
1078
- valid = result.scalar()
1079
- judge = valid == 1
1078
+ is_valid = result.scalar()
1079
+ judge = is_valid == 1
1080
1080
 
1081
1081
  return judge
1082
1082
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reywechat
3
- Version: 1.0.90
3
+ Version: 1.0.92
4
4
  Summary: WeChat client control method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reywechat/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -3,14 +3,14 @@ reywechat/rall.py,sha256=ReNbm_oZTrD8lW_deMEgUfAE8yRm4NjbBWmvZuPjEg8,362
3
3
  reywechat/rbase.py,sha256=BpjxxPhvUBTf7V7Q2qYU4rHzQh9OlZCbFtdav6rDaT8,1115
4
4
  reywechat/rcache.py,sha256=HxVOvXVsO1JjVGYBvF4YHSJGlcfgMcSYvT5JCmEuumM,899
5
5
  reywechat/rclient.py,sha256=9Xzy_XUu-b2kRzM7MpwefZ6pZsrn5EnrLv5fs7Yh2Ew,22570
6
- reywechat/rdb.py,sha256=4p7jkrHY2fN6IlKh3sV061g6prIg7mvsUG9MDEfLWdg,37936
6
+ reywechat/rdb.py,sha256=R9kPcsooC7zmfNW6OIE0Oh3ssS5q_VmFtzNpCTS69xs,37777
7
7
  reywechat/rlog.py,sha256=IDtCmllHN6Wz33qeNZLXaK0s-s5dWIqIeQXc5u7lsnk,5235
8
8
  reywechat/rreceive.py,sha256=uUaJd3U8lu_wh3bSBoKo09pumbYnBszgsCKb5SbwrOI,50823
9
9
  reywechat/rsend.py,sha256=GwoM1iYFSXvsZ-q6etQhnYYW0W54os97kFJhWNnlpLs,19892
10
10
  reywechat/rtrigger.py,sha256=m1hfOA8rya4qk2Z02Ic9uvMO5ylwSaBJRYkcCLk60y0,4935
11
11
  reywechat/rwechat.py,sha256=wyYARNSCFE_VyB9WI1Hqq144gPl_FOFztx7krsRT4MY,4716
12
12
  reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
13
- reywechat-1.0.90.dist-info/METADATA,sha256=MCQ9dMEnVlQM9kImyYm9iw7ERJlqLjw_ZVFQ3wLnxOw,1596
14
- reywechat-1.0.90.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- reywechat-1.0.90.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
16
- reywechat-1.0.90.dist-info/RECORD,,
13
+ reywechat-1.0.92.dist-info/METADATA,sha256=OsrRHEVJteVlVmnz9HTxZ6KDbp4krYZ7pxqk_SUKue0,1596
14
+ reywechat-1.0.92.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ reywechat-1.0.92.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
16
+ reywechat-1.0.92.dist-info/RECORD,,