moat-lib-path 0.3.5__tar.gz → 0.3.6__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.
- {moat_lib_path-0.3.5/src/moat_lib_path.egg-info → moat_lib_path-0.3.6}/PKG-INFO +1 -1
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/debian/changelog +6 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/pyproject.toml +1 -1
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/src/moat/lib/path/_impl.py +17 -17
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6/src/moat_lib_path.egg-info}/PKG-INFO +1 -1
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/LICENSE.txt +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/Makefile +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/README.md +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/debian/.gitignore +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/debian/control +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/debian/rules +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/setup.cfg +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/src/moat/lib/path/__init__.py +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/src/moat_lib_path.egg-info/SOURCES.txt +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/src/moat_lib_path.egg-info/dependency_links.txt +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/src/moat_lib_path.egg-info/requires.txt +0 -0
- {moat_lib_path-0.3.5 → moat_lib_path-0.3.6}/src/moat_lib_path.egg-info/top_level.txt +0 -0
|
@@ -22,7 +22,7 @@ name = "moat-lib-path"
|
|
|
22
22
|
maintainers = [{email = "matthias@urlichs.de",name = "Matthias Urlichs"}]
|
|
23
23
|
description='Hierarchical path representation and manipulation for MoaT'
|
|
24
24
|
readme = "README.md"
|
|
25
|
-
version = "0.3.
|
|
25
|
+
version = "0.3.6"
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
28
28
|
homepage = "https://m-o-a-t.org"
|
|
@@ -53,11 +53,11 @@ from collections.abc import Sequence
|
|
|
53
53
|
from typing import TYPE_CHECKING, Literal, TypeAlias, cast, overload
|
|
54
54
|
|
|
55
55
|
if TYPE_CHECKING:
|
|
56
|
-
from typing import Any
|
|
56
|
+
from typing import Any
|
|
57
57
|
|
|
58
58
|
PathTuple: TypeAlias = tuple["PathElem", ...]
|
|
59
|
-
PathElem: TypeAlias =
|
|
60
|
-
PathElemI: TypeAlias =
|
|
59
|
+
PathElem: TypeAlias = bool | int | float | str | bytes | PathTuple | None
|
|
60
|
+
PathElemI: TypeAlias = bool | int | float | str | bytes | tuple | None
|
|
61
61
|
|
|
62
62
|
__all__ = [
|
|
63
63
|
"PS",
|
|
@@ -78,7 +78,7 @@ _PartRE = re.compile("[^:._]+|_|:|\\.")
|
|
|
78
78
|
_RTagRE = re.compile("^:m[^:._]+:$")
|
|
79
79
|
|
|
80
80
|
|
|
81
|
-
def set_root(cfg):
|
|
81
|
+
def set_root(cfg) -> None:
|
|
82
82
|
"""
|
|
83
83
|
Utility to force-set the root global.
|
|
84
84
|
|
|
@@ -176,7 +176,7 @@ class Path(Sequence[PathElem]):
|
|
|
176
176
|
prefix: RootPath | Literal[True] | None = None,
|
|
177
177
|
decoded: bool = False,
|
|
178
178
|
_warn: bool = True,
|
|
179
|
-
):
|
|
179
|
+
) -> None:
|
|
180
180
|
"""
|
|
181
181
|
Create a path from the given elements.
|
|
182
182
|
|
|
@@ -609,10 +609,10 @@ class Path(Sequence[PathElem]):
|
|
|
609
609
|
|
|
610
610
|
# TODO add alternate output with hex integers
|
|
611
611
|
|
|
612
|
-
def __repr__(self):
|
|
612
|
+
def __repr__(self) -> str:
|
|
613
613
|
return f"P({str(self)!r})"
|
|
614
614
|
|
|
615
|
-
def __format__(self, spec):
|
|
615
|
+
def __format__(self, spec) -> str:
|
|
616
616
|
return str(self).__format__(spec)
|
|
617
617
|
|
|
618
618
|
@classmethod
|
|
@@ -650,7 +650,7 @@ class Path(Sequence[PathElem]):
|
|
|
650
650
|
raise SyntaxError(f"Conflicting tags: {mark} vs. {mp[0][2:-1]}")
|
|
651
651
|
return cls(mark=mark)
|
|
652
652
|
|
|
653
|
-
def add(x):
|
|
653
|
+
def add(x) -> None:
|
|
654
654
|
nonlocal part
|
|
655
655
|
if not isinstance(part, str):
|
|
656
656
|
part = ""
|
|
@@ -659,7 +659,7 @@ class Path(Sequence[PathElem]):
|
|
|
659
659
|
except TypeError:
|
|
660
660
|
raise SyntaxError(f"Cannot add {x!r} at {pos}") from None
|
|
661
661
|
|
|
662
|
-
def done(new_part):
|
|
662
|
+
def done(new_part) -> None:
|
|
663
663
|
nonlocal part
|
|
664
664
|
nonlocal eval_
|
|
665
665
|
if isinstance(part, str):
|
|
@@ -681,7 +681,7 @@ class Path(Sequence[PathElem]):
|
|
|
681
681
|
res.append(part)
|
|
682
682
|
part = new_part
|
|
683
683
|
|
|
684
|
-
def new(x):
|
|
684
|
+
def new(x) -> None:
|
|
685
685
|
nonlocal part
|
|
686
686
|
if part is None:
|
|
687
687
|
raise SyntaxError(f"Cannot use {part!r} at {pos}")
|
|
@@ -1066,7 +1066,7 @@ class PathShortener:
|
|
|
1066
1066
|
Caution: this shortener ignores path marks.
|
|
1067
1067
|
"""
|
|
1068
1068
|
|
|
1069
|
-
def __init__(self, prefix: Path | list | tuple = Path()):
|
|
1069
|
+
def __init__(self, prefix: Path | list | tuple = Path()) -> None:
|
|
1070
1070
|
self.prefix = prefix if isinstance(prefix, Path) else Path.build(prefix)
|
|
1071
1071
|
self.depth = len(prefix)
|
|
1072
1072
|
self.path = []
|
|
@@ -1113,7 +1113,7 @@ class PathLongener:
|
|
|
1113
1113
|
|
|
1114
1114
|
cls: type[Path] = Path
|
|
1115
1115
|
|
|
1116
|
-
def __init__(self, prefix: Path | PathTuple = ()):
|
|
1116
|
+
def __init__(self, prefix: Path | PathTuple = ()) -> None:
|
|
1117
1117
|
if isinstance(prefix, Path):
|
|
1118
1118
|
self.cls = type(prefix)
|
|
1119
1119
|
prefix = prefix.raw
|
|
@@ -1181,7 +1181,7 @@ class Var:
|
|
|
1181
1181
|
This mimics a ContextVar but without the context.
|
|
1182
1182
|
"""
|
|
1183
1183
|
|
|
1184
|
-
def __init__(self, name, default=NotGiven):
|
|
1184
|
+
def __init__(self, name, default=NotGiven) -> None:
|
|
1185
1185
|
self.name = name
|
|
1186
1186
|
self.default = default
|
|
1187
1187
|
self.data = NotGiven
|
|
@@ -1221,11 +1221,11 @@ class Var:
|
|
|
1221
1221
|
self.data = val
|
|
1222
1222
|
return _VAR_SET_TOKEN
|
|
1223
1223
|
|
|
1224
|
-
def __bool__(self):
|
|
1224
|
+
def __bool__(self) -> bool:
|
|
1225
1225
|
"check if value is set"
|
|
1226
1226
|
return self.data is not NotGiven
|
|
1227
1227
|
|
|
1228
|
-
def reset(self, token):
|
|
1228
|
+
def reset(self, token) -> None:
|
|
1229
1229
|
"reset value; no-op"
|
|
1230
1230
|
if token is not _VAR_SET_TOKEN:
|
|
1231
1231
|
raise ValueError(token)
|
|
@@ -1244,11 +1244,11 @@ class RootPath(Path):
|
|
|
1244
1244
|
|
|
1245
1245
|
_mark = ""
|
|
1246
1246
|
|
|
1247
|
-
def __init__(self, key: str, var: ContextVar[Path | None] | Var):
|
|
1247
|
+
def __init__(self, key: str, var: ContextVar[Path | None] | Var) -> None:
|
|
1248
1248
|
self._key = key
|
|
1249
1249
|
self._var = var
|
|
1250
1250
|
|
|
1251
|
-
def __repr__(self):
|
|
1251
|
+
def __repr__(self) -> str:
|
|
1252
1252
|
return f"{self._key}={super().__repr__()}"
|
|
1253
1253
|
|
|
1254
1254
|
@property
|
|
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
|