v440 2.0.0.dev170__tar.gz → 2.0.0.dev172__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.dev170/src/v440.egg-info → v440-2.0.0.dev172}/PKG-INFO +1 -1
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/pyproject.toml +1 -1
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/QualStringer.py +33 -2
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Pre.py +4 -28
- {v440-2.0.0.dev170 → v440-2.0.0.dev172/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/LICENSE.txt +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/MANIFEST.in +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/README.rst +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/setup.cfg +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/deleting.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/getting.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/listing.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/numerals.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/ranging.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/_utils/releaseparse/setting.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/tests/test_testdata.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev170 → v440-2.0.0.dev172}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import operator
|
|
2
|
+
import string as string_
|
|
2
3
|
from abc import abstractmethod
|
|
3
4
|
from typing import *
|
|
4
5
|
|
|
@@ -7,6 +8,7 @@ from datarepr import datarepr
|
|
|
7
8
|
from overloadable import Overloadable
|
|
8
9
|
|
|
9
10
|
from v440._utils.BaseStringer import BaseStringer
|
|
11
|
+
from v440._utils.Cfg import Cfg
|
|
10
12
|
from v440._utils.guarding import guard
|
|
11
13
|
|
|
12
14
|
__all__ = ["QualStringer"]
|
|
@@ -73,8 +75,31 @@ class QualStringer(BaseStringer):
|
|
|
73
75
|
@abstractmethod
|
|
74
76
|
def _num_fset(self: Self, value: int) -> None: ...
|
|
75
77
|
|
|
78
|
+
@classmethod
|
|
76
79
|
@abstractmethod
|
|
77
|
-
def
|
|
80
|
+
def _phasedict(cls: type) -> dict: ...
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def _string_parse_common(cls: type, value: str) -> tuple:
|
|
84
|
+
y: str = value.lower()
|
|
85
|
+
y = y.replace("_", ".")
|
|
86
|
+
y = y.replace("-", ".")
|
|
87
|
+
x: str = y.rstrip(string_.digits)
|
|
88
|
+
y = y[len(x) :]
|
|
89
|
+
if x.endswith("."):
|
|
90
|
+
x = x[:-1]
|
|
91
|
+
if not y:
|
|
92
|
+
raise ValueError
|
|
93
|
+
if x.startswith("."):
|
|
94
|
+
x = x[1:]
|
|
95
|
+
if not x:
|
|
96
|
+
raise ValueError
|
|
97
|
+
if x:
|
|
98
|
+
return cls._phasedict()[x], int("0" + y)
|
|
99
|
+
elif y:
|
|
100
|
+
raise ValueError
|
|
101
|
+
else:
|
|
102
|
+
return "", 0
|
|
78
103
|
|
|
79
104
|
@property
|
|
80
105
|
def num(self: Self) -> int:
|
|
@@ -92,4 +117,10 @@ class QualStringer(BaseStringer):
|
|
|
92
117
|
@phase.setter
|
|
93
118
|
@guard
|
|
94
119
|
def phase(self: Self, value: Any) -> None:
|
|
95
|
-
|
|
120
|
+
v: str = str(value).lower()
|
|
121
|
+
if v:
|
|
122
|
+
self._phase = self._phasedict()[v]
|
|
123
|
+
elif self.num:
|
|
124
|
+
self.string = str(self.num)
|
|
125
|
+
else:
|
|
126
|
+
self._phase = ""
|
|
@@ -39,33 +39,9 @@ class Pre(QualStringer):
|
|
|
39
39
|
raise ValueError
|
|
40
40
|
self.string = self.phase + str(value)
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
elif self.num:
|
|
46
|
-
self.string = str(self.num)
|
|
47
|
-
else:
|
|
48
|
-
self._phase = ""
|
|
42
|
+
@classmethod
|
|
43
|
+
def _phasedict(cls: type) -> dict:
|
|
44
|
+
return Cfg.cfg.data["pre"]
|
|
49
45
|
|
|
50
46
|
def _string_fset(self: Self, value: str) -> None:
|
|
51
|
-
|
|
52
|
-
v = v.replace("_", ".")
|
|
53
|
-
v = v.replace("-", ".")
|
|
54
|
-
x: str = v.rstrip(string_.digits)
|
|
55
|
-
v = v[len(x) :]
|
|
56
|
-
q: bool = x.endswith(".")
|
|
57
|
-
if q:
|
|
58
|
-
if not v:
|
|
59
|
-
raise ValueError
|
|
60
|
-
x = x[:-1]
|
|
61
|
-
p: bool = x.startswith(".")
|
|
62
|
-
if p:
|
|
63
|
-
x = x[1:]
|
|
64
|
-
if x:
|
|
65
|
-
self._phase = Cfg.cfg.data["pre"][x]
|
|
66
|
-
self._num = int("0" + v)
|
|
67
|
-
elif p or v:
|
|
68
|
-
raise ValueError
|
|
69
|
-
else:
|
|
70
|
-
self._phase = ""
|
|
71
|
-
self._num = 0
|
|
47
|
+
self._phase, self._num = self._string_parse_common(value)
|
|
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
|
|
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
|