v440 2.0.0.dev63__tar.gz → 2.0.0.dev64__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.
- {v440-2.0.0.dev63/src/v440.egg-info → v440-2.0.0.dev64}/PKG-INFO +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/pyproject.toml +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/BaseList.py +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/VList.py +1 -1
- v440-2.0.0.dev64/src/v440/_utils/guarding.py +25 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/utils.py +0 -19
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/Base.py +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/Local.py +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/Qual.py +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/Release.py +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/Version.py +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440.egg-info/SOURCES.txt +1 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/LICENSE.txt +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/MANIFEST.in +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/README.rst +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/setup.cfg +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/Digest.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/SlotList.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/_utils/qualparse.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/tests/test_testdata.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev63 → v440-2.0.0.dev64}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
from typing import *
|
|
5
|
+
|
|
6
|
+
from v440.core.VersionError import VersionError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def guard(old: Any) -> Any:
|
|
10
|
+
@functools.wraps(old)
|
|
11
|
+
def new(self: Self, value: Any) -> None:
|
|
12
|
+
backup: str = str(getattr(self, old.__name__))
|
|
13
|
+
try:
|
|
14
|
+
old(self, value)
|
|
15
|
+
except VersionError:
|
|
16
|
+
setattr(self, old.__name__, backup)
|
|
17
|
+
raise
|
|
18
|
+
except Exception:
|
|
19
|
+
setattr(self, old.__name__, backup)
|
|
20
|
+
msg: str = "%r is an invalid value for %r"
|
|
21
|
+
target: str = type(self).__name__ + "." + old.__name__
|
|
22
|
+
msg %= (value, target)
|
|
23
|
+
raise VersionError(msg)
|
|
24
|
+
|
|
25
|
+
return new
|
|
@@ -60,22 +60,3 @@ def _segment(value: Any, /) -> int | str:
|
|
|
60
60
|
return 0
|
|
61
61
|
else:
|
|
62
62
|
return int(value)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def guard(old: Any) -> Any:
|
|
66
|
-
@functools.wraps(old)
|
|
67
|
-
def new(self: Self, value: Any) -> None:
|
|
68
|
-
backup: str = str(getattr(self, old.__name__))
|
|
69
|
-
try:
|
|
70
|
-
old(self, value)
|
|
71
|
-
except VersionError:
|
|
72
|
-
setattr(self, old.__name__, backup)
|
|
73
|
-
raise
|
|
74
|
-
except Exception:
|
|
75
|
-
setattr(self, old.__name__, backup)
|
|
76
|
-
msg: str = "%r is an invalid value for %r"
|
|
77
|
-
target: str = type(self).__name__ + "." + old.__name__
|
|
78
|
-
msg %= (value, target)
|
|
79
|
-
raise VersionError(msg)
|
|
80
|
-
|
|
81
|
-
return new
|
|
@@ -6,8 +6,8 @@ import setdoc
|
|
|
6
6
|
from overloadable import Overloadable
|
|
7
7
|
|
|
8
8
|
from v440._utils.Digest import Digest
|
|
9
|
+
from v440._utils.guarding import guard
|
|
9
10
|
from v440._utils.SlotList import SlotList
|
|
10
|
-
from v440._utils.utils import guard
|
|
11
11
|
from v440.core.Release import Release
|
|
12
12
|
|
|
13
13
|
__all__ = ["Base"]
|
|
@@ -6,9 +6,9 @@ import setdoc
|
|
|
6
6
|
from overloadable import Overloadable
|
|
7
7
|
|
|
8
8
|
from v440._utils import qualparse
|
|
9
|
+
from v440._utils.guarding import guard
|
|
9
10
|
from v440._utils.Pattern import Pattern
|
|
10
11
|
from v440._utils.SlotList import SlotList
|
|
11
|
-
from v440._utils.utils import guard
|
|
12
12
|
|
|
13
13
|
__all__ = ["Qual"]
|
|
14
14
|
|
|
@@ -6,8 +6,8 @@ import packaging.version
|
|
|
6
6
|
import setdoc
|
|
7
7
|
from overloadable import Overloadable
|
|
8
8
|
|
|
9
|
+
from v440._utils.guarding import guard
|
|
9
10
|
from v440._utils.SlotList import SlotList
|
|
10
|
-
from v440._utils.utils import guard
|
|
11
11
|
from v440.core.Local import Local
|
|
12
12
|
from v440.core.Public import Public
|
|
13
13
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|