reykit 1.1.0__py3-none-any.whl → 1.1.2__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 +0 -6
- 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 +10 -10
- reykit/rregex.py +10 -13
- reykit/rschedule.py +10 -10
- reykit/rstdout.py +13 -13
- reykit/rsystem.py +54 -54
- 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.1.2.dist-info/METADATA +44 -0
- reykit-1.1.2.dist-info/RECORD +30 -0
- {reykit-1.1.0.dist-info → reykit-1.1.2.dist-info}/WHEEL +1 -2
- reykit-1.1.2.dist-info/licenses/LICENSE +7 -0
- reykit-1.1.0.dist-info/METADATA +0 -29
- reykit-1.1.0.dist-info/RECORD +0 -30
- reykit-1.1.0.dist-info/top_level.txt +0 -1
reykit/ros.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, NoReturn, overload
|
14
14
|
from io import TextIOBase, BufferedIOBase
|
15
15
|
from os import (
|
16
16
|
walk as os_walk,
|
@@ -76,12 +76,12 @@ __all__ = (
|
|
76
76
|
type FilePath = str
|
77
77
|
type FileText = str
|
78
78
|
type FileData = bytes
|
79
|
-
type FileStr =
|
80
|
-
type FileBytes =
|
81
|
-
type File =
|
79
|
+
type FileStr = FilePath | FileText | TextIOBase
|
80
|
+
type FileBytes = FilePath | FileData | BufferedIOBase
|
81
|
+
type File = FileStr | FileBytes
|
82
82
|
|
83
83
|
|
84
|
-
def get_md5(file:
|
84
|
+
def get_md5(file: str | bytes) -> str:
|
85
85
|
"""
|
86
86
|
Get file MD5.
|
87
87
|
|
@@ -265,7 +265,7 @@ def get_file_bytes(file: FileBytes) -> bytes:
|
|
265
265
|
return file_bytes
|
266
266
|
|
267
267
|
|
268
|
-
def read_toml(path:
|
268
|
+
def read_toml(path: str | RFile) -> dict[str, Any]:
|
269
269
|
"""
|
270
270
|
Read and parse TOML file.
|
271
271
|
Treat nan as a None or null value.
|
@@ -338,7 +338,7 @@ class RFile(object):
|
|
338
338
|
def read(
|
339
339
|
self,
|
340
340
|
type_: Literal['str', 'bytes'] = 'bytes'
|
341
|
-
) ->
|
341
|
+
) -> bytes | str:
|
342
342
|
"""
|
343
343
|
Read file data.
|
344
344
|
|
@@ -371,7 +371,7 @@ class RFile(object):
|
|
371
371
|
|
372
372
|
def write(
|
373
373
|
self,
|
374
|
-
data:
|
374
|
+
data: Any | None = '',
|
375
375
|
append: bool = False
|
376
376
|
) -> None:
|
377
377
|
"""
|
@@ -735,7 +735,7 @@ class RFile(object):
|
|
735
735
|
|
736
736
|
def __contains__(
|
737
737
|
self,
|
738
|
-
value:
|
738
|
+
value: str | bytes
|
739
739
|
) -> bool:
|
740
740
|
"""
|
741
741
|
Judge if file text contain value.
|
@@ -775,7 +775,7 @@ class RFolder(object):
|
|
775
775
|
|
776
776
|
def __init__(
|
777
777
|
self,
|
778
|
-
path:
|
778
|
+
path: str | None = None
|
779
779
|
) -> None:
|
780
780
|
"""
|
781
781
|
Build `folder` attributes.
|
@@ -873,7 +873,7 @@ class RFolder(object):
|
|
873
873
|
pattern: str,
|
874
874
|
recursion: bool = False,
|
875
875
|
all_ : Literal[False] = False
|
876
|
-
) ->
|
876
|
+
) -> str | None: ...
|
877
877
|
|
878
878
|
@overload
|
879
879
|
def search(
|
@@ -888,7 +888,7 @@ class RFolder(object):
|
|
888
888
|
pattern: str,
|
889
889
|
recursion: bool = False,
|
890
890
|
all_ : bool = False
|
891
|
-
) ->
|
891
|
+
) -> str | None:
|
892
892
|
"""
|
893
893
|
Search file by name.
|
894
894
|
|
@@ -1149,8 +1149,8 @@ class RTempFile(object):
|
|
1149
1149
|
|
1150
1150
|
def __init__(
|
1151
1151
|
self,
|
1152
|
-
dir_:
|
1153
|
-
suffix:
|
1152
|
+
dir_: str | None = None,
|
1153
|
+
suffix: str | None = None,
|
1154
1154
|
type_: Literal['str', 'bytes'] = 'bytes'
|
1155
1155
|
) -> None:
|
1156
1156
|
"""
|
@@ -1181,7 +1181,7 @@ class RTempFile(object):
|
|
1181
1181
|
self.path = self.file.name
|
1182
1182
|
|
1183
1183
|
|
1184
|
-
def read(self) ->
|
1184
|
+
def read(self) -> bytes | str:
|
1185
1185
|
"""
|
1186
1186
|
Read file data.
|
1187
1187
|
|
@@ -1199,7 +1199,7 @@ class RTempFile(object):
|
|
1199
1199
|
|
1200
1200
|
def write(
|
1201
1201
|
self,
|
1202
|
-
data:
|
1202
|
+
data: str | bytes
|
1203
1203
|
) -> None:
|
1204
1204
|
"""
|
1205
1205
|
Write file data.
|
@@ -1391,7 +1391,7 @@ class RTempFile(object):
|
|
1391
1391
|
|
1392
1392
|
def __contains__(
|
1393
1393
|
self,
|
1394
|
-
value:
|
1394
|
+
value: str | bytes
|
1395
1395
|
) -> bool:
|
1396
1396
|
"""
|
1397
1397
|
Judge if file text contain value.
|
@@ -1434,7 +1434,7 @@ class RTempFolder(object):
|
|
1434
1434
|
|
1435
1435
|
def __init__(
|
1436
1436
|
self,
|
1437
|
-
dir_:
|
1437
|
+
dir_: str | None = None
|
1438
1438
|
) -> None:
|
1439
1439
|
"""
|
1440
1440
|
Build `temporary folder` attributes.
|
@@ -1529,7 +1529,7 @@ class RTempFolder(object):
|
|
1529
1529
|
pattern: str,
|
1530
1530
|
recursion: bool = False,
|
1531
1531
|
all_ : Literal[False] = False
|
1532
|
-
) ->
|
1532
|
+
) -> str | None: ...
|
1533
1533
|
|
1534
1534
|
@overload
|
1535
1535
|
def search(
|
@@ -1544,7 +1544,7 @@ class RTempFolder(object):
|
|
1544
1544
|
pattern: str,
|
1545
1545
|
recursion: bool = False,
|
1546
1546
|
all_ : bool = False
|
1547
|
-
) ->
|
1547
|
+
) -> str | None:
|
1548
1548
|
"""
|
1549
1549
|
Search file by name.
|
1550
1550
|
|
@@ -1762,7 +1762,7 @@ class RTempFolder(object):
|
|
1762
1762
|
|
1763
1763
|
def doc_to_docx(
|
1764
1764
|
path: str,
|
1765
|
-
save_path:
|
1765
|
+
save_path: str | None = None
|
1766
1766
|
) -> str:
|
1767
1767
|
"""
|
1768
1768
|
Convert `DOC` file to `DOCX` file.
|
reykit/rrandom.py
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
from __future__ import annotations
|
13
|
-
from typing import
|
13
|
+
from typing import Literal, Self, overload
|
14
14
|
from types import TracebackType
|
15
15
|
from collections.abc import Sequence
|
16
16
|
from string import digits as string_digits, ascii_letters as string_ascii_letters, punctuation as string_punctuation
|
@@ -64,7 +64,7 @@ class RRandomSeed(object):
|
|
64
64
|
"""
|
65
65
|
|
66
66
|
|
67
|
-
def __init__(self, seed:
|
67
|
+
def __init__(self, seed: int | float | str | bytes | bytearray | None = None) -> None:
|
68
68
|
"""
|
69
69
|
Build `random` attributes.
|
70
70
|
|
@@ -72,7 +72,7 @@ class RRandomSeed(object):
|
|
72
72
|
----------
|
73
73
|
seed : Random seed.
|
74
74
|
- `None`: Clear seed.
|
75
|
-
- `
|
75
|
+
- `int | float | str | bytes | bytearray` : Set seed.
|
76
76
|
"""
|
77
77
|
|
78
78
|
# Delete.
|
@@ -114,9 +114,9 @@ class RRandomSeed(object):
|
|
114
114
|
|
115
115
|
def __exit__(
|
116
116
|
self,
|
117
|
-
exc_type:
|
118
|
-
exc_instance:
|
119
|
-
exc_traceback:
|
117
|
+
exc_type: type[BaseException] | None,
|
118
|
+
exc_instance: BaseException | None,
|
119
|
+
exc_traceback: TracebackType | None
|
120
120
|
) -> None:
|
121
121
|
"""
|
122
122
|
Exit syntax `with`.
|
@@ -158,8 +158,8 @@ def randn(
|
|
158
158
|
|
159
159
|
def randn(
|
160
160
|
*thresholds: float,
|
161
|
-
precision:
|
162
|
-
) ->
|
161
|
+
precision: int | None = None
|
162
|
+
) -> int | float:
|
163
163
|
"""
|
164
164
|
Random number.
|
165
165
|
|
@@ -273,9 +273,9 @@ def randi(
|
|
273
273
|
|
274
274
|
def randi(
|
275
275
|
data: Sequence,
|
276
|
-
multi:
|
276
|
+
multi: int | None = None,
|
277
277
|
unique: bool = True
|
278
|
-
) ->
|
278
|
+
) -> Element | list[Element]:
|
279
279
|
"""
|
280
280
|
Random index data element.
|
281
281
|
|
reykit/rregex.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import
|
12
|
+
from typing import Literal, overload
|
13
13
|
from collections.abc import Callable
|
14
14
|
from re import (
|
15
15
|
search as re_search,
|
@@ -38,7 +38,7 @@ __all__ = (
|
|
38
38
|
def search(
|
39
39
|
pattern: str,
|
40
40
|
text: str
|
41
|
-
) ->
|
41
|
+
) -> str | tuple[str | None, ...] | None:
|
42
42
|
"""
|
43
43
|
Regular search text.
|
44
44
|
|
@@ -73,7 +73,7 @@ def search(
|
|
73
73
|
def findall(
|
74
74
|
pattern: str,
|
75
75
|
text: str,
|
76
|
-
) ->
|
76
|
+
) -> list[str] | list[tuple[str, ...]]:
|
77
77
|
"""
|
78
78
|
Regular find all text.
|
79
79
|
|
@@ -96,8 +96,8 @@ def findall(
|
|
96
96
|
def sub(
|
97
97
|
pattern: str,
|
98
98
|
text: str,
|
99
|
-
replace:
|
100
|
-
count:
|
99
|
+
replace: str | Callable[[RMatch], str] | None = None,
|
100
|
+
count: int | None = None
|
101
101
|
) -> str:
|
102
102
|
"""
|
103
103
|
Regular replace text.
|
@@ -130,7 +130,7 @@ def sub(
|
|
130
130
|
def split(
|
131
131
|
pattern: str,
|
132
132
|
text: str,
|
133
|
-
count:
|
133
|
+
count: int | None = None
|
134
134
|
) -> list[str]:
|
135
135
|
"""
|
136
136
|
Regular split text.
|
@@ -161,23 +161,20 @@ def search_batch(
|
|
161
161
|
text: str,
|
162
162
|
*patterns: str,
|
163
163
|
first: Literal[True] = True
|
164
|
-
) ->
|
164
|
+
) -> str | tuple[str | None, ...] | None: ...
|
165
165
|
|
166
166
|
@overload
|
167
167
|
def search_batch(
|
168
168
|
text: str,
|
169
169
|
*patterns: str,
|
170
170
|
first: Literal[False] = True
|
171
|
-
) -> list[
|
171
|
+
) -> list[str | tuple[str | None, ...] | None]: ...
|
172
172
|
|
173
173
|
def search_batch(
|
174
174
|
text: str,
|
175
175
|
*patterns: str,
|
176
176
|
first: bool = True
|
177
|
-
) ->
|
178
|
-
Optional[Union[str, tuple[Optional[str], ...]]],
|
179
|
-
list[Optional[Union[str, tuple[Optional[str], ...]]]]
|
180
|
-
]:
|
177
|
+
) -> str | tuple[str | None, ...] | list[str | tuple[str | None, ...] | None] | None:
|
181
178
|
"""
|
182
179
|
Batch regular search text.
|
183
180
|
|
@@ -237,7 +234,7 @@ def findall_batch(text: str, *patterns: str) -> str:
|
|
237
234
|
return texts
|
238
235
|
|
239
236
|
|
240
|
-
def sub_batch(text: str, *patterns:
|
237
|
+
def sub_batch(text: str, *patterns: str | tuple[str, str | Callable[[RMatch], str]]) -> str:
|
241
238
|
"""
|
242
239
|
Batch regular replace text.
|
243
240
|
|
reykit/rschedule.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
|
14
14
|
from apscheduler.executors.pool import ThreadPoolExecutor
|
15
15
|
from apscheduler.schedulers.background import BackgroundScheduler
|
@@ -123,8 +123,8 @@ class RSchedule(object):
|
|
123
123
|
self,
|
124
124
|
func: Callable,
|
125
125
|
trigger: Literal['date', 'interval', 'cron'] = 'date',
|
126
|
-
args:
|
127
|
-
kwargs:
|
126
|
+
args: tuple | None = None,
|
127
|
+
kwargs: dict | None = None,
|
128
128
|
**trigger_kwargs: Any
|
129
129
|
) -> Job:
|
130
130
|
"""
|
@@ -157,10 +157,10 @@ class RSchedule(object):
|
|
157
157
|
|
158
158
|
def modify_task(
|
159
159
|
self,
|
160
|
-
task:
|
161
|
-
trigger:
|
162
|
-
args:
|
163
|
-
kwargs:
|
160
|
+
task: Job | str,
|
161
|
+
trigger: Literal['date', 'interval', 'cron'] | None = None,
|
162
|
+
args: tuple | None = None,
|
163
|
+
kwargs: dict | None = None,
|
164
164
|
**trigger_kwargs: Any
|
165
165
|
) -> None:
|
166
166
|
"""
|
@@ -205,7 +205,7 @@ class RSchedule(object):
|
|
205
205
|
|
206
206
|
def remove_task(
|
207
207
|
self,
|
208
|
-
task:
|
208
|
+
task: Job | str
|
209
209
|
) -> None:
|
210
210
|
"""
|
211
211
|
Remove task.
|
@@ -227,7 +227,7 @@ class RSchedule(object):
|
|
227
227
|
|
228
228
|
def pause_task(
|
229
229
|
self,
|
230
|
-
task:
|
230
|
+
task: Job | str
|
231
231
|
) -> None:
|
232
232
|
"""
|
233
233
|
Pause task.
|
@@ -249,7 +249,7 @@ class RSchedule(object):
|
|
249
249
|
|
250
250
|
def resume_task(
|
251
251
|
self,
|
252
|
-
task:
|
252
|
+
task: Job | str
|
253
253
|
) -> None:
|
254
254
|
"""
|
255
255
|
Resume task.
|
reykit/rstdout.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import Any, Literal,
|
12
|
+
from typing import Any, Literal, Final, Self
|
13
13
|
from collections.abc import Callable
|
14
14
|
import sys
|
15
15
|
from io import TextIOWrapper
|
@@ -60,9 +60,9 @@ class RConfigStdout(object, metaclass=RConfigMeta):
|
|
60
60
|
|
61
61
|
def beautify_text(
|
62
62
|
data: tuple[Any],
|
63
|
-
title:
|
64
|
-
width:
|
65
|
-
frame:
|
63
|
+
title: bool | str = True,
|
64
|
+
width: int | None = None,
|
65
|
+
frame: Literal['full', 'half', 'top', 'half_plain', 'top_plain'] | None = 'full'
|
66
66
|
) -> str:
|
67
67
|
"""
|
68
68
|
Beautify data to text.
|
@@ -132,9 +132,9 @@ def beautify_text(
|
|
132
132
|
|
133
133
|
def echo(
|
134
134
|
*data: Any,
|
135
|
-
title:
|
136
|
-
width:
|
137
|
-
frame:
|
135
|
+
title: bool | str = True,
|
136
|
+
width: int | None = None,
|
137
|
+
frame: Literal['full', 'half', 'top', 'half_plain', 'top_plain'] | None = 'full'
|
138
138
|
) -> str:
|
139
139
|
"""
|
140
140
|
Beautify data to text, and print.
|
@@ -176,10 +176,10 @@ def echo(
|
|
176
176
|
|
177
177
|
def rinput(
|
178
178
|
*data: Any,
|
179
|
-
title:
|
180
|
-
width:
|
181
|
-
frame:
|
182
|
-
extra:
|
179
|
+
title: bool | str = True,
|
180
|
+
width: int | None = None,
|
181
|
+
frame: Literal['full', 'half', 'top', 'half_plain', 'top_plain'] | None = 'full',
|
182
|
+
extra: str | None = None
|
183
183
|
) -> str:
|
184
184
|
"""
|
185
185
|
Beautify data to text, and print data, and read string from standard input.
|
@@ -251,7 +251,7 @@ def start_print() -> None:
|
|
251
251
|
RConfigStdout._stoped = False
|
252
252
|
|
253
253
|
|
254
|
-
def modify_print(preprocess: Callable[[str],
|
254
|
+
def modify_print(preprocess: Callable[[str], str] | None) -> None:
|
255
255
|
"""
|
256
256
|
Modify standard output print write method.
|
257
257
|
|
@@ -264,7 +264,7 @@ def modify_print(preprocess: Callable[[str], Optional[str]]) -> None:
|
|
264
264
|
|
265
265
|
|
266
266
|
# Define.
|
267
|
-
def write(__s: str) ->
|
267
|
+
def write(__s: str) -> int | None:
|
268
268
|
"""
|
269
269
|
Modified standard output write method.
|
270
270
|
|
reykit/rsystem.py
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from typing import Any, TypedDict, Literal,
|
12
|
+
from typing import Any, TypedDict, Literal, overload
|
13
13
|
from collections.abc import Callable, Iterable, Sequence
|
14
14
|
from inspect import signature as inspect_signature, _ParameterKind, _empty
|
15
15
|
from sys import path as sys_path, modules as sys_modules
|
@@ -110,17 +110,17 @@ ComputerInfo = TypedDict(
|
|
110
110
|
NetWorkInfo = TypedDict(
|
111
111
|
'NetWorkTable',
|
112
112
|
{
|
113
|
-
'family':
|
114
|
-
'socket':
|
113
|
+
'family': str | None,
|
114
|
+
'socket': str | None,
|
115
115
|
'local_ip': str,
|
116
116
|
'local_port': int,
|
117
|
-
'remote_ip':
|
118
|
-
'remote_port':
|
119
|
-
'status':
|
120
|
-
'pid':
|
117
|
+
'remote_ip': str | None,
|
118
|
+
'remote_port': int | None,
|
119
|
+
'status': str | None,
|
120
|
+
'pid': int | None
|
121
121
|
}
|
122
122
|
)
|
123
|
-
ProcessInfo = TypedDict('ProcessInfo', {'create_time': datetime, 'id': int, 'name': str, 'ports':
|
123
|
+
ProcessInfo = TypedDict('ProcessInfo', {'create_time': datetime, 'id': int, 'name': str, 'ports': list[int] | None})
|
124
124
|
|
125
125
|
|
126
126
|
class RConfigSystem(object, metaclass=RConfigMeta):
|
@@ -208,7 +208,7 @@ def del_modules(path: str) -> list[str]:
|
|
208
208
|
return deleted_dict
|
209
209
|
|
210
210
|
|
211
|
-
def dos_command(command:
|
211
|
+
def dos_command(command: str | Iterable[str]) -> str:
|
212
212
|
"""
|
213
213
|
Execute DOS command.
|
214
214
|
|
@@ -444,7 +444,7 @@ def is_number_str(
|
|
444
444
|
|
445
445
|
def get_first_notnull(
|
446
446
|
*values: Any,
|
447
|
-
default:
|
447
|
+
default: Any | Literal['exception'] | None = None,
|
448
448
|
nulls: tuple = (None,)) -> Any:
|
449
449
|
"""
|
450
450
|
Get the first value that is not null.
|
@@ -482,12 +482,12 @@ def get_first_notnull(
|
|
482
482
|
|
483
483
|
|
484
484
|
@overload
|
485
|
-
def get_name(obj: tuple, frame: int = 2) ->
|
485
|
+
def get_name(obj: tuple, frame: int = 2) -> tuple[str, ...] | None: ...
|
486
486
|
|
487
487
|
@overload
|
488
|
-
def get_name(obj: Any, frame: int = 2) ->
|
488
|
+
def get_name(obj: Any, frame: int = 2) -> str | None: ...
|
489
489
|
|
490
|
-
def get_name(obj: Any, frame: int = 2) ->
|
490
|
+
def get_name(obj: Any, frame: int = 2) -> str | tuple[str, ...] | None:
|
491
491
|
"""
|
492
492
|
Get name of object or variable.
|
493
493
|
|
@@ -588,7 +588,7 @@ def get_stack_param(format_: Literal['floor'] = 'floor', limit: int = 2) -> dict
|
|
588
588
|
@overload
|
589
589
|
def get_stack_param(format_: Literal['full'] = 'floor', limit: int = 2) -> list[dict]: ...
|
590
590
|
|
591
|
-
def get_stack_param(format_: Literal['floor', 'full'] = 'floor', limit: int = 2) ->
|
591
|
+
def get_stack_param(format_: Literal['floor', 'full'] = 'floor', limit: int = 2) -> dict | list[dict]:
|
592
592
|
"""
|
593
593
|
Get code stack parameters.
|
594
594
|
|
@@ -644,7 +644,7 @@ def get_stack_param(format_: Literal['floor', 'full'] = 'floor', limit: int = 2)
|
|
644
644
|
def get_arg_info(func: Callable) -> list[
|
645
645
|
dict[
|
646
646
|
Literal['name', 'type', 'annotation', 'default'],
|
647
|
-
|
647
|
+
str | None
|
648
648
|
]
|
649
649
|
]:
|
650
650
|
"""
|
@@ -890,9 +890,9 @@ def get_process_table() -> list[ProcessInfo]:
|
|
890
890
|
|
891
891
|
|
892
892
|
def search_process(
|
893
|
-
id_:
|
894
|
-
name:
|
895
|
-
port:
|
893
|
+
id_: int | Sequence[int] | None = None,
|
894
|
+
name: str | Sequence[str] | None = None,
|
895
|
+
port: str | int | Sequence[str | int] | None = None,
|
896
896
|
) -> list[Process]:
|
897
897
|
"""
|
898
898
|
Search process by ID or name or port.
|
@@ -976,9 +976,9 @@ def search_process(
|
|
976
976
|
|
977
977
|
|
978
978
|
def kill_process(
|
979
|
-
id_:
|
980
|
-
name:
|
981
|
-
port:
|
979
|
+
id_: int | Sequence[int] | None = None,
|
980
|
+
name: str | Sequence[str] | None = None,
|
981
|
+
port: str | int | Sequence[str | int] | None = None,
|
982
982
|
) -> list[Process]:
|
983
983
|
"""
|
984
984
|
Search and kill process by ID or name or port.
|
@@ -1014,9 +1014,9 @@ def kill_process(
|
|
1014
1014
|
|
1015
1015
|
|
1016
1016
|
def stop_process(
|
1017
|
-
id_:
|
1018
|
-
name:
|
1019
|
-
port:
|
1017
|
+
id_: int | Sequence[int] | None = None,
|
1018
|
+
name: str | Sequence[str] | None = None,
|
1019
|
+
port: str | int | Sequence[str | int] | None = None,
|
1020
1020
|
) -> list[Process]:
|
1021
1021
|
"""
|
1022
1022
|
Search and stop process by ID or name or port.
|
@@ -1052,9 +1052,9 @@ def stop_process(
|
|
1052
1052
|
|
1053
1053
|
|
1054
1054
|
def start_process(
|
1055
|
-
id_:
|
1056
|
-
name:
|
1057
|
-
port:
|
1055
|
+
id_: int | Sequence[int] | None = None,
|
1056
|
+
name: str | Sequence[str] | None = None,
|
1057
|
+
port: str | int | Sequence[str | int] | None = None,
|
1058
1058
|
) -> list[Process]:
|
1059
1059
|
"""
|
1060
1060
|
Search and start process by ID or name or port.
|
@@ -1110,7 +1110,7 @@ def get_idle_port(min: int = 49152) -> int:
|
|
1110
1110
|
|
1111
1111
|
|
1112
1112
|
def memory_read(
|
1113
|
-
process:
|
1113
|
+
process: int | str,
|
1114
1114
|
dll: str,
|
1115
1115
|
offset: int
|
1116
1116
|
) -> int:
|
@@ -1149,7 +1149,7 @@ def memory_read(
|
|
1149
1149
|
|
1150
1150
|
|
1151
1151
|
def memory_write(
|
1152
|
-
process:
|
1152
|
+
process: int | str,
|
1153
1153
|
dll: str,
|
1154
1154
|
offset: int,
|
1155
1155
|
value: int
|
@@ -1200,8 +1200,8 @@ def open_browser(url: str) -> bool:
|
|
1200
1200
|
|
1201
1201
|
def popup_message(
|
1202
1202
|
style: Literal['info', 'warn', 'error'] = 'info',
|
1203
|
-
message:
|
1204
|
-
title:
|
1203
|
+
message: str | None = None,
|
1204
|
+
title: str | None = None
|
1205
1205
|
) -> None:
|
1206
1206
|
"""
|
1207
1207
|
Pop up system message box.
|
@@ -1237,22 +1237,22 @@ def popup_message(
|
|
1237
1237
|
@overload
|
1238
1238
|
def popup_ask(
|
1239
1239
|
style: Literal['yes_no_cancel'] = 'yes_no',
|
1240
|
-
message:
|
1241
|
-
title:
|
1242
|
-
) ->
|
1240
|
+
message: str | None = None,
|
1241
|
+
title: str | None = None
|
1242
|
+
) -> bool | None: ...
|
1243
1243
|
|
1244
1244
|
@overload
|
1245
1245
|
def popup_ask(
|
1246
1246
|
style: Literal['yes_no', 'ok_cancel', 'retry_cancel'] = 'yes_no',
|
1247
|
-
message:
|
1248
|
-
title:
|
1247
|
+
message: str | None = None,
|
1248
|
+
title: str | None = None
|
1249
1249
|
) -> bool: ...
|
1250
1250
|
|
1251
1251
|
def popup_ask(
|
1252
1252
|
style: Literal['yes_no', 'ok_cancel', 'retry_cancel', 'yes_no_cancel'] = 'yes_no',
|
1253
|
-
message:
|
1254
|
-
title:
|
1255
|
-
) ->
|
1253
|
+
message: str | None = None,
|
1254
|
+
title: str | None = None
|
1255
|
+
) -> bool | None:
|
1256
1256
|
"""
|
1257
1257
|
Pop up system ask box.
|
1258
1258
|
|
@@ -1292,35 +1292,35 @@ def popup_ask(
|
|
1292
1292
|
@overload
|
1293
1293
|
def popup_select(
|
1294
1294
|
style: Literal['file', 'save'] = 'file',
|
1295
|
-
title :
|
1296
|
-
init_folder :
|
1297
|
-
init_file :
|
1298
|
-
filter_file :
|
1295
|
+
title : str | None = None,
|
1296
|
+
init_folder : str | None = None,
|
1297
|
+
init_file : str | None = None,
|
1298
|
+
filter_file : list[tuple[str, str | list[str]]] | None = None
|
1299
1299
|
) -> str: ...
|
1300
1300
|
|
1301
1301
|
@overload
|
1302
1302
|
def popup_select(
|
1303
1303
|
style: Literal['files'] = 'file',
|
1304
|
-
title :
|
1305
|
-
init_folder :
|
1306
|
-
init_file :
|
1307
|
-
filter_file :
|
1304
|
+
title : str | None = None,
|
1305
|
+
init_folder : str | None = None,
|
1306
|
+
init_file : str | None = None,
|
1307
|
+
filter_file : list[tuple[str, str | list[str]]] | None = None
|
1308
1308
|
) -> tuple[str, ...]: ...
|
1309
1309
|
|
1310
1310
|
@overload
|
1311
1311
|
def popup_select(
|
1312
1312
|
style: Literal['folder'] = 'file',
|
1313
|
-
title :
|
1314
|
-
init_folder :
|
1313
|
+
title : str | None = None,
|
1314
|
+
init_folder : str | None = None
|
1315
1315
|
) -> str: ...
|
1316
1316
|
|
1317
1317
|
def popup_select(
|
1318
1318
|
style: Literal['file', 'files', 'folder', 'save'] = 'file',
|
1319
|
-
title :
|
1320
|
-
init_folder :
|
1321
|
-
init_file :
|
1322
|
-
filter_file :
|
1323
|
-
) ->
|
1319
|
+
title : str | None = None,
|
1320
|
+
init_folder : str | None = None,
|
1321
|
+
init_file : str | None = None,
|
1322
|
+
filter_file : list[tuple[str, str | list[str]]] | None = None
|
1323
|
+
) -> str | tuple[str, ...]:
|
1324
1324
|
"""
|
1325
1325
|
Pop up system select box.
|
1326
1326
|
|