reykit 1.1.106__py3-none-any.whl → 1.1.108__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.
reykit/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:09:21
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Kit method set.
reykit/rall.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-08 13:11:09
5
+ @Time : 2022-12-08
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : All methods.
reykit/rbase.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2024-07-17 09:46:40
5
+ @Time : 2024-07-17
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Base methods.
@@ -153,36 +153,55 @@ class ConfigMeta(StaticMeta):
153
153
 
154
154
  def __getitem__(cls, name: str) -> Any:
155
155
  """
156
- Get item.
156
+ Get config value.
157
157
 
158
158
  Parameters
159
159
  ----------
160
- name : Item name.
160
+ name : Config name.
161
161
 
162
162
  Returns
163
163
  -------
164
- Item value.
164
+ Config value.
165
165
  """
166
166
 
167
167
  # Get.
168
- item = getattr(cls, name)
168
+ value = getattr(cls, name)
169
169
 
170
- return item
170
+ return value
171
171
 
172
172
 
173
173
  def __setitem__(cls, name: str, value: Any) -> None:
174
174
  """
175
- Set item.
175
+ Set config value.
176
176
 
177
177
  Parameters
178
178
  ----------
179
- name : Item name.
179
+ name : Config name.
180
180
  """
181
181
 
182
182
  # Set.
183
183
  setattr(cls, name, value)
184
184
 
185
185
 
186
+ def __contains__(cls, name: str) -> bool:
187
+ """
188
+ Whether the exist this config value.
189
+
190
+ Parameters
191
+ ----------
192
+ name : Config name.
193
+
194
+ Returns
195
+ -------
196
+ Result.
197
+ """
198
+
199
+ # Judge.
200
+ result = hasattr(cls, name)
201
+
202
+ return result
203
+
204
+
186
205
  type NullType = Type['Null']
187
206
 
188
207
 
reykit/rdata.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:10:42
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Data methods.
reykit/rdll/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-12-06 16:14:11
5
+ @Time : 2023-12-06
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : DLL file methods.
reykit/rdll/rdll_core.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-12-06 16:17:04
5
+ @Time : 2023-12-06
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : DLL file code methods.
reykit/remail.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:10:19
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Email methods.
reykit/rimage.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-04-22 17:27:47
5
+ @Time : 2023-04-22
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Image methods.
reykit/rlog.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-10-08 21:26:43
5
+ @Time : 2023-10-08
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Log methods.
reykit/rmonkey.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-03-19 19:36:47
5
+ @Time : 2023-03-19
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Monkey patch methods.
reykit/rnet.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-08 11:07:25
5
+ @Time : 2022-12-08
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Network methods.
reykit/rnum.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-04-22 22:32:34
5
+ @Time : 2023-04-22
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Number methods.
reykit/ros.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-05-09 15:30:10
5
+ @Time : 2023-05-09
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Operation system methods.
reykit/rrand.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-04-22 22:32:34
5
+ @Time : 2023-04-22
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Random methods.
reykit/rre.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-11 23:25:36
5
+ @Time : 2022-12-11
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Regular expression methods.
reykit/rschedule.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2024-01-09 21:44:48
5
+ @Time : 2024-01-09
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Schedule methods.
@@ -16,7 +16,7 @@ from apscheduler.executors.pool import ThreadPoolExecutor
16
16
  from apscheduler.schedulers.background import BackgroundScheduler
17
17
  from apscheduler.schedulers.blocking import BlockingScheduler
18
18
  from apscheduler.job import Job
19
- from reydb import rorm, Database
19
+ from reydb import rorm, DatabaseEngine
20
20
 
21
21
  from .rbase import Base, throw
22
22
 
@@ -55,7 +55,7 @@ class Schedule(Base):
55
55
  max_instances: int = 1,
56
56
  coalesce: bool = True,
57
57
  block: bool = False,
58
- db: Database | None = None
58
+ db_engine: DatabaseEngine | None = None
59
59
  ) -> None:
60
60
  """
61
61
  Build instance attributes.
@@ -66,7 +66,7 @@ class Schedule(Base):
66
66
  max_instances : Maximum number of synchronized executions of tasks with the same ID.
67
67
  coalesce : Whether to coalesce tasks with the same ID.
68
68
  block : Whether to block.
69
- db : `Database` instance.
69
+ db_engine : Database engine.
70
70
  - `None`: Not use database.
71
71
  - `Database`: Automatic record to database.
72
72
  """
@@ -96,10 +96,10 @@ class Schedule(Base):
96
96
  self.scheduler.start()
97
97
 
98
98
  ## Database.
99
- self.db = db
99
+ self.db_engine = db_engine
100
100
 
101
101
  ### Build Database.
102
- if self.db is not None:
102
+ if self.db_engine is not None:
103
103
  self.build_db()
104
104
 
105
105
 
@@ -109,11 +109,11 @@ class Schedule(Base):
109
109
  """
110
110
 
111
111
  # Check.
112
- if self.db is None:
113
- throw(ValueError, self.db)
112
+ if self.db_engine is None:
113
+ throw(ValueError, self.db_engine)
114
114
 
115
115
  # Parameter.
116
- database = self.db.database
116
+ database = self.db_engine.database
117
117
 
118
118
  ## Table.
119
119
  tables = [DatabaseORMTableSchedule]
@@ -179,10 +179,10 @@ class Schedule(Base):
179
179
  ]
180
180
 
181
181
  # Build.
182
- self.db.build.build(tables=tables, views_stats=views_stats, skip=True)
182
+ self.db_engine.build.build(tables=tables, views_stats=views_stats, skip=True)
183
183
 
184
184
  # ## Error.
185
- self.db.error.build_db()
185
+ self.db_engine.error.build_db()
186
186
 
187
187
 
188
188
  def pause(self) -> None:
@@ -256,8 +256,8 @@ class Schedule(Base):
256
256
  'task': task.__name__,
257
257
  'note': note
258
258
  }
259
- with self.db.connect() as conn:
260
- conn = self.db.connect()
259
+ with self.db_engine.connect() as conn:
260
+ conn = self.db_engine.connect()
261
261
  conn.execute.insert(
262
262
  'schedule',
263
263
  data
@@ -267,7 +267,7 @@ class Schedule(Base):
267
267
  # Try execute.
268
268
 
269
269
  ## Record error.
270
- task = self.db.error.wrap(task, note=note)
270
+ task = self.db_engine.error.wrap(task, note=note)
271
271
 
272
272
  try:
273
273
  task(*args, **kwargs)
@@ -278,7 +278,7 @@ class Schedule(Base):
278
278
  'id': id_,
279
279
  'status': 2
280
280
  }
281
- self.db.execute.update(
281
+ self.db_engine.execute.update(
282
282
  'schedule',
283
283
  data
284
284
  )
@@ -290,7 +290,7 @@ class Schedule(Base):
290
290
  'id': id_,
291
291
  'status': 1
292
292
  }
293
- self.db.execute.update(
293
+ self.db_engine.execute.update(
294
294
  'schedule',
295
295
  data
296
296
  )
@@ -335,7 +335,7 @@ class Schedule(Base):
335
335
  # Add.
336
336
 
337
337
  ## Database.
338
- if self.db is not None:
338
+ if self.db_engine is not None:
339
339
  task = self.wrap_record_db(task, note)
340
340
 
341
341
  job = self.scheduler.add_job(
reykit/rstdout.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-10-01 14:47:47
5
+ @Time : 2023-10-01
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Standard output and input methods.
reykit/rsys.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:09:42
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Interpreter system methods.
reykit/rtable.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-06-16 13:49:33
5
+ @Time : 2023-06-16
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Table methods.
reykit/rtask.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-19 20:06:20
5
+ @Time : 2022-12-19
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Multi task methods.
reykit/rtext.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-08 13:18:24
5
+ @Time : 2022-12-08
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Text methods.
reykit/rtime.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:11:50
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Time methods.
reykit/rwrap.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:12:25
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Decorator methods.
reykit/rzip.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2023-01-19 19:23:57
5
+ @Time : 2023-01-19
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : File compress methods.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.106
3
+ Version: 1.1.108
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -0,0 +1,28 @@
1
+ reykit/__init__.py,sha256=5oKzVHvTmotJB08LhrMFQO3tFVFy7JuqXMn9PqnJEH8,779
2
+ reykit/rall.py,sha256=-gxGRcEcK7zTcA66DgGLw46QuDsJcdda6NQA_Xuyq8w,619
3
+ reykit/rbase.py,sha256=pmfsU5GyAUQkMxsk2-g8Zf-dELb4ixAO4uG5DWzKrQE,22596
4
+ reykit/rdata.py,sha256=j3BBeWKMIwowjC-W_5wkJxIWvVlZsqt1mYMKuQbaPG0,11323
5
+ reykit/remail.py,sha256=DE4sxfJEXNu6MiBJKUsWXqvBrIOJNmnm_1lnGL0tZec,6693
6
+ reykit/rimage.py,sha256=z-cjI_MgEbUhuKgIbvDS_e2fy2CrnBhr_FS6D8XuAg0,6124
7
+ reykit/rlog.py,sha256=yBArs48wl509v4q7e1vHbE3E_Bqi3VHEV-Iuw2Y58f8,25649
8
+ reykit/rmonkey.py,sha256=PBA19EqlJHI9FxT8C4-t59RlyAfwfhX7xV9ZJ3PegWo,7894
9
+ reykit/rnet.py,sha256=gL7doDgzEE-AwBPgz3LUFvgG8MmPpX-JU0sA9dm9C1Q,16837
10
+ reykit/rnum.py,sha256=WNtvKSS-MkgmudIqDR8Xv4WIdNLyEPIO0jz5ukL3cXg,3603
11
+ reykit/ros.py,sha256=quDCZfqpYtZRgyK2wtscm92oPm3PaKoBqDBAaM29HV8,47714
12
+ reykit/rrand.py,sha256=nH0e4wRiLba7Tg6pRyn7qnPrzIXdlJxm7e4S1EqsBLQ,8549
13
+ reykit/rre.py,sha256=fVSTKa31lmeZCKhvbgRmDLA4KTLkLBgAYox-HQXs2d8,6001
14
+ reykit/rschedule.py,sha256=H7JQbX3kVFetmGS2EZ_216NnZj-ilGl6h1MusIx8ZWk,12288
15
+ reykit/rstdout.py,sha256=YEKP8-OcCSk8TTtChgqTkO7NSnJ5LOb77d2qiE_3vLI,8081
16
+ reykit/rsys.py,sha256=zxHeahRwCNonyprHfw6yFT9qMkITBwInOlWuvaXgnhQ,24894
17
+ reykit/rtable.py,sha256=fTeuiZNGelSfAT-BIjT2u-wgkh9WpphgdD7gj_TcFw0,10587
18
+ reykit/rtask.py,sha256=mnCl-LV23ccK6EvD4ZXInjPpMjRuq6lq2DYwTjYtYnw,27519
19
+ reykit/rtext.py,sha256=cf3a0uGmdr2ucKjGzYkQFkUPdixKJW1c82FPDdmRzwM,13227
20
+ reykit/rtime.py,sha256=3UPpUK027TY1Wgf5bzwCQo1N4ZceZ2YtcZzM9I8Q9Qg,17766
21
+ reykit/rwrap.py,sha256=lOKBhSqx8V_PcsdipPP4SaiGXXcpfaEhO_qEGSySEkw,15065
22
+ reykit/rzip.py,sha256=vYw17toqg-DbMjvycluohU9zVX73uYYqQGAp_b21pA8,3433
23
+ reykit/rdll/__init__.py,sha256=mewj06HHIzzW6oreQAz-6in2zYwNJ4-d1eWWL7CPQgc,685
24
+ reykit/rdll/rdll_core.py,sha256=zBmOyxD6LkbNIadXmFHLJinj-6UFko8D6w5d7hYA7vU,5077
25
+ reykit-1.1.108.dist-info/METADATA,sha256=-l4-TfoQ-xENjRaQF3fVABA1VOVvPzIVku289w1az7w,1882
26
+ reykit-1.1.108.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.108.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.108.dist-info/RECORD,,
@@ -1,28 +0,0 @@
1
- reykit/__init__.py,sha256=V86CHqPAAVkooVx3_QIOKpDIFVneQCTTSwfJ-uWgBno,788
2
- reykit/rall.py,sha256=7Hip02YOkIDm3_xkoSDjvvYV2LhdBV2r4UKzWWnIfIo,628
3
- reykit/rbase.py,sha256=nQWIODrCkrcNEWY0tNW5Gm894kfqKxkVlr3jsXQRnwI,22252
4
- reykit/rdata.py,sha256=JLdq6vAaHsMIV59GifWqb9J5WSuWJr313WtcKI_XvJY,11332
5
- reykit/remail.py,sha256=ybWJ2mXSgtIzr-p_OYyrijxjNxQXt5wEMtUUMbhQfLg,6702
6
- reykit/rimage.py,sha256=onM8cdkIY2L84nocvSyBoY9-JieIAJn0eWBh30WRPeg,6133
7
- reykit/rlog.py,sha256=_B264n2BfFFte-_CfMPeuOieycyaS2Ut4bLR2_xAFa4,25658
8
- reykit/rmonkey.py,sha256=uvJYGehkXfWoLF65jv4jwWacc8z-8EIhpUsffe-68mA,7903
9
- reykit/rnet.py,sha256=p-Z-jMt3LELGQgRPzzkqbdS4X6m7BafGrqn_JLLmsEY,16846
10
- reykit/rnum.py,sha256=O8tFLAbDIGG25SvC3i_d9Jq8lRaR1JrzZe5WN0pqIiU,3612
11
- reykit/ros.py,sha256=0QIBlhDUv3BCeiuVRBZQbhS6wHLF1RWrLHW1Uq9nUw8,47723
12
- reykit/rrand.py,sha256=dcBVVzlRDmSsdWs9MH4SSNMZ_ORhnIBwLzLzX2yvKDk,8558
13
- reykit/rre.py,sha256=gNRM94qXWWdyha5kaXeDj03WFs4BGFirq_Orhgi18wY,6010
14
- reykit/rschedule.py,sha256=--qIgMop7yPQO9W9ac_KiP28-KLvKyHT9IhkY88Mbzo,12177
15
- reykit/rstdout.py,sha256=ykEOI4K9TDu10KKhI83tlKcIreqgx_Lu6gBC3FvSUXs,8090
16
- reykit/rsys.py,sha256=kmk20RozJxSFgqPuUOk7mo7YcKEF1u6irTULpVW4ZLA,24903
17
- reykit/rtable.py,sha256=e4Eh06p4XFXLDcIfKPVvFd56nMklvPpaff_pe6NhEIM,10596
18
- reykit/rtask.py,sha256=n1JFMsKRvy0vOndjsZpHcTe04Z89L82ixVkRfhG9KXM,27528
19
- reykit/rtext.py,sha256=M92jCkmak5nELlue7YCFNXS02g_d2Uc1YQSjsdw3KA8,13236
20
- reykit/rtime.py,sha256=p6mcGqQZX7XRFOIv4VyOI7K8XWADoltXPT26b2ha2wY,17775
21
- reykit/rwrap.py,sha256=noJ_tNqAH95ZgXcFtyiLzKr4MCLkGXFPZvREM-4J068,15074
22
- reykit/rzip.py,sha256=kPSjz1hCgPFqmINn3qw_8yVCb6wAPbSq4-VIcan98z8,3442
23
- reykit/rdll/__init__.py,sha256=DUYGZzREGzhis36rKYGzI5JYCZJlUoKb80mkoXFfsV4,694
24
- reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
25
- reykit-1.1.106.dist-info/METADATA,sha256=7FDMiyxj11fdw6LnIc8NA3J1FBjj894EfTFqZixKRzw,1882
26
- reykit-1.1.106.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.1.106.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.1.106.dist-info/RECORD,,