reykit 1.1.105__py3-none-any.whl → 1.1.107__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 +1 -1
- reykit/rall.py +1 -1
- reykit/rbase.py +1 -1
- reykit/rdata.py +1 -1
- reykit/rdll/__init__.py +1 -1
- reykit/rdll/rdll_core.py +1 -1
- reykit/remail.py +1 -1
- reykit/rimage.py +1 -1
- reykit/rlog.py +1 -5
- reykit/rmonkey.py +3 -4
- reykit/rnet.py +1 -1
- reykit/rnum.py +1 -1
- reykit/ros.py +1 -1
- reykit/rrand.py +1 -1
- reykit/rre.py +1 -1
- reykit/rschedule.py +17 -18
- reykit/rstdout.py +1 -3
- reykit/rsys.py +1 -1
- reykit/rtable.py +1 -1
- reykit/rtask.py +2 -2
- reykit/rtext.py +1 -1
- reykit/rtime.py +1 -1
- reykit/rwrap.py +1 -1
- reykit/rzip.py +1 -1
- {reykit-1.1.105.dist-info → reykit-1.1.107.dist-info}/METADATA +1 -1
- reykit-1.1.107.dist-info/RECORD +28 -0
- reykit-1.1.105.dist-info/RECORD +0 -28
- {reykit-1.1.105.dist-info → reykit-1.1.107.dist-info}/WHEEL +0 -0
- {reykit-1.1.105.dist-info → reykit-1.1.107.dist-info}/licenses/LICENSE +0 -0
reykit/__init__.py
CHANGED
reykit/rall.py
CHANGED
reykit/rbase.py
CHANGED
reykit/rdata.py
CHANGED
reykit/rdll/__init__.py
CHANGED
reykit/rdll/rdll_core.py
CHANGED
reykit/remail.py
CHANGED
reykit/rimage.py
CHANGED
reykit/rlog.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# -*- coding: utf-8 -*-
|
3
3
|
|
4
4
|
"""
|
5
|
-
@Time : 2023-10-08
|
5
|
+
@Time : 2023-10-08
|
6
6
|
@Author : Rey
|
7
7
|
@Contact : reyxbo@163.com
|
8
8
|
@Explain : Log methods.
|
@@ -308,7 +308,6 @@ class Log(Base):
|
|
308
308
|
"""
|
309
309
|
|
310
310
|
|
311
|
-
# Define.
|
312
311
|
def default_filter_method(
|
313
312
|
record: LogRecord
|
314
313
|
) -> Literal[True]:
|
@@ -360,7 +359,6 @@ class Log(Base):
|
|
360
359
|
"""
|
361
360
|
|
362
361
|
|
363
|
-
# Define.
|
364
362
|
class _Filter(Base, Filter):
|
365
363
|
"""
|
366
364
|
Filter type.
|
@@ -646,7 +644,6 @@ class Log(Base):
|
|
646
644
|
_, queue = self.add_queue(level=level, filter_=filter_)
|
647
645
|
|
648
646
|
|
649
|
-
# Define.
|
650
647
|
@wrap_thread
|
651
648
|
def execute() -> None:
|
652
649
|
"""
|
@@ -698,7 +695,6 @@ class Log(Base):
|
|
698
695
|
"""
|
699
696
|
|
700
697
|
|
701
|
-
# Define.
|
702
698
|
def preprocess(__s: str) -> str:
|
703
699
|
"""
|
704
700
|
Preprocess function.
|
reykit/rmonkey.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# -*- coding: utf-8 -*-
|
3
3
|
|
4
4
|
"""
|
5
|
-
@Time : 2023-03-19
|
5
|
+
@Time : 2023-03-19
|
6
6
|
@Author : Rey
|
7
7
|
@Contact : reyxbo@163.com
|
8
8
|
@Explain : Monkey patch methods.
|
@@ -209,7 +209,7 @@ def monkey_sqlalchemy_row_index_field():
|
|
209
209
|
from typing import Any, overload
|
210
210
|
from sqlalchemy.engine.row import Row
|
211
211
|
|
212
|
-
|
212
|
+
|
213
213
|
@overload
|
214
214
|
def __getitem__(self, index: str | int) -> Any: ...
|
215
215
|
|
@@ -251,7 +251,6 @@ def monkey_pprint_modify_width_judgment() -> None:
|
|
251
251
|
from pprint import PrettyPrinter, _recursion
|
252
252
|
|
253
253
|
|
254
|
-
# Define.
|
255
254
|
def __format(_self, obj, stream, indent, allowance, context, level):
|
256
255
|
|
257
256
|
from .rtext import get_width
|
@@ -299,12 +298,12 @@ def monkey_path_pil_image_get_bytes():
|
|
299
298
|
>>> image.get_bytes()
|
300
299
|
"""
|
301
300
|
|
301
|
+
# Import.
|
302
302
|
from PIL.Image import Image
|
303
303
|
from io import BytesIO
|
304
304
|
from .rbase import Base
|
305
305
|
|
306
306
|
|
307
|
-
# Define.
|
308
307
|
def method_get_bytes(self: Image) -> bytes:
|
309
308
|
"""
|
310
309
|
Get image bytes data.
|
reykit/rnet.py
CHANGED
reykit/rnum.py
CHANGED
reykit/ros.py
CHANGED
reykit/rrand.py
CHANGED
reykit/rre.py
CHANGED
reykit/rschedule.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# -*- coding: utf-8 -*-
|
3
3
|
|
4
4
|
"""
|
5
|
-
@Time : 2024-01-09
|
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,
|
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
|
-
|
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
|
-
|
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.
|
99
|
+
self.db_engine = db_engine
|
100
100
|
|
101
101
|
### Build Database.
|
102
|
-
if self.
|
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.
|
113
|
-
throw(ValueError, self.
|
112
|
+
if self.db_engine is None:
|
113
|
+
throw(ValueError, self.db_engine)
|
114
114
|
|
115
115
|
# Parameter.
|
116
|
-
database = self.
|
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.
|
182
|
+
self.db_engine.build.build(tables=tables, views_stats=views_stats, skip=True)
|
183
183
|
|
184
184
|
# ## Error.
|
185
|
-
self.
|
185
|
+
self.db_engine.error.build_db()
|
186
186
|
|
187
187
|
|
188
188
|
def pause(self) -> None:
|
@@ -236,7 +236,6 @@ class Schedule(Base):
|
|
236
236
|
"""
|
237
237
|
|
238
238
|
|
239
|
-
# Define.
|
240
239
|
@functools_wraps(task)
|
241
240
|
def _task(*args, **kwargs) -> None:
|
242
241
|
"""
|
@@ -257,8 +256,8 @@ class Schedule(Base):
|
|
257
256
|
'task': task.__name__,
|
258
257
|
'note': note
|
259
258
|
}
|
260
|
-
with self.
|
261
|
-
conn = self.
|
259
|
+
with self.db_engine.connect() as conn:
|
260
|
+
conn = self.db_engine.connect()
|
262
261
|
conn.execute.insert(
|
263
262
|
'schedule',
|
264
263
|
data
|
@@ -268,7 +267,7 @@ class Schedule(Base):
|
|
268
267
|
# Try execute.
|
269
268
|
|
270
269
|
## Record error.
|
271
|
-
task = self.
|
270
|
+
task = self.db_engine.error.wrap(task, note=note)
|
272
271
|
|
273
272
|
try:
|
274
273
|
task(*args, **kwargs)
|
@@ -279,7 +278,7 @@ class Schedule(Base):
|
|
279
278
|
'id': id_,
|
280
279
|
'status': 2
|
281
280
|
}
|
282
|
-
self.
|
281
|
+
self.db_engine.execute.update(
|
283
282
|
'schedule',
|
284
283
|
data
|
285
284
|
)
|
@@ -291,7 +290,7 @@ class Schedule(Base):
|
|
291
290
|
'id': id_,
|
292
291
|
'status': 1
|
293
292
|
}
|
294
|
-
self.
|
293
|
+
self.db_engine.execute.update(
|
295
294
|
'schedule',
|
296
295
|
data
|
297
296
|
)
|
@@ -336,7 +335,7 @@ class Schedule(Base):
|
|
336
335
|
# Add.
|
337
336
|
|
338
337
|
## Database.
|
339
|
-
if self.
|
338
|
+
if self.db_engine is not None:
|
340
339
|
task = self.wrap_record_db(task, note)
|
341
340
|
|
342
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
|
5
|
+
@Time : 2023-10-01
|
6
6
|
@Author : Rey
|
7
7
|
@Contact : reyxbo@163.com
|
8
8
|
@Explain : Standard output and input methods.
|
@@ -251,7 +251,6 @@ def modify_print(preprocess: Callable[[str], str] | None) -> None:
|
|
251
251
|
"""
|
252
252
|
|
253
253
|
|
254
|
-
# Define.
|
255
254
|
def write(__s: str) -> int | None:
|
256
255
|
"""
|
257
256
|
Modified standard output write method.
|
@@ -303,7 +302,6 @@ def add_print_position() -> None:
|
|
303
302
|
"""
|
304
303
|
|
305
304
|
|
306
|
-
# Define.
|
307
305
|
def preprocess(__s: str) -> str:
|
308
306
|
"""
|
309
307
|
Preprocess function.
|
reykit/rsys.py
CHANGED
reykit/rtable.py
CHANGED
reykit/rtask.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# -*- coding: utf-8 -*-
|
3
3
|
|
4
4
|
"""
|
5
|
-
@Time : 2022-12-19
|
5
|
+
@Time : 2022-12-19
|
6
6
|
@Author : Rey
|
7
7
|
@Contact : reyxbo@163.com
|
8
8
|
@Explain : Multi task methods.
|
@@ -377,7 +377,7 @@ def async_run(
|
|
377
377
|
before = handle_tasks_func(before)
|
378
378
|
after = handle_tasks_func(after)
|
379
379
|
|
380
|
-
|
380
|
+
|
381
381
|
async def async_run_coroutine() -> list[T | BaseException]:
|
382
382
|
"""
|
383
383
|
Asynchronous run coroutines.
|
reykit/rtext.py
CHANGED
reykit/rtime.py
CHANGED
reykit/rwrap.py
CHANGED
reykit/rzip.py
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
reykit/__init__.py,sha256=5oKzVHvTmotJB08LhrMFQO3tFVFy7JuqXMn9PqnJEH8,779
|
2
|
+
reykit/rall.py,sha256=-gxGRcEcK7zTcA66DgGLw46QuDsJcdda6NQA_Xuyq8w,619
|
3
|
+
reykit/rbase.py,sha256=HceNnyn_pDikZxd5jdWM9AP8Z2y6zYFhZ3pVG9rRoUo,22243
|
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.107.dist-info/METADATA,sha256=3aiGxp4u63VpBj6V6ebkZANs-XSdz8TA3Xo2GDFesok,1882
|
26
|
+
reykit-1.1.107.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
27
|
+
reykit-1.1.107.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
28
|
+
reykit-1.1.107.dist-info/RECORD,,
|
reykit-1.1.105.dist-info/RECORD
DELETED
@@ -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=cayYGf_VuvxUDIt8Lz3te2IfCNRNsE3TbCMqCcKWf3Q,25734
|
8
|
-
reykit/rmonkey.py,sha256=1JPAtaf-cNYcLlOv6CEAzBPWRheXS_LyrqiqxaL588M,7931
|
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=M-c3cS6P4HWEdGEKHKJBzL4rtlbUdZ4nHJdRWYkdUZk,12196
|
15
|
-
reykit/rstdout.py,sha256=s2l8cpNrJjtLwRqVv2zPVKcPbIlIncSevK9jzqKmgUo,8120
|
16
|
-
reykit/rsys.py,sha256=kmk20RozJxSFgqPuUOk7mo7YcKEF1u6irTULpVW4ZLA,24903
|
17
|
-
reykit/rtable.py,sha256=e4Eh06p4XFXLDcIfKPVvFd56nMklvPpaff_pe6NhEIM,10596
|
18
|
-
reykit/rtask.py,sha256=iAd_ihPZTrdzb9c1ZzvTf_oEQILF-8IrcsGin5h6-mA,27541
|
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.105.dist-info/METADATA,sha256=sUnFLCYpD2mGd3kIuQi1uMh7XWI6od8JbGuh6O7IvSw,1882
|
26
|
-
reykit-1.1.105.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
27
|
-
reykit-1.1.105.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
28
|
-
reykit-1.1.105.dist-info/RECORD,,
|
File without changes
|
File without changes
|