omlish 0.0.0.dev406__py3-none-any.whl → 0.0.0.dev407__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.
- omlish/.manifests.json +2 -2
- omlish/__about__.py +2 -2
- omlish/asyncs/anyio/sync.py +3 -0
- omlish/asyncs/bluelet/runner.py +1 -0
- omlish/asyncs/bluelet/sockets.py +2 -0
- omlish/asyncs/sync.py +1 -0
- omlish/bootstrap/base.py +2 -0
- omlish/bootstrap/harness.py +1 -0
- omlish/codecs/text.py +1 -0
- omlish/collections/frozen.py +1 -0
- omlish/collections/mappings.py +2 -0
- omlish/collections/ordered.py +1 -0
- omlish/collections/sorted/sorted.py +1 -0
- omlish/collections/trie.py +2 -2
- omlish/concurrent/executors.py +1 -0
- omlish/dataclasses/tools/modifiers.py +1 -0
- omlish/diag/threads.py +1 -0
- omlish/formats/dotenv.py +5 -0
- omlish/formats/props.py +1 -0
- omlish/formats/toml/writer.py +1 -0
- omlish/formats/yaml.py +1 -0
- omlish/funcs/pipes.py +3 -0
- omlish/graphs/trees.py +1 -0
- omlish/http/jwt.py +2 -0
- omlish/http/multipart.py +1 -0
- omlish/inject/impl/injector.py +1 -0
- omlish/io/buffers.py +2 -0
- omlish/iterators/unique.py +1 -0
- omlish/lang/classes/restrict.py +1 -0
- omlish/lang/classes/simple.py +1 -0
- omlish/lang/contextmanagers.py +1 -0
- omlish/lang/descriptors.py +2 -0
- omlish/lang/objects.py +2 -0
- omlish/lang/resolving.py +1 -0
- omlish/lifecycles/contextmanagers.py +1 -0
- omlish/lite/cached.py +1 -0
- omlish/lite/inject.py +2 -0
- omlish/lite/secrets.py +1 -0
- omlish/logs/handlers.py +1 -0
- omlish/marshal/factories.py +2 -0
- omlish/marshal/polymorphism/metadata.py +2 -0
- omlish/marshal/registries.py +1 -0
- omlish/multiprocessing/spawn.py +3 -0
- omlish/secrets/openssl.py +2 -0
- omlish/secrets/secrets.py +5 -0
- omlish/specs/jmespath/errors.py +4 -0
- omlish/specs/jmespath/visitor.py +2 -0
- omlish/specs/jsonschema/keywords/base.py +1 -0
- omlish/sql/alchemy/apiadapter.py +1 -0
- omlish/sql/alchemy/asyncs.py +3 -0
- omlish/sql/alchemy/duckdb.py +2 -0
- omlish/sql/api/dbapi.py +2 -0
- omlish/sql/params.py +3 -0
- omlish/sql/queries/names.py +1 -0
- omlish/sync.py +3 -0
- omlish/testing/pytest/inject/harness.py +4 -2
- omlish/text/asdl.py +3 -0
- {omlish-0.0.0.dev406.dist-info → omlish-0.0.0.dev407.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev406.dist-info → omlish-0.0.0.dev407.dist-info}/RECORD +63 -63
- {omlish-0.0.0.dev406.dist-info → omlish-0.0.0.dev407.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev406.dist-info → omlish-0.0.0.dev407.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev406.dist-info → omlish-0.0.0.dev407.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev406.dist-info → omlish-0.0.0.dev407.dist-info}/top_level.txt +0 -0
omlish/.manifests.json
CHANGED
@@ -181,7 +181,7 @@
|
|
181
181
|
"module": ".formats.yaml",
|
182
182
|
"attr": "_YAML_LAZY_CODEC",
|
183
183
|
"file": "omlish/formats/yaml.py",
|
184
|
-
"line":
|
184
|
+
"line": 256,
|
185
185
|
"value": {
|
186
186
|
"!.codecs.base.LazyLoadedCodec": {
|
187
187
|
"module": "omlish.formats.yaml",
|
@@ -197,7 +197,7 @@
|
|
197
197
|
"module": ".formats.yaml",
|
198
198
|
"attr": "_YAML_UNSAFE_LAZY_CODEC",
|
199
199
|
"file": "omlish/formats/yaml.py",
|
200
|
-
"line":
|
200
|
+
"line": 263,
|
201
201
|
"value": {
|
202
202
|
"!.codecs.base.LazyLoadedCodec": {
|
203
203
|
"module": "omlish.formats.yaml",
|
omlish/__about__.py
CHANGED
omlish/asyncs/anyio/sync.py
CHANGED
@@ -14,6 +14,7 @@ T = ta.TypeVar('T')
|
|
14
14
|
class Once:
|
15
15
|
def __init__(self) -> None:
|
16
16
|
super().__init__()
|
17
|
+
|
17
18
|
self._done = False
|
18
19
|
self._lock = anyio.Lock()
|
19
20
|
|
@@ -36,6 +37,7 @@ class Once:
|
|
36
37
|
class Lazy(ta.Generic[T]):
|
37
38
|
def __init__(self) -> None:
|
38
39
|
super().__init__()
|
40
|
+
|
39
41
|
self._once = Once()
|
40
42
|
self._v: lang.Maybe[T] = lang.empty()
|
41
43
|
|
@@ -55,6 +57,7 @@ class Lazy(ta.Generic[T]):
|
|
55
57
|
class LazyFn(ta.Generic[T]):
|
56
58
|
def __init__(self, fn: ta.Callable[[], ta.Awaitable[T]]) -> None:
|
57
59
|
super().__init__()
|
60
|
+
|
58
61
|
self._fn = fn
|
59
62
|
self._once = Once()
|
60
63
|
self._v: lang.Maybe[T] = lang.empty()
|
omlish/asyncs/bluelet/runner.py
CHANGED
omlish/asyncs/bluelet/sockets.py
CHANGED
@@ -33,6 +33,7 @@ class BlueletListener:
|
|
33
33
|
"""Create a listening socket on the given hostname and port."""
|
34
34
|
|
35
35
|
super().__init__()
|
36
|
+
|
36
37
|
self._closed = False
|
37
38
|
self.host = host
|
38
39
|
self.port = port
|
@@ -64,6 +65,7 @@ class BlueletConnection:
|
|
64
65
|
|
65
66
|
def __init__(self, sock: socket.socket, addr: ta.Tuple[str, int]) -> None:
|
66
67
|
super().__init__()
|
68
|
+
|
67
69
|
self.sock = sock
|
68
70
|
self.addr = addr
|
69
71
|
self._buf = bytearray()
|
omlish/asyncs/sync.py
CHANGED
omlish/bootstrap/base.py
CHANGED
@@ -18,10 +18,12 @@ class Bootstrap(abc.ABC, lang.PackageSealed, ta.Generic[BootstrapConfigT]):
|
|
18
18
|
|
19
19
|
def __init__(self, config: BootstrapConfigT) -> None:
|
20
20
|
super().__init__()
|
21
|
+
|
21
22
|
self._config = config
|
22
23
|
|
23
24
|
def __init_subclass__(cls, **kwargs: ta.Any) -> None:
|
24
25
|
super().__init_subclass__(**kwargs)
|
26
|
+
|
25
27
|
if not cls.__name__.endswith('Bootstrap'):
|
26
28
|
raise NameError(cls)
|
27
29
|
if abc.ABC not in cls.__bases__ and not issubclass(cls.__dict__['Config'], Bootstrap.Config):
|
omlish/bootstrap/harness.py
CHANGED
omlish/codecs/text.py
CHANGED
@@ -69,6 +69,7 @@ class TextEncodingComboCodec(ComboCodec[str, bytes]):
|
|
69
69
|
options: TextEncodingOptions = TextEncodingOptions(),
|
70
70
|
) -> None:
|
71
71
|
super().__init__()
|
72
|
+
|
72
73
|
self._info = check.isinstance(info, codecs.CodecInfo)
|
73
74
|
self._opts = check.isinstance(options, TextEncodingOptions)
|
74
75
|
|
omlish/collections/frozen.py
CHANGED
omlish/collections/mappings.py
CHANGED
@@ -130,7 +130,9 @@ class MissingDict(dict[K, V]):
|
|
130
130
|
def __init__(self, missing_fn: ta.Callable[[K], V]) -> None:
|
131
131
|
if not callable(missing_fn):
|
132
132
|
raise TypeError(missing_fn)
|
133
|
+
|
133
134
|
super().__init__()
|
135
|
+
|
134
136
|
self._missing_fn = missing_fn
|
135
137
|
|
136
138
|
def __missing__(self, key):
|
omlish/collections/ordered.py
CHANGED
omlish/collections/trie.py
CHANGED
@@ -144,7 +144,7 @@ class Trie(ta.MutableMapping[ta.Sequence[K], V], ta.Generic[K, V]):
|
|
144
144
|
stack.append((c, ic(c._children))) # noqa
|
145
145
|
yield (key if share_key else tuple(key), c)
|
146
146
|
|
147
|
-
def
|
147
|
+
def iteritems(self, **kwargs: ta.Any) -> ta.Iterator[tuple[ta.Sequence[K], V]]:
|
148
148
|
for k, node in self.iter_nodes(**kwargs):
|
149
149
|
try:
|
150
150
|
yield (k, node._value) # noqa
|
@@ -152,5 +152,5 @@ class Trie(ta.MutableMapping[ta.Sequence[K], V], ta.Generic[K, V]):
|
|
152
152
|
pass
|
153
153
|
|
154
154
|
def __iter__(self) -> ta.Iterator[ta.Sequence[K]]:
|
155
|
-
for k, _ in self.
|
155
|
+
for k, _ in self.iteritems():
|
156
156
|
yield k
|
omlish/concurrent/executors.py
CHANGED
omlish/diag/threads.py
CHANGED
omlish/formats/dotenv.py
CHANGED
@@ -66,6 +66,7 @@ class DotenvAtom(metaclass=abc.ABCMeta):
|
|
66
66
|
class DotenvLiteral(DotenvAtom):
|
67
67
|
def __init__(self, value: str) -> None:
|
68
68
|
super().__init__()
|
69
|
+
|
69
70
|
self.value = value
|
70
71
|
|
71
72
|
def __repr__(self) -> str:
|
@@ -86,6 +87,7 @@ class DotenvLiteral(DotenvAtom):
|
|
86
87
|
class DotenvVariable(DotenvAtom):
|
87
88
|
def __init__(self, name: str, default: ta.Optional[str]) -> None:
|
88
89
|
super().__init__()
|
90
|
+
|
89
91
|
self.name = name
|
90
92
|
self.default = default
|
91
93
|
|
@@ -164,6 +166,7 @@ class DotenvBinding(ta.NamedTuple):
|
|
164
166
|
class _DotenvPosition:
|
165
167
|
def __init__(self, chars: int, line: int) -> None:
|
166
168
|
super().__init__()
|
169
|
+
|
167
170
|
self.chars = chars
|
168
171
|
self.line = line
|
169
172
|
|
@@ -187,6 +190,7 @@ class DotenvError(Exception):
|
|
187
190
|
class _DotenvReader:
|
188
191
|
def __init__(self, stream: ta.IO[str]) -> None:
|
189
192
|
super().__init__()
|
193
|
+
|
190
194
|
self.string = stream.read()
|
191
195
|
self.position = _DotenvPosition.start()
|
192
196
|
self.mark = _DotenvPosition.start()
|
@@ -334,6 +338,7 @@ class Dotenv:
|
|
334
338
|
log: ta.Optional[logging.Logger] = None,
|
335
339
|
) -> None:
|
336
340
|
super().__init__()
|
341
|
+
|
337
342
|
self.path: ta.Union[str, 'os.PathLike[str]', None] = path
|
338
343
|
self.stream: ta.Optional[ta.IO[str]] = stream
|
339
344
|
self._dict: ta.Optional[ta.Dict[str, ta.Optional[str]]] = None
|
omlish/formats/props.py
CHANGED
@@ -129,6 +129,7 @@ class PropertyError(Exception):
|
|
129
129
|
class ParseError(PropertyError):
|
130
130
|
def __init__(self, message: str, line_number: int, file_obj: ta.Any = None) -> None:
|
131
131
|
super().__init__()
|
132
|
+
|
132
133
|
self.message = message
|
133
134
|
self.line_number = line_number
|
134
135
|
self.file_obj = file_obj
|
omlish/formats/toml/writer.py
CHANGED
omlish/formats/yaml.py
CHANGED
omlish/funcs/pipes.py
CHANGED
@@ -39,6 +39,7 @@ class Fn(abc.ABC, ta.Generic[T]):
|
|
39
39
|
class Bind(Fn[T]):
|
40
40
|
def __init__(self, fn: ta.Callable[..., T], *args: ta.Any, **kwargs: ta.Any) -> None:
|
41
41
|
super().__init__()
|
42
|
+
|
42
43
|
if Ellipsis not in args and Ellipsis not in kwargs:
|
43
44
|
args += (Ellipsis,)
|
44
45
|
self._fn = fn
|
@@ -75,6 +76,7 @@ bind = Bind
|
|
75
76
|
class Pipe(Fn[T]):
|
76
77
|
def __init__(self, lfns: ta.Sequence[ta.Callable], rfn: ta.Callable[..., T]) -> None:
|
77
78
|
super().__init__()
|
79
|
+
|
78
80
|
self._lfn, *self._rfns = [*lfns, rfn]
|
79
81
|
|
80
82
|
def __call__(self, *args: ta.Any, **kwargs: ta.Any) -> T:
|
@@ -95,6 +97,7 @@ def pipe(*fns: ta.Callable) -> Pipe:
|
|
95
97
|
class Apply(Fn[T]):
|
96
98
|
def __init__(self, *fns: ta.Callable[[T], ta.Any]) -> None:
|
97
99
|
super().__init__()
|
100
|
+
|
98
101
|
self._fns = fns
|
99
102
|
|
100
103
|
def __call__(self, o: T) -> T: # noqa
|
omlish/graphs/trees.py
CHANGED
omlish/http/jwt.py
CHANGED
@@ -52,6 +52,7 @@ class Algorithm(abc.ABC):
|
|
52
52
|
class HmacAlgorithm(Algorithm):
|
53
53
|
def __init__(self, name: str, digest: ta.Any) -> None:
|
54
54
|
super().__init__()
|
55
|
+
|
55
56
|
self._name = name
|
56
57
|
self._digest = digest
|
57
58
|
|
@@ -69,6 +70,7 @@ class HmacAlgorithm(Algorithm):
|
|
69
70
|
class RsaAlgorithm(Algorithm):
|
70
71
|
def __init__(self, name: str, digest: str) -> None:
|
71
72
|
super().__init__()
|
73
|
+
|
72
74
|
self._name = name
|
73
75
|
self._digest = digest
|
74
76
|
|
omlish/http/multipart.py
CHANGED
omlish/inject/impl/injector.py
CHANGED
@@ -111,6 +111,7 @@ class InjectorImpl(Injector, lang.Final):
|
|
111
111
|
class _Request:
|
112
112
|
def __init__(self, injector: 'InjectorImpl') -> None:
|
113
113
|
super().__init__()
|
114
|
+
|
114
115
|
self._injector = injector
|
115
116
|
self._provisions: dict[Key, lang.Maybe] = {}
|
116
117
|
self._seen_keys: set[Key] = set()
|
omlish/io/buffers.py
CHANGED
@@ -24,6 +24,7 @@ class DelimitingBuffer:
|
|
24
24
|
class Error(Exception):
|
25
25
|
def __init__(self, buffer: 'DelimitingBuffer') -> None:
|
26
26
|
super().__init__(buffer)
|
27
|
+
|
27
28
|
self.buffer = buffer
|
28
29
|
|
29
30
|
def __repr__(self) -> str:
|
@@ -179,6 +180,7 @@ class ReadableListBuffer:
|
|
179
180
|
|
180
181
|
def __init__(self) -> None:
|
181
182
|
super().__init__()
|
183
|
+
|
182
184
|
self._lst: list[bytes] = []
|
183
185
|
|
184
186
|
def __len__(self) -> int:
|
omlish/iterators/unique.py
CHANGED
omlish/lang/classes/restrict.py
CHANGED
omlish/lang/classes/simple.py
CHANGED
omlish/lang/contextmanagers.py
CHANGED
omlish/lang/descriptors.py
CHANGED
@@ -200,6 +200,7 @@ decorator = _decorator
|
|
200
200
|
class AccessForbiddenError(Exception):
|
201
201
|
def __init__(self, name: str | None = None, *args: ta.Any, **kwargs: ta.Any) -> None:
|
202
202
|
super().__init__(*((name,) if name is not None else ()), *args, **kwargs) # noqa
|
203
|
+
|
203
204
|
self.name = name
|
204
205
|
|
205
206
|
|
@@ -231,6 +232,7 @@ class _ClassOnly:
|
|
231
232
|
if not isinstance(mth, classmethod):
|
232
233
|
raise TypeError(f'must be classmethod: {mth}')
|
233
234
|
super().__init__()
|
235
|
+
|
234
236
|
self._mth = (mth,)
|
235
237
|
functools.update_wrapper(self, mth) # type: ignore
|
236
238
|
|
omlish/lang/objects.py
CHANGED
@@ -166,6 +166,7 @@ class SimpleProxy(ta.Generic[T]):
|
|
166
166
|
class Descriptor:
|
167
167
|
def __init__(self, attr: str) -> None:
|
168
168
|
super().__init__()
|
169
|
+
|
169
170
|
self._attr = attr
|
170
171
|
|
171
172
|
def __get__(self, instance, owner=None):
|
@@ -189,6 +190,7 @@ class SimpleProxy(ta.Generic[T]):
|
|
189
190
|
|
190
191
|
def __init__(self, wrapped: T) -> None:
|
191
192
|
super().__init__()
|
193
|
+
|
192
194
|
object.__setattr__(self, '__wrapped__', wrapped)
|
193
195
|
|
194
196
|
def __init_subclass__(cls, **kwargs: ta.Any) -> None:
|
omlish/lang/resolving.py
CHANGED
@@ -33,6 +33,7 @@ class ContextManagerLifecycle(Lifecycle, lang.Final, ta.Generic[ContextManagerT]
|
|
33
33
|
class LifecycleContextManager(ta.Generic[LifecycleT]):
|
34
34
|
def __init__(self, lifecycle: LifecycleT) -> None:
|
35
35
|
super().__init__()
|
36
|
+
|
36
37
|
self._lifecycle = lifecycle
|
37
38
|
self._controller = lifecycle if isinstance(lifecycle, LifecycleController) else LifecycleController(lifecycle)
|
38
39
|
|
omlish/lite/cached.py
CHANGED
omlish/lite/inject.py
CHANGED
@@ -402,6 +402,7 @@ class ContextvarInjectorScope(InjectorScope, abc.ABC):
|
|
402
402
|
|
403
403
|
def __init_subclass__(cls, **kwargs: ta.Any) -> None:
|
404
404
|
super().__init_subclass__(**kwargs)
|
405
|
+
|
405
406
|
check.not_in(abc.ABC, cls.__bases__)
|
406
407
|
check.state(not hasattr(cls, '_cv'))
|
407
408
|
cls._cv = contextvars.ContextVar(f'{cls.__name__}_cv')
|
@@ -676,6 +677,7 @@ class _Injector(Injector):
|
|
676
677
|
class _Request:
|
677
678
|
def __init__(self, injector: '_Injector') -> None:
|
678
679
|
super().__init__()
|
680
|
+
|
679
681
|
self._injector = injector
|
680
682
|
self._provisions: ta.Dict[InjectorKey, Maybe] = {}
|
681
683
|
self._seen_keys: ta.Set[InjectorKey] = set()
|
omlish/lite/secrets.py
CHANGED
omlish/logs/handlers.py
CHANGED
omlish/marshal/factories.py
CHANGED
@@ -41,6 +41,7 @@ class TypeMapFactory(mfs.MatchFn[[C, rfl.Type], R]):
|
|
41
41
|
class TypeCacheFactory(mfs.MatchFn[[C, rfl.Type], R]):
|
42
42
|
def __init__(self, f: mfs.MatchFn[[C, rfl.Type], R]) -> None:
|
43
43
|
super().__init__()
|
44
|
+
|
44
45
|
self._f = f
|
45
46
|
self._dct: dict[rfl.Type, R | None] = {}
|
46
47
|
self._mtx = threading.RLock()
|
@@ -90,6 +91,7 @@ class RecursiveTypeFactory(mfs.MatchFn[[C, rfl.Type], R]):
|
|
90
91
|
prx: ta.Callable[[], tuple[R, ta.Callable[[R], None]]],
|
91
92
|
) -> None:
|
92
93
|
super().__init__()
|
94
|
+
|
93
95
|
self._f = f
|
94
96
|
self._prx = prx
|
95
97
|
self._dct: dict[rfl.Type, R] = {}
|
@@ -39,6 +39,7 @@ class Impls(ta.Sequence[Impl]):
|
|
39
39
|
lst: ta.Iterable[Impl],
|
40
40
|
) -> None:
|
41
41
|
super().__init__()
|
42
|
+
|
42
43
|
self._lst = list(lst)
|
43
44
|
|
44
45
|
by_ty: dict[type, Impl] = {}
|
@@ -89,6 +90,7 @@ class Polymorphism:
|
|
89
90
|
impls: ta.Iterable[Impl],
|
90
91
|
) -> None:
|
91
92
|
super().__init__()
|
93
|
+
|
92
94
|
self._ty = ty
|
93
95
|
self._impls = Impls(impls)
|
94
96
|
|
omlish/marshal/registries.py
CHANGED
@@ -35,6 +35,7 @@ class _KeyRegistryItems:
|
|
35
35
|
class Registry:
|
36
36
|
def __init__(self) -> None:
|
37
37
|
super().__init__()
|
38
|
+
|
38
39
|
self._mtx = threading.Lock()
|
39
40
|
self._idct: ta.MutableMapping[ta.Any, _KeyRegistryItems] = col.IdentityKeyDict()
|
40
41
|
self._dct: dict[ta.Any, _KeyRegistryItems] = {}
|
omlish/multiprocessing/spawn.py
CHANGED
@@ -24,6 +24,7 @@ class ExtrasSpawnPosixPopen(mp.popen_spawn_posix.Popen):
|
|
24
24
|
def __init__(self, process_obj: 'ExtrasSpawnProcess', *, extras: SpawnExtras) -> None:
|
25
25
|
self.__extras = extras
|
26
26
|
self.__pass_fds = extras.pass_fds
|
27
|
+
|
27
28
|
super().__init__(process_obj)
|
28
29
|
|
29
30
|
def _launch(self, process_obj: 'ExtrasSpawnProcess') -> None:
|
@@ -38,6 +39,7 @@ class ExtrasSpawnPosixPopen(mp.popen_spawn_posix.Popen):
|
|
38
39
|
class ExtrasSpawnProcess(mp.context.SpawnProcess):
|
39
40
|
def __init__(self, *args: ta.Any, extras: SpawnExtras, **kwargs: ta.Any) -> None:
|
40
41
|
self.__extras = extras
|
42
|
+
|
41
43
|
super().__init__(*args, **kwargs)
|
42
44
|
|
43
45
|
def _Popen(self, process_obj: 'ExtrasSpawnProcess') -> ExtrasSpawnPosixPopen: # type: ignore # noqa
|
@@ -56,6 +58,7 @@ class ExtrasSpawnProcess(mp.context.SpawnProcess):
|
|
56
58
|
class ExtrasSpawnContext(mp.context.SpawnContext):
|
57
59
|
def __init__(self, extras: SpawnExtras = SpawnExtras()) -> None:
|
58
60
|
self.__extras = extras
|
61
|
+
|
59
62
|
super().__init__()
|
60
63
|
|
61
64
|
def Process(self, *args: ta.Any, **kwargs: ta.Any): # type: ignore # noqa
|
omlish/secrets/openssl.py
CHANGED
@@ -56,6 +56,7 @@ class OpensslAescbcCrypto(Crypto):
|
|
56
56
|
iters: int = 10_000,
|
57
57
|
) -> None:
|
58
58
|
super().__init__()
|
59
|
+
|
59
60
|
self._iters = iters
|
60
61
|
|
61
62
|
def generate_key(self, sz: int = DEFAULT_KEY_SIZE) -> bytes:
|
@@ -131,6 +132,7 @@ class OpensslSubprocessAescbcCrypto(Crypto):
|
|
131
132
|
file_input: SubprocessFileInputMethod = temp_subprocess_file_input,
|
132
133
|
) -> None:
|
133
134
|
super().__init__()
|
135
|
+
|
134
136
|
self._cmd = cmd
|
135
137
|
self._timeout = timeout
|
136
138
|
self._file_input = file_input
|
omlish/secrets/secrets.py
CHANGED
@@ -33,6 +33,7 @@ class Secret(lang.NotPicklable, lang.Sensitive, lang.Final):
|
|
33
33
|
|
34
34
|
def __init__(self, *, key: str | None, value: str) -> None:
|
35
35
|
super().__init__()
|
36
|
+
|
36
37
|
self._key = key
|
37
38
|
setattr(self, self._VALUE_ATTR, lambda: value)
|
38
39
|
|
@@ -203,6 +204,7 @@ class CachingSecrets(Secrets):
|
|
203
204
|
clock: ta.Callable[..., float] = time.time,
|
204
205
|
) -> None:
|
205
206
|
super().__init__()
|
207
|
+
|
206
208
|
self._child = child
|
207
209
|
self._dct: dict[str, Secret] = {}
|
208
210
|
self._ttl_s = ttl_s
|
@@ -243,6 +245,7 @@ class CachingSecrets(Secrets):
|
|
243
245
|
class CompositeSecrets(Secrets):
|
244
246
|
def __init__(self, *children: Secrets) -> None:
|
245
247
|
super().__init__()
|
248
|
+
|
246
249
|
self._children = children
|
247
250
|
|
248
251
|
def _get_raw(self, key: str) -> str:
|
@@ -265,6 +268,7 @@ class LoggingSecrets(Secrets):
|
|
265
268
|
log: logging.Logger | None = None, # noqa
|
266
269
|
) -> None:
|
267
270
|
super().__init__()
|
271
|
+
|
268
272
|
self._child = child
|
269
273
|
self._log = log if log is not None else globals()['log']
|
270
274
|
|
@@ -317,6 +321,7 @@ class EnvVarSecrets(Secrets):
|
|
317
321
|
pop: bool = False,
|
318
322
|
) -> None:
|
319
323
|
super().__init__()
|
324
|
+
|
320
325
|
self._env = env
|
321
326
|
self._upcase = upcase
|
322
327
|
self._prefix = prefix
|
omlish/specs/jmespath/errors.py
CHANGED
@@ -19,6 +19,7 @@ class ParseError(JmespathError):
|
|
19
19
|
msg: str = _ERROR_MESSAGE,
|
20
20
|
) -> None:
|
21
21
|
super().__init__(lex_position, token_value, token_type)
|
22
|
+
|
22
23
|
self.lex_position = lex_position
|
23
24
|
self.token_value = token_value
|
24
25
|
self.token_type = token_type.upper()
|
@@ -56,7 +57,9 @@ class LexerError(ParseError):
|
|
56
57
|
self.lexer_position = lexer_position
|
57
58
|
self.lexer_value = lexer_value
|
58
59
|
self.message = message
|
60
|
+
|
59
61
|
super().__init__(lexer_position, lexer_value, message)
|
62
|
+
|
60
63
|
# Whatever catches LexerError can set this.
|
61
64
|
self.expression = expression
|
62
65
|
|
@@ -143,4 +146,5 @@ class UnknownFunctionError(JmespathError):
|
|
143
146
|
class UndefinedVariableError(JmespathError):
|
144
147
|
def __init__(self, varname):
|
145
148
|
self.varname = varname
|
149
|
+
|
146
150
|
super().__init__(f'Reference to undefined variable: {self.varname}')
|
omlish/specs/jmespath/visitor.py
CHANGED
@@ -164,6 +164,7 @@ class Options:
|
|
164
164
|
class _Expression:
|
165
165
|
def __init__(self, expression: Node, interpreter: 'TreeInterpreter') -> None:
|
166
166
|
super().__init__()
|
167
|
+
|
167
168
|
self.expression = expression
|
168
169
|
self.interpreter = interpreter
|
169
170
|
|
@@ -487,6 +488,7 @@ class TreeInterpreter(Visitor):
|
|
487
488
|
class GraphvizVisitor:
|
488
489
|
def __init__(self) -> None:
|
489
490
|
super().__init__()
|
491
|
+
|
490
492
|
self._lines: list[str] = []
|
491
493
|
self._count = 1
|
492
494
|
|
@@ -34,6 +34,7 @@ class KnownKeyword(Keyword, lang.Abstract):
|
|
34
34
|
**kwargs: ta.Any,
|
35
35
|
) -> None:
|
36
36
|
super().__init_subclass__(**kwargs)
|
37
|
+
|
37
38
|
check.empty(set(dir(cls)) & {'tag', 'aliases', 'tag_and_aliases'})
|
38
39
|
if not lang.is_abstract_class(cls):
|
39
40
|
check.issubclass(cls, lang.Final)
|