reydb 1.1.31__py3-none-any.whl → 1.1.33__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/rlog.py CHANGED
@@ -13,7 +13,7 @@ from typing import Any
13
13
  from collections.abc import Callable
14
14
  from traceback import StackSummary
15
15
  from functools import wraps as functools_wraps
16
- from reykit.rbase import T, throw, catch_exc
16
+ from reykit.rbase import T, Exit, throw, catch_exc
17
17
 
18
18
  from .rbase import DatabaseBase
19
19
  from .rconn import DatabaseConnection
@@ -233,7 +233,7 @@ class DatabaseLog(DatabaseBase):
233
233
  func: Callable[..., T] | None = None,
234
234
  *,
235
235
  note: str | None = None,
236
- filter_exc : BaseException | tuple[BaseException, ...] = None
236
+ filter_type : BaseException | tuple[BaseException, ...] = Exit
237
237
  ) -> T | Callable[[Callable[..., T]], Callable[..., T]]:
238
238
  """
239
239
  Decorator, insert exception information into the table of database, throw exception.
@@ -242,7 +242,7 @@ class DatabaseLog(DatabaseBase):
242
242
  ----------
243
243
  func : Function.
244
244
  note : Exception note.
245
- filter_exc : Exception type of not inserted, but still throw exception.
245
+ filter_type : Exception type of not inserted, but still throw exception.
246
246
 
247
247
  Returns
248
248
  -------
@@ -271,8 +271,8 @@ class DatabaseLog(DatabaseBase):
271
271
  """
272
272
 
273
273
  # Handle parameter.
274
- if issubclass(filter_exc, BaseException):
275
- filter_exc = (filter_exc,)
274
+ if issubclass(filter_type, BaseException):
275
+ filter_type = (filter_type,)
276
276
 
277
277
 
278
278
  def _wrap(func_: Callable[..., T]) -> Callable[..., T]:
@@ -313,7 +313,10 @@ class DatabaseLog(DatabaseBase):
313
313
  _, exc, stack = catch_exc()
314
314
 
315
315
  ## Filter.
316
- if type(exc) not in filter_exc:
316
+ for type_ in filter_type:
317
+ if isinstance(exc, type_):
318
+ break
319
+ else:
317
320
  self.error(exc, stack, note)
318
321
 
319
322
  raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reydb
3
- Version: 1.1.31
3
+ Version: 1.1.33
4
4
  Summary: Database method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reydb/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -7,9 +7,9 @@ reydb/rdb.py,sha256=hjWwB778jxBoTgx2lgs6n1NZMJA0Hbg4HHdXE57hZiY,61841
7
7
  reydb/rexec.py,sha256=dGdRkG1XR0Z66T0r4nPCSdQzSRWc_Q3t6TPSSrDTIxY,9042
8
8
  reydb/rfile.py,sha256=7g6hPBz33p-mkGFc6LEmL2hpFes-LM-AWQ0SxgJe2BI,15254
9
9
  reydb/rinfo.py,sha256=KXTkcpTGAD3p9RVKKcnmc_FjJtiKRPk-K5ZepPOnphQ,15253
10
- reydb/rlog.py,sha256=uB7k_JBTxDPzas9cmsR3-nmjFBq7l3N4xEEbACj73i4,9797
10
+ reydb/rlog.py,sha256=EpKPIjI_cAmXzFUs3D8ZC-JUylAPodm9LfXqRiLGEG0,9916
11
11
  reydb/rparam.py,sha256=3BGDBD8QshOf2J70ZJ6LJ9PiH-1ZU3ruZwoE0bN6OOw,7017
12
- reydb-1.1.31.dist-info/METADATA,sha256=RAnCVfzN3wJjpC9kG5n5R2i809DxqslcFvAhTBryJjc,1550
13
- reydb-1.1.31.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- reydb-1.1.31.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
15
- reydb-1.1.31.dist-info/RECORD,,
12
+ reydb-1.1.33.dist-info/METADATA,sha256=AW2-MON8LlkmeGeY5zCbAOLtGtMhHYDjcca_Ak5msls,1550
13
+ reydb-1.1.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ reydb-1.1.33.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
15
+ reydb-1.1.33.dist-info/RECORD,,
File without changes