omlish 0.0.0.dev425__py3-none-any.whl → 0.0.0.dev427__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/__about__.py +2 -2
- omlish/c3.py +4 -1
- omlish/configs/processing/flattening.py +1 -1
- omlish/configs/processing/merging.py +8 -6
- omlish/dataclasses/impl/concerns/doc.py +1 -1
- omlish/diag/_pycharm/runhack.py +1 -1
- omlish/diag/procfs.py +2 -2
- omlish/formats/json/stream/lexing.py +63 -16
- omlish/formats/json/stream/parsing.py +1 -1
- omlish/formats/json/stream/utils.py +2 -2
- omlish/formats/logfmt.py +8 -2
- omlish/funcs/genmachine.py +1 -1
- omlish/http/sse.py +1 -1
- omlish/inject/impl/injector.py +1 -1
- omlish/inject/impl/multis.py +2 -2
- omlish/inject/impl/providers.py +0 -4
- omlish/inject/impl/proxy.py +0 -2
- omlish/inject/scopes.py +0 -4
- omlish/io/buffers.py +1 -1
- omlish/lang/__init__.py +23 -13
- omlish/lang/{attrs.py → attrstorage.py} +15 -15
- omlish/lang/cached/property.py +2 -2
- omlish/lang/classes/simple.py +26 -4
- omlish/lang/collections.py +1 -1
- omlish/lang/iterables.py +2 -2
- omlish/lifecycles/contextmanagers.py +1 -1
- omlish/lifecycles/controller.py +1 -1
- omlish/lite/asyncs.py +5 -0
- omlish/lite/attrops.py +332 -0
- omlish/lite/cached.py +1 -1
- omlish/lite/maybes.py +2 -0
- omlish/lite/strings.py +0 -7
- omlish/lite/timing.py +4 -1
- omlish/logs/all.py +4 -0
- omlish/logs/base.py +138 -152
- omlish/logs/callers.py +3 -3
- omlish/logs/contexts.py +250 -0
- omlish/logs/infos.py +16 -5
- omlish/logs/modules.py +10 -0
- omlish/logs/protocols.py +7 -7
- omlish/logs/std/adapters.py +9 -5
- omlish/logs/std/records.py +26 -11
- omlish/logs/times.py +4 -6
- omlish/manifests/loading.py +6 -0
- omlish/os/atomics.py +1 -1
- omlish/reflect/types.py +22 -0
- omlish/sockets/server/server.py +1 -1
- {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/METADATA +2 -2
- {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/RECORD +53 -52
- omlish/lite/logs.py +0 -4
- omlish/lite/reprs.py +0 -85
- {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/top_level.txt +0 -0
omlish/lite/reprs.py
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
# ruff: noqa: UP007 UP045
|
2
|
-
import dataclasses as dc
|
3
|
-
import typing as ta
|
4
|
-
|
5
|
-
|
6
|
-
##
|
7
|
-
|
8
|
-
|
9
|
-
@dc.dataclass(frozen=True)
|
10
|
-
class AttrRepr:
|
11
|
-
attrs: ta.Sequence[str]
|
12
|
-
|
13
|
-
# _: dc.KW_ONLY
|
14
|
-
|
15
|
-
with_module: bool = False
|
16
|
-
use_qualname: bool = False
|
17
|
-
with_id: bool = False
|
18
|
-
value_filter: ta.Optional[ta.Callable[[ta.Any], bool]] = None
|
19
|
-
recursive: bool = False
|
20
|
-
|
21
|
-
@classmethod
|
22
|
-
def of(cls, *attrs: str, **kwargs: ta.Any) -> 'AttrRepr':
|
23
|
-
return cls(attrs, **kwargs)
|
24
|
-
|
25
|
-
#
|
26
|
-
|
27
|
-
def _build_(self, obj: ta.Any) -> str:
|
28
|
-
vs = ', '.join(
|
29
|
-
f'{attr}={v!r}'
|
30
|
-
for attr in self.attrs
|
31
|
-
for v in [getattr(obj, attr)]
|
32
|
-
if self.value_filter is None or self.value_filter(v)
|
33
|
-
)
|
34
|
-
|
35
|
-
return (
|
36
|
-
f'{obj.__class__.__module__ + "." if self.with_module else ""}'
|
37
|
-
f'{obj.__class__.__qualname__ if self.use_qualname else obj.__class__.__name__}'
|
38
|
-
f'{("@" + hex(id(obj))[2:]) if self.with_id else ""}'
|
39
|
-
f'({vs})'
|
40
|
-
)
|
41
|
-
|
42
|
-
_build: ta.ClassVar[ta.Callable[[ta.Any], str]]
|
43
|
-
|
44
|
-
def __call__(self, obj: ta.Any) -> str:
|
45
|
-
try:
|
46
|
-
build: ta.Any = self._build
|
47
|
-
|
48
|
-
except AttributeError:
|
49
|
-
build = self._build_
|
50
|
-
if self.recursive:
|
51
|
-
build = self._reprlib().recursive_repr()(build)
|
52
|
-
object.__setattr__(self, '_build', build)
|
53
|
-
|
54
|
-
return build(obj)
|
55
|
-
|
56
|
-
#
|
57
|
-
|
58
|
-
def __get__(self, instance, owner):
|
59
|
-
if instance is None:
|
60
|
-
return self
|
61
|
-
|
62
|
-
def __repr__(other): # noqa
|
63
|
-
return self(other)
|
64
|
-
|
65
|
-
return __repr__.__get__(instance, owner)
|
66
|
-
|
67
|
-
#
|
68
|
-
|
69
|
-
_reprlib_: ta.ClassVar[ta.Any]
|
70
|
-
|
71
|
-
@classmethod
|
72
|
-
def _reprlib(cls) -> ta.Any:
|
73
|
-
try:
|
74
|
-
return cls._reprlib_
|
75
|
-
except AttributeError:
|
76
|
-
pass
|
77
|
-
|
78
|
-
import reprlib # noqa
|
79
|
-
|
80
|
-
cls._reprlib_ = reprlib
|
81
|
-
return reprlib
|
82
|
-
|
83
|
-
|
84
|
-
def attr_repr(obj: ta.Any, *attrs: str, **kwargs: ta.Any) -> str:
|
85
|
-
return AttrRepr(attrs, **kwargs)(obj)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|