reykit 1.1.14__py3-none-any.whl → 1.1.15__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/rexception.py CHANGED
@@ -20,7 +20,7 @@
20
20
  """
21
21
 
22
22
 
23
- from typing import Any, NoReturn
23
+ from typing import Any, NoReturn, overload
24
24
  from types import TracebackType
25
25
  from collections.abc import Iterable
26
26
  from sys import exc_info as sys_exc_info
@@ -213,6 +213,12 @@ def catch_exc(
213
213
  return exc_report, exc_type, exc_instance, exc_traceback
214
214
 
215
215
 
216
+ @overload
217
+ def check_least_one(*values: None) -> NoReturn: ...
218
+
219
+ @overload
220
+ def check_least_one(*values: Any) -> None: ...
221
+
216
222
  def check_least_one(*values: Any) -> None:
217
223
  """
218
224
  Check that at least one of multiple values is not null, when check fail, then throw exception.
@@ -249,22 +255,23 @@ def check_most_one(*values: Any) -> None:
249
255
  """
250
256
 
251
257
  # Check.
252
- none_count = 0
258
+ exist = False
253
259
  for value in values:
254
260
  if value is not None:
255
- none_count += 1
256
-
257
- # Throw exception.
258
- if none_count > 1:
259
- from .rsystem import get_name
260
- vars_name = get_name(values)
261
- if vars_name is not None:
262
- vars_name_de_dup = list(set(vars_name))
263
- vars_name_de_dup.sort(key=vars_name.index)
264
- vars_name_str = ' ' + ' and '.join([f'"{var_name}"' for var_name in vars_name_de_dup])
265
- else:
266
- vars_name_str = ''
267
- raise TypeError(f'at most one of parameters{vars_name_str} is not None')
261
+ if exist is True:
262
+
263
+ # Throw exception.
264
+ from .rsystem import get_name
265
+ vars_name = get_name(values)
266
+ if vars_name is not None:
267
+ vars_name_de_dup = list(set(vars_name))
268
+ vars_name_de_dup.sort(key=vars_name.index)
269
+ vars_name_str = ' ' + ' and '.join([f'"{var_name}"' for var_name in vars_name_de_dup])
270
+ else:
271
+ vars_name_str = ''
272
+ raise TypeError(f'at most one of parameters{vars_name_str} is not None')
273
+
274
+ exist = True
268
275
 
269
276
 
270
277
  def check_file_found(path: str) -> None:
reykit/rlog.py CHANGED
@@ -998,7 +998,7 @@ class RRecord(object):
998
998
  rfile(value, True)
999
999
 
1000
1000
 
1001
- def is_record(
1001
+ def is_recorded(
1002
1002
  self,
1003
1003
  value: Any
1004
1004
  ) -> bool:
@@ -1036,4 +1036,4 @@ class RRecord(object):
1036
1036
  __call__ = record
1037
1037
 
1038
1038
 
1039
- __contains__ = is_record
1039
+ __contains__ = is_recorded
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.14
3
+ Version: 1.1.15
4
4
  Summary: Rey's kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -3,9 +3,9 @@ reykit/rall.py,sha256=mOFwHXZ4-BOkJ5Ptbm6lQc2zwNf_VqcqM6AYYnYPfoo,672
3
3
  reykit/rcomm.py,sha256=LgSLrpUokOgdRMYwuZj6JNvxDyvENwsiOd6ZHo67HBg,11444
4
4
  reykit/rdata.py,sha256=nCBZxD2fsDuFCDyfLLZZPYJPod4Xuv0aKplQDDUMvI8,8285
5
5
  reykit/remail.py,sha256=rK_hbqGeZh04DnVPtjODLsm_YfdrZ5L-Z6SbjplrfUc,6736
6
- reykit/rexception.py,sha256=ftXVdEVkU0B0HXbKjQTiJRJVVGbvhorwWtMiplpN9Zk,8118
6
+ reykit/rexception.py,sha256=lxs3DWNsGn33YTpYHi6pm4rjjYFpqvYSKhkailxM638,8344
7
7
  reykit/rimage.py,sha256=fQpIHX6Go3Jk_MDgsSDnZx27EZHumyGdgI9xyjP5lYQ,6275
8
- reykit/rlog.py,sha256=qhmATMv3_bJRaiuN9mo8hSf_95HH5Lw838aJFio98sg,25760
8
+ reykit/rlog.py,sha256=EETnQNVADBvTyseVpL5uOKWL647ee6ZeAevBnTOOWF8,25764
9
9
  reykit/rmonkey.py,sha256=RqhmKXabl11s2RJaGizpm00Q1yEkul1Je5uxw8_thUk,7584
10
10
  reykit/rmultitask.py,sha256=vey2UiPcwP7XI8LiobcpRqA0FGUg_jAzBR9FmcuSHEk,23133
11
11
  reykit/rnumber.py,sha256=6x4FuRB-MTJheo6wbTUEaBarnew15jomlrneo3_Q2wg,3646
@@ -24,7 +24,7 @@ reykit/rzip.py,sha256=i6KkmeSWCnq025d-O1mbuCYezNRUhyY9OGVK0CRlNAM,3522
24
24
  reykit/rdll/__init__.py,sha256=vM9V7wSNno-WH9RrxgHTIgCkQm8LmBFoLFO8z7qovNo,306
25
25
  reykit/rdll/rdll_inject.py,sha256=bETl8tywtN1OiQudbA21u6GwBM_bqVX7jbiisNj_JBg,645
26
26
  reykit/rdll/rdll_inject_core.py,sha256=Trgh_pdJs_Lw-Y-0Kkn8kHr4BnilM9dBKnHnX25T_pM,5092
27
- reykit-1.1.14.dist-info/METADATA,sha256=PB2A-2qKkg8JjOTft-UmK7BEdQrbwR_Zu9mxxCIR7Bs,1889
28
- reykit-1.1.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- reykit-1.1.14.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
30
- reykit-1.1.14.dist-info/RECORD,,
27
+ reykit-1.1.15.dist-info/METADATA,sha256=SvehW8tJ8L3WIlKIrLyA-lFi_pOwTlRKBxIDoIJghXA,1889
28
+ reykit-1.1.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
+ reykit-1.1.15.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
30
+ reykit-1.1.15.dist-info/RECORD,,