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.
Files changed (55) hide show
  1. omlish/__about__.py +2 -2
  2. omlish/c3.py +4 -1
  3. omlish/configs/processing/flattening.py +1 -1
  4. omlish/configs/processing/merging.py +8 -6
  5. omlish/dataclasses/impl/concerns/doc.py +1 -1
  6. omlish/diag/_pycharm/runhack.py +1 -1
  7. omlish/diag/procfs.py +2 -2
  8. omlish/formats/json/stream/lexing.py +63 -16
  9. omlish/formats/json/stream/parsing.py +1 -1
  10. omlish/formats/json/stream/utils.py +2 -2
  11. omlish/formats/logfmt.py +8 -2
  12. omlish/funcs/genmachine.py +1 -1
  13. omlish/http/sse.py +1 -1
  14. omlish/inject/impl/injector.py +1 -1
  15. omlish/inject/impl/multis.py +2 -2
  16. omlish/inject/impl/providers.py +0 -4
  17. omlish/inject/impl/proxy.py +0 -2
  18. omlish/inject/scopes.py +0 -4
  19. omlish/io/buffers.py +1 -1
  20. omlish/lang/__init__.py +23 -13
  21. omlish/lang/{attrs.py → attrstorage.py} +15 -15
  22. omlish/lang/cached/property.py +2 -2
  23. omlish/lang/classes/simple.py +26 -4
  24. omlish/lang/collections.py +1 -1
  25. omlish/lang/iterables.py +2 -2
  26. omlish/lifecycles/contextmanagers.py +1 -1
  27. omlish/lifecycles/controller.py +1 -1
  28. omlish/lite/asyncs.py +5 -0
  29. omlish/lite/attrops.py +332 -0
  30. omlish/lite/cached.py +1 -1
  31. omlish/lite/maybes.py +2 -0
  32. omlish/lite/strings.py +0 -7
  33. omlish/lite/timing.py +4 -1
  34. omlish/logs/all.py +4 -0
  35. omlish/logs/base.py +138 -152
  36. omlish/logs/callers.py +3 -3
  37. omlish/logs/contexts.py +250 -0
  38. omlish/logs/infos.py +16 -5
  39. omlish/logs/modules.py +10 -0
  40. omlish/logs/protocols.py +7 -7
  41. omlish/logs/std/adapters.py +9 -5
  42. omlish/logs/std/records.py +26 -11
  43. omlish/logs/times.py +4 -6
  44. omlish/manifests/loading.py +6 -0
  45. omlish/os/atomics.py +1 -1
  46. omlish/reflect/types.py +22 -0
  47. omlish/sockets/server/server.py +1 -1
  48. {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/METADATA +2 -2
  49. {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/RECORD +53 -52
  50. omlish/lite/logs.py +0 -4
  51. omlish/lite/reprs.py +0 -85
  52. {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/WHEEL +0 -0
  53. {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/entry_points.txt +0 -0
  54. {omlish-0.0.0.dev425.dist-info → omlish-0.0.0.dev427.dist-info}/licenses/LICENSE +0 -0
  55. {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)