omlish 0.0.0.dev413__py3-none-any.whl → 0.0.0.dev414__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/subprocesses/maysyncs.py +7 -96
- {omlish-0.0.0.dev413.dist-info → omlish-0.0.0.dev414.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev413.dist-info → omlish-0.0.0.dev414.dist-info}/RECORD +8 -8
- {omlish-0.0.0.dev413.dist-info → omlish-0.0.0.dev414.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev413.dist-info → omlish-0.0.0.dev414.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev413.dist-info → omlish-0.0.0.dev414.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev413.dist-info → omlish-0.0.0.dev414.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/subprocesses/maysyncs.py
CHANGED
@@ -5,9 +5,7 @@ import sys
|
|
5
5
|
import typing as ta
|
6
6
|
|
7
7
|
from ..lite.maysyncs import make_maysync
|
8
|
-
from ..lite.timeouts import TimeoutLike
|
9
8
|
from .asyncs import AbstractAsyncSubprocesses
|
10
|
-
from .base import BaseSubprocesses
|
11
9
|
from .run import SubprocessRun
|
12
10
|
from .run import SubprocessRunOutput
|
13
11
|
from .sync import AbstractSubprocesses
|
@@ -16,94 +14,7 @@ from .sync import AbstractSubprocesses
|
|
16
14
|
##
|
17
15
|
|
18
16
|
|
19
|
-
class
|
20
|
-
@abc.abstractmethod
|
21
|
-
def run_(self, run: SubprocessRun) -> ta.Awaitable[SubprocessRunOutput]:
|
22
|
-
raise NotImplementedError
|
23
|
-
|
24
|
-
def run(
|
25
|
-
self,
|
26
|
-
*cmd: str,
|
27
|
-
input: ta.Any = None, # noqa
|
28
|
-
timeout: TimeoutLike = None,
|
29
|
-
check: bool = False,
|
30
|
-
capture_output: ta.Optional[bool] = None,
|
31
|
-
**kwargs: ta.Any,
|
32
|
-
) -> ta.Awaitable[SubprocessRunOutput]:
|
33
|
-
return self.run_(SubprocessRun(
|
34
|
-
cmd=cmd,
|
35
|
-
input=input,
|
36
|
-
timeout=timeout,
|
37
|
-
check=check,
|
38
|
-
capture_output=capture_output,
|
39
|
-
kwargs=kwargs,
|
40
|
-
))
|
41
|
-
|
42
|
-
#
|
43
|
-
|
44
|
-
@abc.abstractmethod
|
45
|
-
def check_call(
|
46
|
-
self,
|
47
|
-
*cmd: str,
|
48
|
-
stdout: ta.Any = sys.stderr,
|
49
|
-
**kwargs: ta.Any,
|
50
|
-
) -> ta.Awaitable[None]:
|
51
|
-
raise NotImplementedError
|
52
|
-
|
53
|
-
@abc.abstractmethod
|
54
|
-
def check_output(
|
55
|
-
self,
|
56
|
-
*cmd: str,
|
57
|
-
**kwargs: ta.Any,
|
58
|
-
) -> ta.Awaitable[bytes]:
|
59
|
-
raise NotImplementedError
|
60
|
-
|
61
|
-
#
|
62
|
-
|
63
|
-
async def check_output_str(
|
64
|
-
self,
|
65
|
-
*cmd: str,
|
66
|
-
**kwargs: ta.Any,
|
67
|
-
) -> str:
|
68
|
-
return (await self.check_output(*cmd, **kwargs)).decode().strip()
|
69
|
-
|
70
|
-
#
|
71
|
-
|
72
|
-
async def try_call(
|
73
|
-
self,
|
74
|
-
*cmd: str,
|
75
|
-
**kwargs: ta.Any,
|
76
|
-
) -> bool:
|
77
|
-
if isinstance(await self.async_try_fn(self.check_call, *cmd, **kwargs), Exception):
|
78
|
-
return False
|
79
|
-
else:
|
80
|
-
return True
|
81
|
-
|
82
|
-
async def try_output(
|
83
|
-
self,
|
84
|
-
*cmd: str,
|
85
|
-
**kwargs: ta.Any,
|
86
|
-
) -> ta.Optional[bytes]:
|
87
|
-
if isinstance(ret := await self.async_try_fn(self.check_output, *cmd, **kwargs), Exception):
|
88
|
-
return None
|
89
|
-
else:
|
90
|
-
return ret
|
91
|
-
|
92
|
-
async def try_output_str(
|
93
|
-
self,
|
94
|
-
*cmd: str,
|
95
|
-
**kwargs: ta.Any,
|
96
|
-
) -> ta.Optional[str]:
|
97
|
-
if (ret := await self.try_output(*cmd, **kwargs)) is None:
|
98
|
-
return None
|
99
|
-
else:
|
100
|
-
return ret.decode().strip()
|
101
|
-
|
102
|
-
|
103
|
-
##
|
104
|
-
|
105
|
-
|
106
|
-
class MaysyncSubprocesses(AbstractMaysyncSubprocesses):
|
17
|
+
class MaysyncSubprocesses(AbstractAsyncSubprocesses, abc.ABC):
|
107
18
|
def __init__(
|
108
19
|
self,
|
109
20
|
subprocesses: AbstractSubprocesses,
|
@@ -124,23 +35,23 @@ class MaysyncSubprocesses(AbstractMaysyncSubprocesses):
|
|
124
35
|
|
125
36
|
#
|
126
37
|
|
127
|
-
def check_call(
|
38
|
+
async def check_call(
|
128
39
|
self,
|
129
40
|
*cmd: str,
|
130
41
|
stdout: ta.Any = sys.stderr,
|
131
42
|
**kwargs: ta.Any,
|
132
|
-
) ->
|
133
|
-
return make_maysync(
|
43
|
+
) -> None:
|
44
|
+
return await make_maysync(
|
134
45
|
self._subprocesses.check_call,
|
135
46
|
self._async_subprocesses.check_call,
|
136
47
|
)(*cmd, stdout=stdout, **kwargs)
|
137
48
|
|
138
|
-
def check_output(
|
49
|
+
async def check_output(
|
139
50
|
self,
|
140
51
|
*cmd: str,
|
141
52
|
**kwargs: ta.Any,
|
142
|
-
) ->
|
143
|
-
return make_maysync(
|
53
|
+
) -> bytes:
|
54
|
+
return await make_maysync(
|
144
55
|
self._subprocesses.check_output,
|
145
56
|
self._async_subprocesses.check_output,
|
146
57
|
)(*cmd, **kwargs)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=FLw7xkPiSXuImZgqSP8BwrEib2R1doSzUPLUkc-QUIA,8410
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=5lJafuAwdynN20SptUoGmCSL1duPAhIzl1epOqICNdM,3601
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=rer-TPOFDU6fYq_AWio_AmA-ckZ8JDY5shIzQ_yXfzA,8414
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -765,7 +765,7 @@ omlish/subprocesses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
765
765
|
omlish/subprocesses/asyncs.py,sha256=G9wj275s3r0ueftHFl73Lt4kMRBc2hJOKcoJQCDlBms,2663
|
766
766
|
omlish/subprocesses/base.py,sha256=r60N3ad4ooSvdgFmT94L_xZEy7FMbMX6JcG2VgpHo6w,6139
|
767
767
|
omlish/subprocesses/editor.py,sha256=xBrd7gY0akhRfDIBK5YIBrYMHECtl_8r499iKViyfpQ,2634
|
768
|
-
omlish/subprocesses/maysyncs.py,sha256=
|
768
|
+
omlish/subprocesses/maysyncs.py,sha256=y4q-LnuSYRmiCrncGoa9SwejCSWnq0Cnzzu9qHcq5EE,1445
|
769
769
|
omlish/subprocesses/run.py,sha256=8EeMm2FdNEFmEmbhhzJyHXASUhCCMMRN_-8ybqFhgLI,4378
|
770
770
|
omlish/subprocesses/sync.py,sha256=L-ZNj9RrZd69XjlKrXjt-EJ-XUpQF8E35Mh3b3SI3vc,3671
|
771
771
|
omlish/subprocesses/utils.py,sha256=v5uEzxmbmRvXwOl_0DtBa5Il6yITKYRgmVSGHcLsT4o,402
|
@@ -909,9 +909,9 @@ omlish/typedvalues/marshal.py,sha256=AtBz7Jq-BfW8vwM7HSxSpR85JAXmxK2T0xDblmm1HI0
|
|
909
909
|
omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
|
910
910
|
omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
|
911
911
|
omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
|
912
|
-
omlish-0.0.0.
|
913
|
-
omlish-0.0.0.
|
914
|
-
omlish-0.0.0.
|
915
|
-
omlish-0.0.0.
|
916
|
-
omlish-0.0.0.
|
917
|
-
omlish-0.0.0.
|
912
|
+
omlish-0.0.0.dev414.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
913
|
+
omlish-0.0.0.dev414.dist-info/METADATA,sha256=WyKbSwUeFHk3nrepnSOnkTTwc0AunQSWov7rYWlEjHc,18881
|
914
|
+
omlish-0.0.0.dev414.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
915
|
+
omlish-0.0.0.dev414.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
916
|
+
omlish-0.0.0.dev414.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
917
|
+
omlish-0.0.0.dev414.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|