reykit 1.0.1__py3-none-any.whl → 1.1.1__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.
- reydb/__init__.py +1 -1
- reydb/rbuild.py +44 -44
- reydb/rconnection.py +107 -107
- reydb/rexecute.py +9 -13
- reydb/rfile.py +8 -8
- reydb/rinformation.py +13 -25
- reydb/rparameter.py +10 -10
- reykit/__init__.py +1 -1
- reykit/rcomm.py +12 -12
- reykit/rdata.py +4 -4
- reykit/remail.py +12 -14
- reykit/rexception.py +4 -4
- reykit/rimage.py +9 -9
- reykit/rlog.py +30 -30
- reykit/rmonkey.py +4 -5
- reykit/rmultitask.py +14 -15
- reykit/rnumber.py +2 -2
- reykit/ros.py +21 -21
- reykit/rrandom.py +11 -11
- reykit/rregex.py +10 -13
- reykit/rschedule.py +10 -10
- reykit/rstdout.py +13 -13
- reykit/rsystem.py +224 -30
- reykit/rtable.py +31 -31
- reykit/rtext.py +3 -3
- reykit/rtime.py +11 -31
- reykit/rtype.py +2 -2
- reykit/rwrap.py +16 -16
- reykit/rzip.py +4 -5
- {reykit-1.0.1.dist-info → reykit-1.1.1.dist-info}/METADATA +1 -1
- reykit-1.1.1.dist-info/RECORD +38 -0
- reykit-1.0.1.dist-info/RECORD +0 -64
- reyweb/__init__.py +0 -19
- reyweb/rall.py +0 -12
- reyweb/rbaidu/__init__.py +0 -21
- reyweb/rbaidu/rbaidu_base.py +0 -186
- reyweb/rbaidu/rbaidu_chat.py +0 -299
- reyweb/rbaidu/rbaidu_image.py +0 -183
- reyweb/rbaidu/rbaidu_voice.py +0 -256
- reywechat/__init__.py +0 -32
- reywechat/data/client_api.dll +0 -0
- reywechat/rall.py +0 -20
- reywechat/rclient.py +0 -912
- reywechat/rdatabase.py +0 -1189
- reywechat/rexception.py +0 -65
- reywechat/rexecute.py +0 -201
- reywechat/rlog.py +0 -198
- reywechat/rreceive.py +0 -1232
- reywechat/rschedule.py +0 -136
- reywechat/rsend.py +0 -630
- reywechat/rwechat.py +0 -201
- reyworm/__init__.py +0 -24
- reyworm/rall.py +0 -16
- reyworm/rbrowser.py +0 -134
- reyworm/rcalendar.py +0 -159
- reyworm/rnews.py +0 -126
- reyworm/rsecurity.py +0 -239
- reyworm/rtranslate.py +0 -75
- {reykit-1.0.1.dist-info → reykit-1.1.1.dist-info}/WHEEL +0 -0
- {reykit-1.0.1.dist-info → reykit-1.1.1.dist-info}/top_level.txt +0 -0
reydb/rinformation.py
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
from __future__ import annotations
|
13
|
-
from typing import Any,
|
13
|
+
from typing import Any, Literal, overload
|
14
14
|
|
15
15
|
from .rconnection import RDatabase, RDBConnection
|
16
16
|
|
@@ -31,24 +31,18 @@ class RDBInformation(object):
|
|
31
31
|
|
32
32
|
|
33
33
|
@overload
|
34
|
-
def __call__(self: RDBISchema, name:
|
34
|
+
def __call__(self: RDBISchema, name: str | None = None) -> RDBIDatabase | list[dict]: ...
|
35
35
|
|
36
36
|
@overload
|
37
|
-
def __call__(self: RDBIDatabase, name:
|
37
|
+
def __call__(self: RDBIDatabase, name: str | None = None) -> RDBITable | list[dict]: ...
|
38
38
|
|
39
39
|
@overload
|
40
|
-
def __call__(self: RDBITable, name:
|
40
|
+
def __call__(self: RDBITable, name: str | None = None) -> RDBIColumn | list[dict]: ...
|
41
41
|
|
42
42
|
@overload
|
43
|
-
def __call__(self: RDBIColumn, name:
|
44
|
-
|
45
|
-
def __call__(self, name:
|
46
|
-
RDBIDatabase,
|
47
|
-
RDBITable,
|
48
|
-
RDBIColumn,
|
49
|
-
list[dict],
|
50
|
-
dict
|
51
|
-
]:
|
43
|
+
def __call__(self: RDBIColumn, name: str | None = None) -> dict: ...
|
44
|
+
|
45
|
+
def __call__(self, name: str | None = None) -> RDBIDatabase | RDBITable | RDBIColumn | list[dict] | dict:
|
52
46
|
"""
|
53
47
|
Get information table or subclass instance.
|
54
48
|
|
@@ -127,7 +121,7 @@ class RDBInformation(object):
|
|
127
121
|
|
128
122
|
|
129
123
|
@overload
|
130
|
-
def __getattr__(self, key: Literal['_rdatabase']) ->
|
124
|
+
def __getattr__(self, key: Literal['_rdatabase']) -> RDatabase | RDBConnection: ...
|
131
125
|
|
132
126
|
@overload
|
133
127
|
def __getattr__(self, key: Literal['_database_name', '_table_name']) -> str: ...
|
@@ -141,13 +135,7 @@ class RDBInformation(object):
|
|
141
135
|
@overload
|
142
136
|
def __getattr__(self: RDBITable, key: str) -> RDBIColumn: ...
|
143
137
|
|
144
|
-
def __getattr__(self, key: str) ->
|
145
|
-
Union[RDatabase, RDBConnection],
|
146
|
-
str,
|
147
|
-
RDBIDatabase,
|
148
|
-
RDBITable,
|
149
|
-
RDBIColumn
|
150
|
-
]:
|
138
|
+
def __getattr__(self, key: str) -> RDatabase | RDBConnection | str | RDBIDatabase | RDBITable | RDBIColumn:
|
151
139
|
"""
|
152
140
|
Get attribute or build subclass instance.
|
153
141
|
|
@@ -209,7 +197,7 @@ class RDBISchema(RDBInformation):
|
|
209
197
|
|
210
198
|
def __init__(
|
211
199
|
self,
|
212
|
-
rdatabase:
|
200
|
+
rdatabase: RDatabase | RDBConnection
|
213
201
|
) -> None:
|
214
202
|
"""
|
215
203
|
Build `database information schema` attributes.
|
@@ -272,7 +260,7 @@ class RDBIDatabase(RDBInformation):
|
|
272
260
|
|
273
261
|
def __init__(
|
274
262
|
self,
|
275
|
-
rdatabase:
|
263
|
+
rdatabase: RDatabase | RDBConnection,
|
276
264
|
database_name: str
|
277
265
|
) -> None:
|
278
266
|
"""
|
@@ -366,7 +354,7 @@ class RDBITable(RDBInformation):
|
|
366
354
|
|
367
355
|
def __init__(
|
368
356
|
self,
|
369
|
-
rdatabase:
|
357
|
+
rdatabase: RDatabase | RDBConnection,
|
370
358
|
database_name: str,
|
371
359
|
table_name: str
|
372
360
|
) -> None:
|
@@ -459,7 +447,7 @@ class RDBIColumn(RDBInformation):
|
|
459
447
|
|
460
448
|
def __init__(
|
461
449
|
self,
|
462
|
-
rdatabase:
|
450
|
+
rdatabase: RDatabase | RDBConnection,
|
463
451
|
database_name: str,
|
464
452
|
table_name: str,
|
465
453
|
column_name: str
|
reydb/rparameter.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import
|
12
|
+
from typing import overload
|
13
13
|
|
14
14
|
from .rconnection import RDatabase, RDBConnection
|
15
15
|
|
@@ -29,7 +29,7 @@ class RDBParameter(object):
|
|
29
29
|
|
30
30
|
def __init__(
|
31
31
|
self,
|
32
|
-
rdatabase:
|
32
|
+
rdatabase: RDatabase | RDBConnection,
|
33
33
|
global_: bool
|
34
34
|
) -> None:
|
35
35
|
"""
|
@@ -46,7 +46,7 @@ class RDBParameter(object):
|
|
46
46
|
self.global_ = global_
|
47
47
|
|
48
48
|
|
49
|
-
def __getitem__(self, key: str) ->
|
49
|
+
def __getitem__(self, key: str) -> str | None:
|
50
50
|
"""
|
51
51
|
Get item of parameter dictionary.
|
52
52
|
|
@@ -65,7 +65,7 @@ class RDBParameter(object):
|
|
65
65
|
return value
|
66
66
|
|
67
67
|
|
68
|
-
def __setitem__(self, key: str, value:
|
68
|
+
def __setitem__(self, key: str, value: str | float) -> None:
|
69
69
|
"""
|
70
70
|
Set item of parameter dictionary.
|
71
71
|
|
@@ -92,9 +92,9 @@ class RDBPStatus(RDBParameter):
|
|
92
92
|
def get(self, key: None = None) -> dict[str, str]: ...
|
93
93
|
|
94
94
|
@overload
|
95
|
-
def get(self, key: str = None) ->
|
95
|
+
def get(self, key: str = None) -> str | None: ...
|
96
96
|
|
97
|
-
def get(self, key:
|
97
|
+
def get(self, key: str | None = None) -> dict[str, str] | str | None:
|
98
98
|
"""
|
99
99
|
Get parameter.
|
100
100
|
|
@@ -138,7 +138,7 @@ class RDBPStatus(RDBParameter):
|
|
138
138
|
return status
|
139
139
|
|
140
140
|
|
141
|
-
def update(self, params: dict[str,
|
141
|
+
def update(self, params: dict[str, str | float]) -> None:
|
142
142
|
"""
|
143
143
|
Update parameter.
|
144
144
|
|
@@ -161,9 +161,9 @@ class RDBPVariable(RDBParameter):
|
|
161
161
|
def get(self, key: None = None) -> dict[str, str]: ...
|
162
162
|
|
163
163
|
@overload
|
164
|
-
def get(self, key: str = None) ->
|
164
|
+
def get(self, key: str = None) -> str | None: ...
|
165
165
|
|
166
|
-
def get(self, key:
|
166
|
+
def get(self, key: str | None = None) -> dict[str, str] | str | None:
|
167
167
|
"""
|
168
168
|
Get parameter.
|
169
169
|
|
@@ -208,7 +208,7 @@ class RDBPVariable(RDBParameter):
|
|
208
208
|
|
209
209
|
|
210
210
|
|
211
|
-
def update(self, params: dict[str,
|
211
|
+
def update(self, params: dict[str, str | float]) -> None:
|
212
212
|
"""
|
213
213
|
Update parameter.
|
214
214
|
|
reykit/__init__.py
CHANGED
reykit/rcomm.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import Any, Literal
|
12
|
+
from typing import Any, Literal
|
13
13
|
from collections.abc import Callable, Iterable
|
14
14
|
from warnings import filterwarnings
|
15
15
|
from os.path import abspath as os_abspath, isfile as os_isfile
|
@@ -149,7 +149,7 @@ def split_cookie(cookie: str) -> dict[str, str]:
|
|
149
149
|
return params
|
150
150
|
|
151
151
|
|
152
|
-
def get_content_type(file:
|
152
|
+
def get_content_type(file: str | bytes) -> str | None:
|
153
153
|
"""
|
154
154
|
Get HTTP content type of file.
|
155
155
|
|
@@ -184,17 +184,17 @@ def get_content_type(file: Union[str, bytes]) -> Optional[str]:
|
|
184
184
|
|
185
185
|
def request(
|
186
186
|
url: str,
|
187
|
-
params:
|
188
|
-
data:
|
189
|
-
json:
|
190
|
-
files:
|
187
|
+
params: dict | None = None,
|
188
|
+
data: dict | str | bytes | None = None,
|
189
|
+
json: dict | None = None,
|
190
|
+
files: dict[str, str | bytes | tuple[str | bytes, dict]] | None = None,
|
191
191
|
headers: dict[str, str] = {},
|
192
|
-
timeout:
|
192
|
+
timeout: float | None = None,
|
193
193
|
proxies: dict[str, str] = {},
|
194
194
|
stream: bool = False,
|
195
195
|
verify: bool = False,
|
196
|
-
method:
|
197
|
-
check:
|
196
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
197
|
+
check: bool | int | Iterable[int] = False
|
198
198
|
) -> Response:
|
199
199
|
"""
|
200
200
|
Send request.
|
@@ -318,7 +318,7 @@ def request(
|
|
318
318
|
return response
|
319
319
|
|
320
320
|
|
321
|
-
def download(url: str, path:
|
321
|
+
def download(url: str, path: str | None = None) -> str:
|
322
322
|
"""
|
323
323
|
Download file from URL.
|
324
324
|
|
@@ -363,7 +363,7 @@ def download(url: str, path: Optional[str] = None) -> str:
|
|
363
363
|
|
364
364
|
|
365
365
|
def get_file_stream_time(
|
366
|
-
file:
|
366
|
+
file: str | bytes | int,
|
367
367
|
bandwidth: float
|
368
368
|
) -> float:
|
369
369
|
"""
|
@@ -402,7 +402,7 @@ def get_file_stream_time(
|
|
402
402
|
|
403
403
|
def listen_socket(
|
404
404
|
host: str,
|
405
|
-
port:
|
405
|
+
port: str | int,
|
406
406
|
handler: Callable[[bytes], Any]
|
407
407
|
) -> None:
|
408
408
|
"""
|
reykit/rdata.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import Any, TypedDict,
|
12
|
+
from typing import Any, TypedDict, Literal, NoReturn, TypeVar, overload
|
13
13
|
from collections.abc import Callable, Iterable, Generator
|
14
14
|
|
15
15
|
from .rexception import check_least_one, check_most_one
|
@@ -87,7 +87,7 @@ def count(
|
|
87
87
|
return result
|
88
88
|
|
89
89
|
|
90
|
-
def flatten(data: Any, *, _flattern_data:
|
90
|
+
def flatten(data: Any, *, _flattern_data: list | None = None) -> list:
|
91
91
|
"""
|
92
92
|
Flatten data.
|
93
93
|
|
@@ -136,9 +136,9 @@ def split(data: Iterable[Element], share: None = None, bin_size: None = None) ->
|
|
136
136
|
def split(data: Iterable[Element], share: int = None, bin_size: int = None) -> NoReturn: ...
|
137
137
|
|
138
138
|
@overload
|
139
|
-
def split(data: Iterable[Element], share:
|
139
|
+
def split(data: Iterable[Element], share: int | None = None, bin_size: int | None = None) -> list[list[Element]]: ...
|
140
140
|
|
141
|
-
def split(data: Iterable[Element], share:
|
141
|
+
def split(data: Iterable[Element], share: int | None = None, bin_size: int | None = None) -> list[list[Element]]:
|
142
142
|
"""
|
143
143
|
Split data into multiple data.
|
144
144
|
|
reykit/remail.py
CHANGED
@@ -9,8 +9,6 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import Optional, Union
|
13
|
-
from io import BufferedIOBase
|
14
12
|
from smtplib import SMTP
|
15
13
|
from email.mime.multipart import MIMEMultipart
|
16
14
|
from email.mime.text import MIMEText
|
@@ -101,12 +99,12 @@ class REmail(object):
|
|
101
99
|
|
102
100
|
def create_email(
|
103
101
|
self,
|
104
|
-
title:
|
105
|
-
text:
|
102
|
+
title: str | None,
|
103
|
+
text: str | None,
|
106
104
|
attachment: dict[str, bytes],
|
107
|
-
show_from:
|
108
|
-
show_to:
|
109
|
-
show_cc:
|
105
|
+
show_from: str | None,
|
106
|
+
show_to: list[str] | None,
|
107
|
+
show_cc: list[str] | None
|
110
108
|
) -> str:
|
111
109
|
"""
|
112
110
|
create email content.
|
@@ -169,14 +167,14 @@ class REmail(object):
|
|
169
167
|
|
170
168
|
def send_email(
|
171
169
|
self,
|
172
|
-
to:
|
173
|
-
title:
|
174
|
-
text:
|
170
|
+
to: str | list[str],
|
171
|
+
title: str | None = None,
|
172
|
+
text: str | None = None,
|
175
173
|
attachment: dict[str, FileBytes] = {},
|
176
|
-
cc:
|
177
|
-
show_from:
|
178
|
-
show_to:
|
179
|
-
show_cc:
|
174
|
+
cc: str | list[str] | None = None,
|
175
|
+
show_from: str | None = None,
|
176
|
+
show_to: str | list[str] | None = None,
|
177
|
+
show_cc: str | list[str] | None = None
|
180
178
|
) -> None:
|
181
179
|
"""
|
182
180
|
Send email.
|
reykit/rexception.py
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
"""
|
21
21
|
|
22
22
|
|
23
|
-
from typing import Any,
|
23
|
+
from typing import Any, NoReturn
|
24
24
|
from types import TracebackType
|
25
25
|
from collections.abc import Iterable
|
26
26
|
from sys import exc_info as sys_exc_info
|
@@ -61,7 +61,7 @@ def throw(
|
|
61
61
|
exception: type[BaseException] = AssertionError,
|
62
62
|
value: Any = RNull,
|
63
63
|
*values: Any,
|
64
|
-
text:
|
64
|
+
text: str | None = None,
|
65
65
|
frame: int = 2
|
66
66
|
) -> NoReturn:
|
67
67
|
"""
|
@@ -176,7 +176,7 @@ def warn(
|
|
176
176
|
|
177
177
|
|
178
178
|
def catch_exc(
|
179
|
-
title:
|
179
|
+
title: str | None = None
|
180
180
|
) -> tuple[str, type[BaseException], BaseException, TracebackType]:
|
181
181
|
"""
|
182
182
|
Catch exception information and print, must used in `except` syntax.
|
@@ -303,7 +303,7 @@ def check_file_exist(path: str) -> None:
|
|
303
303
|
|
304
304
|
def check_response_code(
|
305
305
|
code: int,
|
306
|
-
range_:
|
306
|
+
range_: int | Iterable[int] | None = None
|
307
307
|
) -> bool:
|
308
308
|
"""
|
309
309
|
Check if the response code is in range.
|
reykit/rimage.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import Any
|
12
|
+
from typing import Any
|
13
13
|
from io import BytesIO
|
14
14
|
from qrcode import make as qrcode_make
|
15
15
|
from qrcode.image.pil import PilImage
|
@@ -42,7 +42,7 @@ monkey_image_type = monkey_path_pil_image_get_bytes()
|
|
42
42
|
RImage = monkey_image_type
|
43
43
|
|
44
44
|
|
45
|
-
def encode_qrcode(text: str, path:
|
45
|
+
def encode_qrcode(text: str, path: str | None = None) -> bytes:
|
46
46
|
"""
|
47
47
|
Encoding text to QR code image.
|
48
48
|
|
@@ -73,7 +73,7 @@ def encode_qrcode(text: str, path: Optional[str] = None) -> bytes:
|
|
73
73
|
return file_bytes
|
74
74
|
|
75
75
|
|
76
|
-
def decode_qrcode(image:
|
76
|
+
def decode_qrcode(image: str | bytes) -> list[str]:
|
77
77
|
"""
|
78
78
|
Decoding QR code or bar code image.
|
79
79
|
|
@@ -108,14 +108,14 @@ def decode_qrcode(image: Union[str, bytes]) -> list[str]:
|
|
108
108
|
|
109
109
|
|
110
110
|
def compress_image(
|
111
|
-
input_image:
|
112
|
-
ouput_image:
|
111
|
+
input_image: str | bytes,
|
112
|
+
ouput_image: str | None = None,
|
113
113
|
target_size: float = 0.5,
|
114
114
|
rate: int = 5,
|
115
115
|
reduce: bool = False,
|
116
116
|
max_quality: int = 75,
|
117
117
|
min_quality: int = 0
|
118
|
-
) ->
|
118
|
+
) -> bytes | None:
|
119
119
|
"""
|
120
120
|
Compress image file.
|
121
121
|
|
@@ -187,7 +187,7 @@ def compress_image(
|
|
187
187
|
rfile(content)
|
188
188
|
|
189
189
|
|
190
|
-
def to_pimage(image:
|
190
|
+
def to_pimage(image: str | bytes) -> RImage:
|
191
191
|
"""
|
192
192
|
Get `Image` instance of `PIL` package.
|
193
193
|
|
@@ -215,8 +215,8 @@ def to_pimage(image: Union[str, bytes]) -> RImage:
|
|
215
215
|
|
216
216
|
|
217
217
|
def generate_captcha_image(
|
218
|
-
text:
|
219
|
-
path:
|
218
|
+
text: int | str | None = None,
|
219
|
+
path: str | None = None,
|
220
220
|
**kwargs: Any
|
221
221
|
) -> bytes:
|
222
222
|
"""
|
reykit/rlog.py
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
from __future__ import annotations
|
13
|
-
from typing import Any,
|
13
|
+
from typing import Any, Literal, Final, NoReturn, overload, override
|
14
14
|
from collections.abc import Callable
|
15
15
|
from queue import Queue
|
16
16
|
from os.path import abspath as os_abspath
|
@@ -291,7 +291,7 @@ class RLog(object):
|
|
291
291
|
def get_default_filter_method(
|
292
292
|
self,
|
293
293
|
format_: str,
|
294
|
-
mode :
|
294
|
+
mode : Literal['print', 'file'] | None = None
|
295
295
|
) -> Callable[[LogRecord], Literal[True]]:
|
296
296
|
"""
|
297
297
|
Get default filter method of handler.
|
@@ -397,8 +397,8 @@ class RLog(object):
|
|
397
397
|
def add_print(
|
398
398
|
self,
|
399
399
|
level: int = DEBUG,
|
400
|
-
format_:
|
401
|
-
filter_:
|
400
|
+
format_: str | None = None,
|
401
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
402
402
|
) -> StreamHandler:
|
403
403
|
"""
|
404
404
|
Add print output record handler.
|
@@ -443,56 +443,56 @@ class RLog(object):
|
|
443
443
|
@overload
|
444
444
|
def add_file(
|
445
445
|
self,
|
446
|
-
path:
|
447
|
-
mb:
|
446
|
+
path: str | None = None,
|
447
|
+
mb: float | None = None,
|
448
448
|
time: None = None,
|
449
449
|
level: int = DEBUG,
|
450
|
-
format_:
|
451
|
-
filter_:
|
450
|
+
format_: str | None = None,
|
451
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
452
452
|
) -> ConcurrentRotatingFileHandler: ...
|
453
453
|
|
454
454
|
@overload
|
455
455
|
def add_file(
|
456
456
|
self,
|
457
|
-
path:
|
457
|
+
path: str | None = None,
|
458
458
|
mb: None = None,
|
459
|
-
time:
|
459
|
+
time: float | Literal['m', 'w0', 'w1', 'w2', 'w3', 'w4', 'w5', 'w6'] = None,
|
460
460
|
level: int = DEBUG,
|
461
|
-
format_:
|
462
|
-
filter_:
|
461
|
+
format_: str | None = None,
|
462
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
463
463
|
) -> ConcurrentTimedRotatingFileHandler: ...
|
464
464
|
|
465
465
|
@overload
|
466
466
|
def add_file(
|
467
467
|
self,
|
468
|
-
path:
|
468
|
+
path: str | None = None,
|
469
469
|
mb: None = None,
|
470
470
|
time: Any = None,
|
471
471
|
level: int = DEBUG,
|
472
|
-
format_:
|
473
|
-
filter_:
|
472
|
+
format_: str | None = None,
|
473
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
474
474
|
) -> NoReturn: ...
|
475
475
|
|
476
476
|
@overload
|
477
477
|
def add_file(
|
478
478
|
self,
|
479
|
-
path:
|
479
|
+
path: str | None = None,
|
480
480
|
mb: float = None,
|
481
|
-
time:
|
481
|
+
time: float | Literal['m', 'w0', 'w1', 'w2', 'w3', 'w4', 'w5', 'w6'] = None,
|
482
482
|
level: int = DEBUG,
|
483
|
-
format_:
|
484
|
-
filter_:
|
483
|
+
format_: str | None = None,
|
484
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
485
485
|
) -> NoReturn: ...
|
486
486
|
|
487
487
|
def add_file(
|
488
488
|
self,
|
489
|
-
path:
|
490
|
-
mb:
|
491
|
-
time:
|
489
|
+
path: str | None = None,
|
490
|
+
mb: float | None = None,
|
491
|
+
time: float | Literal['m', 'w0', 'w1', 'w2', 'w3', 'w4', 'w5', 'w6'] | None = None,
|
492
492
|
level: int = DEBUG,
|
493
|
-
format_:
|
494
|
-
filter_:
|
495
|
-
) ->
|
493
|
+
format_: str | None = None,
|
494
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
495
|
+
) -> ConcurrentRotatingFileHandler | ConcurrentTimedRotatingFileHandler:
|
496
496
|
"""
|
497
497
|
Add file output record handler, can split files based on size or time.
|
498
498
|
|
@@ -613,9 +613,9 @@ class RLog(object):
|
|
613
613
|
|
614
614
|
def add_queue(
|
615
615
|
self,
|
616
|
-
queue:
|
616
|
+
queue: Queue | None = None,
|
617
617
|
level: int = DEBUG,
|
618
|
-
filter_:
|
618
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
619
619
|
) -> tuple[QueueHandler, Queue[LogRecord]]:
|
620
620
|
"""
|
621
621
|
Add queue output record handler.
|
@@ -655,7 +655,7 @@ class RLog(object):
|
|
655
655
|
self,
|
656
656
|
method: Callable[[LogRecord], Any],
|
657
657
|
level: int = DEBUG,
|
658
|
-
filter_:
|
658
|
+
filter_: Callable[[LogRecord], bool] | None = None
|
659
659
|
) -> None:
|
660
660
|
"""
|
661
661
|
Add method record handler.
|
@@ -771,7 +771,7 @@ class RLog(object):
|
|
771
771
|
def log(
|
772
772
|
self,
|
773
773
|
*messages: Any,
|
774
|
-
level:
|
774
|
+
level: int | None = None,
|
775
775
|
catch: bool = True,
|
776
776
|
**params: Any
|
777
777
|
) -> None:
|
@@ -970,7 +970,7 @@ class RRecord(object):
|
|
970
970
|
|
971
971
|
def __init__(
|
972
972
|
self,
|
973
|
-
path:
|
973
|
+
path: str | None = '_rrecord'
|
974
974
|
) -> None:
|
975
975
|
"""
|
976
976
|
Build `record` attributes.
|
reykit/rmonkey.py
CHANGED
@@ -29,7 +29,6 @@ def monkey_patch_sqlalchemy_result_more_fetch():
|
|
29
29
|
"""
|
30
30
|
|
31
31
|
|
32
|
-
from typing import Optional
|
33
32
|
from sqlalchemy.engine.cursor import CursorResult
|
34
33
|
from pandas import DataFrame, NA, concat
|
35
34
|
|
@@ -81,7 +80,7 @@ def monkey_patch_sqlalchemy_result_more_fetch():
|
|
81
80
|
|
82
81
|
|
83
82
|
# Print result.
|
84
|
-
def method_show(self: RResult, limit:
|
83
|
+
def method_show(self: RResult, limit: int | None = None) -> None:
|
85
84
|
"""
|
86
85
|
Print result.
|
87
86
|
|
@@ -207,18 +206,18 @@ def monkey_patch_sqlalchemy_row_index_field():
|
|
207
206
|
"""
|
208
207
|
|
209
208
|
|
210
|
-
from typing import Any,
|
209
|
+
from typing import Any, overload
|
211
210
|
from sqlalchemy.engine.row import Row
|
212
211
|
|
213
212
|
|
214
213
|
# Define.
|
215
214
|
@overload
|
216
|
-
def __getitem__(self, index:
|
215
|
+
def __getitem__(self, index: str | int) -> Any: ...
|
217
216
|
|
218
217
|
@overload
|
219
218
|
def __getitem__(self, index: slice) -> tuple: ...
|
220
219
|
|
221
|
-
def __getitem__(self, index:
|
220
|
+
def __getitem__(self, index: str | int | slice) -> Any | tuple:
|
222
221
|
"""
|
223
222
|
Index row value.
|
224
223
|
|