catchlib 0.0.1__tar.gz → 1.0.1__tar.gz
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.
- {catchlib-0.0.1/src/catchlib.egg-info → catchlib-1.0.1}/PKG-INFO +3 -2
- {catchlib-0.0.1 → catchlib-1.0.1}/pyproject.toml +5 -3
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib/core/__init__.py +23 -0
- {catchlib-0.0.1 → catchlib-1.0.1/src/catchlib.egg-info}/PKG-INFO +3 -2
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib.egg-info/SOURCES.txt +1 -0
- catchlib-1.0.1/src/catchlib.egg-info/requires.txt +1 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/LICENSE.txt +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/MANIFEST.in +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/README.rst +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/setup.cfg +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib/__init__.py +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib/tests/__init__.py +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib/tests/test_0.py +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib.egg-info/dependency_links.txt +0 -0
- {catchlib-0.0.1 → catchlib-1.0.1}/src/catchlib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: catchlib
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: This project allows to catch exceptions easily.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/catchlib/#files
|
|
|
28
28
|
Project-URL: Index, https://pypi.org/project/catchlib/
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/catchlib/
|
|
30
30
|
Project-URL: Website, https://catchlib.johannes-programming.online/
|
|
31
|
-
Classifier: Development Status ::
|
|
31
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
32
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
@@ -39,6 +39,7 @@ Classifier: Typing :: Typed
|
|
|
39
39
|
Requires-Python: >=3.11
|
|
40
40
|
Description-Content-Type: text/x-rst
|
|
41
41
|
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: overloadable<2,>=1.0.9
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
========
|
|
@@ -9,7 +9,7 @@ authors = [
|
|
|
9
9
|
{ email = "johannes.programming@gmail.com", name = "Johannes" },
|
|
10
10
|
]
|
|
11
11
|
classifiers = [
|
|
12
|
-
"Development Status ::
|
|
12
|
+
"Development Status :: 5 - Production/Stable",
|
|
13
13
|
"License :: OSI Approved :: MIT License",
|
|
14
14
|
"Natural Language :: English",
|
|
15
15
|
"Operating System :: OS Independent",
|
|
@@ -18,13 +18,15 @@ classifiers = [
|
|
|
18
18
|
"Programming Language :: Python :: 3 :: Only",
|
|
19
19
|
"Typing :: Typed",
|
|
20
20
|
]
|
|
21
|
-
dependencies = [
|
|
21
|
+
dependencies = [
|
|
22
|
+
"overloadable>=1.0.9,<2",
|
|
23
|
+
]
|
|
22
24
|
description = "This project allows to catch exceptions easily."
|
|
23
25
|
keywords = []
|
|
24
26
|
name = "catchlib"
|
|
25
27
|
readme = "README.rst"
|
|
26
28
|
requires-python = ">=3.11"
|
|
27
|
-
version = "
|
|
29
|
+
version = "1.0.1"
|
|
28
30
|
|
|
29
31
|
[project.license]
|
|
30
32
|
file = "LICENSE.txt"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from contextlib import contextmanager
|
|
2
2
|
from typing import *
|
|
3
3
|
|
|
4
|
+
from overloadable import Overloadable
|
|
5
|
+
|
|
4
6
|
__all__ = ["Catcher"]
|
|
5
7
|
|
|
6
8
|
|
|
@@ -30,3 +32,24 @@ class Catcher:
|
|
|
30
32
|
def caught(self: Self) -> Optional[BaseException]:
|
|
31
33
|
"This property stores the caught exception."
|
|
32
34
|
return self._caught
|
|
35
|
+
|
|
36
|
+
@Overloadable
|
|
37
|
+
def release(self: Self, *args: Any, **kwargs: Any) -> bool:
|
|
38
|
+
"This method raises the caught exception."
|
|
39
|
+
return bool(len(args) + len(kwargs))
|
|
40
|
+
|
|
41
|
+
@release.overload(False)
|
|
42
|
+
def release(self: Self) -> None:
|
|
43
|
+
"This method raises the caught exception."
|
|
44
|
+
exc: BaseException = self.caught
|
|
45
|
+
self._caught = None
|
|
46
|
+
if exc is not None:
|
|
47
|
+
raise exc
|
|
48
|
+
|
|
49
|
+
@release.overload(True)
|
|
50
|
+
def release(self: Self, cause: Optional[BaseException]) -> None:
|
|
51
|
+
"This method raises the caught exception."
|
|
52
|
+
exc: BaseException = self.caught
|
|
53
|
+
self._caught = None
|
|
54
|
+
if exc is not None:
|
|
55
|
+
raise exc from cause
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: catchlib
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: This project allows to catch exceptions easily.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/catchlib/#files
|
|
|
28
28
|
Project-URL: Index, https://pypi.org/project/catchlib/
|
|
29
29
|
Project-URL: Source, https://github.com/johannes-programming/catchlib/
|
|
30
30
|
Project-URL: Website, https://catchlib.johannes-programming.online/
|
|
31
|
-
Classifier: Development Status ::
|
|
31
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
32
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
33
33
|
Classifier: Natural Language :: English
|
|
34
34
|
Classifier: Operating System :: OS Independent
|
|
@@ -39,6 +39,7 @@ Classifier: Typing :: Typed
|
|
|
39
39
|
Requires-Python: >=3.11
|
|
40
40
|
Description-Content-Type: text/x-rst
|
|
41
41
|
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: overloadable<2,>=1.0.9
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
========
|
|
@@ -7,6 +7,7 @@ src/catchlib/__init__.py
|
|
|
7
7
|
src/catchlib.egg-info/PKG-INFO
|
|
8
8
|
src/catchlib.egg-info/SOURCES.txt
|
|
9
9
|
src/catchlib.egg-info/dependency_links.txt
|
|
10
|
+
src/catchlib.egg-info/requires.txt
|
|
10
11
|
src/catchlib.egg-info/top_level.txt
|
|
11
12
|
src/catchlib/core/__init__.py
|
|
12
13
|
src/catchlib/tests/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
overloadable<2,>=1.0.9
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|