Skip to content

Commit bb76def

Browse files
committed
Simplify docs readability
1 parent 3b37a5a commit bb76def

3 files changed

Lines changed: 78 additions & 78 deletions

File tree

doc/source/ExecResult.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ API: ExecResult
1515
:param cmd: command
1616
:type cmd: ``str``
1717
:param stdin: STDIN
18-
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
18+
:type stdin: ``Union[bytes, str, bytearray, None]``
1919
:param stdout: binary STDOUT
20-
:type stdout: ``typing.Optional[typing.Iterable[bytes]]``
20+
:type stdout: ``Optional[Iterable[bytes]]``
2121
:param stderr: binary STDERR
22-
:type stderr: ``typing.Optional[typing.Iterable[bytes]]``
22+
:type stderr: ``Optional[Iterable[bytes]]``
2323
:param exit_code: Exit code. If integer - try to convert to BASH enum.
24-
:type exit_code: typing.Union[int, ExitCodes]
24+
:type exit_code: Union[int, ExitCodes]
2525
:param started: Timestamp of command start
26-
:type started: typing.Optional[datetime.datetime]
26+
:type started: ``Optional[datetime.datetime]``
2727

2828
.. py:attribute:: stdout_lock
2929
@@ -41,7 +41,7 @@ API: ExecResult
4141

4242
.. py:attribute:: timestamp
4343
44-
``typing.Optional(datetime.datetime)``
44+
``Optional(datetime.datetime)``
4545
Timestamp
4646

4747
.. py:method:: set_timestamp()
@@ -59,17 +59,17 @@ API: ExecResult
5959

6060
.. py:attribute:: stdin
6161
62-
``typing.Optional[str]``
62+
``Optional[str]``
6363
Stdin input as string.
6464

6565
.. py:attribute:: stdout
6666
67-
``typing.Tuple[bytes, ...]``
67+
``Tuple[bytes, ...]``
6868
Stdout output as list of binaries.
6969

7070
.. py:attribute:: stderr
7171
72-
``typing.Tuple[bytes, ...]``
72+
``Tuple[bytes, ...]``
7373
Stderr output as list of binaries.
7474

7575
.. py:attribute:: stdout_bin
@@ -124,7 +124,7 @@ API: ExecResult
124124
125125
Return(exit) code of command.
126126

127-
:rtype: typing.Union[int, ExitCodes]
127+
:rtype: Union[int, ExitCodes]
128128

129129
.. py:attribute:: started
130130
@@ -137,30 +137,30 @@ API: ExecResult
137137
138138
JSON from stdout.
139139

140-
:rtype: ``typing.Any``
140+
:rtype: ``Any``
141141
:raises DeserializeValueError: STDOUT can not be deserialized as JSON
142142

143143
.. py:attribute:: stdout_yaml
144144
145145
YAML from stdout.
146146

147-
:rtype: ``typing.Any``
147+
:rtype: ``Any``
148148
:raises DeserializeValueError: STDOUT can not be deserialized as YAML
149149
:raises AttributeError: no any yaml parser installed
150150

151151
.. py:attribute:: stdout_xml
152152
153153
XML from stdout
154154

155-
:rtype: xml.etree.ElementTree.Element
155+
:rtype: ``xml.etree.ElementTree.Element``
156156
:raises DeserializeValueError: STDOUT can not be deserialized as XML
157157
:raises AttributeError: defusedxml is not installed
158158

159159
.. py:attribute:: stdout_lxml
160160
161161
XML from stdout using lxml.
162162

163-
:rtype: lxml.etree.Element
163+
:rtype: ``lxml.etree.Element``
164164
:raises DeserializeValueError: STDOUT can not be deserialized as XML
165165
:raises AttributeError: lxml is not installed
166166

@@ -171,9 +171,9 @@ API: ExecResult
171171
Read stdout file-like object to stdout.
172172

173173
:param src: source
174-
:type src: ``typing.Optional[typing.Iterable]``
174+
:type src: ``Optional[Iterable]``
175175
:param log: logger
176-
:type log: ``typing.Optional[logging.Logger]``
176+
:type log: ``Optional[logging.Logger]``
177177
:param verbose: use log.info instead of log.debug
178178
:type verbose: ``bool``
179179

@@ -184,9 +184,9 @@ API: ExecResult
184184
Read stderr file-like object to stderr.
185185

186186
:param src: source
187-
:type src: ``typing.Optional[typing.Iterable]``
187+
:type src: ``Optional[Iterable]``
188188
:param log: logger
189-
:type log: ``typing.Optional[logging.Logger]``
189+
:type log: ``Optional[logging.Logger]``
190190
:param verbose: use log.info instead of log.debug
191191
:type verbose: ``bool``
192192

@@ -202,16 +202,16 @@ API: ExecResult
202202
Lines access proxy.
203203

204204
:param data: data to work with.
205-
:type data: typing.Sequence[bytes]
205+
:type data: ``Sequence[bytes]``
206206

207207
.. py:method:: __getitem__(self, item)
208208
209209
Access magic.
210210

211211
:param item: index
212-
:type item: typing.Union[int, slice, typing.Iterable[typing.Union[int, slice, ellipsis]]]
212+
:type item: ``Union[int, slice, Iterable[Union[int, slice, ellipsis]]]``
213213
:return: Joined selected lines
214-
:rtype: str
214+
:rtype: ``str``
215215
:raises TypeError: Unexpected key
216216

217217
.. py:method:: __str__(self)

doc/source/Subprocess.rst

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ API: Subprocess
1313
ExecHelper global API.
1414

1515
:param log_mask_re: regex lookup rule to mask command for logger. all MATCHED groups will be replaced by '<*masked*>'
16-
:type log_mask_re: typing.Optional[str]
16+
:type log_mask_re: Optional[str]
1717

1818
.. versionchanged:: 1.2.0 log_mask_re regex rule for masking cmd
1919
.. versionchanged:: 3.1.0 Not singleton anymore. Only lock is shared between all instances.
@@ -23,7 +23,7 @@ API: Subprocess
2323

2424
.. py:attribute:: log_mask_re
2525
26-
``typing.Optional[str]``
26+
``Optional[str]``
2727

2828
regex lookup rule to mask command for logger. all MATCHED groups will be replaced by '<*masked*>'
2929

@@ -48,9 +48,9 @@ API: Subprocess
4848
Context manager for changing chroot rules.
4949

5050
:param path: chroot path or none for working without chroot.
51-
:type path: typing.Optional[typing.Union[str, pathlib.Path]]
51+
:type path: Optional[Union[str, pathlib.Path]]
5252
:return: context manager with selected chroot state inside
53-
:rtype: typing.ContextManager
53+
:rtype: ContextManager
5454

5555
.. Note:: Enter and exit main context manager is produced as well.
5656
.. versionadded:: 4.1.0
@@ -64,22 +64,22 @@ API: Subprocess
6464
:param verbose: Produce log.info records for command call and output
6565
:type verbose: ``bool``
6666
:param timeout: Timeout for command execution.
67-
:type timeout: ``typing.Union[int, float, None]``
67+
:type timeout: ``Union[int, float, None]``
6868
:param log_mask_re: regex lookup rule to mask command for logger.
6969
all MATCHED groups will be replaced by '<*masked*>'
70-
:type log_mask_re: ``typing.Optional[str]``
70+
:type log_mask_re: ``Optional[str]``
7171
:param stdin: pass STDIN text to the process
72-
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
72+
:type stdin: ``Union[bytes, str, bytearray, None]``
7373
:param open_stdout: open STDOUT stream for read
7474
:type open_stdout: ``bool``
7575
:param open_stderr: open STDERR stream for read
7676
:type open_stderr: ``bool``
7777
:param cwd: Sets the current directory before the child is executed.
78-
:type cwd: ``typing.Optional[typing.Union[str, bytes, pathlib.Path]]``
78+
:type cwd: ``Optional[Union[str, bytes, pathlib.Path]]``
7979
:param env: Defines the environment variables for the new process.
80-
:type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
80+
:type env: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
8181
:param env_patch: Defines the environment variables to ADD for the new process.
82-
:type env_patch: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
82+
:type env_patch: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
8383
:rtype: ExecResult
8484
:raises ExecHelperTimeoutError: Timeout exceeded
8585

@@ -98,22 +98,22 @@ API: Subprocess
9898
:param verbose: Produce log.info records for command call and output
9999
:type verbose: ``bool``
100100
:param timeout: Timeout for command execution.
101-
:type timeout: ``typing.Union[int, float, None]``
101+
:type timeout: ``Union[int, float, None]``
102102
:param log_mask_re: regex lookup rule to mask command for logger.
103103
all MATCHED groups will be replaced by '<*masked*>'
104-
:type log_mask_re: ``typing.Optional[str]``
104+
:type log_mask_re: ``Optional[str]``
105105
:param stdin: pass STDIN text to the process
106-
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
106+
:type stdin: ``Union[bytes, str, bytearray, None]``
107107
:param open_stdout: open STDOUT stream for read
108108
:type open_stdout: ``bool``
109109
:param open_stderr: open STDERR stream for read
110110
:type open_stderr: ``bool``
111111
:param cwd: Sets the current directory before the child is executed.
112-
:type cwd: ``typing.Optional[typing.Union[str, bytes, pathlib.Path]]``
112+
:type cwd: ``Optional[Union[str, bytes, pathlib.Path]]``
113113
:param env: Defines the environment variables for the new process.
114-
:type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
114+
:type env: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
115115
:param env_patch: Defines the environment variables to ADD for the new process.
116-
:type env_patch: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
116+
:type env_patch: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
117117
:rtype: ExecResult
118118
:raises ExecHelperTimeoutError: Timeout exceeded
119119

@@ -129,30 +129,30 @@ API: Subprocess
129129
:param verbose: Produce log.info records for command call and output
130130
:type verbose: ``bool``
131131
:param timeout: Timeout for command execution.
132-
:type timeout: ``typing.Union[int, float, None]``
132+
:type timeout: ``Union[int, float, None]``
133133
:param error_info: Text for error details, if fail happens
134-
:type error_info: ``typing.Optional[str]``
134+
:type error_info: ``Optional[str]``
135135
:param expected: expected return codes (0 by default)
136-
:type expected: typing.Iterable[typing.Union[int, ExitCodes]]
136+
:type expected: Iterable[Union[int, ExitCodes]]
137137
:param raise_on_err: Raise exception on unexpected return code
138138
:type raise_on_err: ``bool``
139139
:param log_mask_re: regex lookup rule to mask command for logger.
140140
all MATCHED groups will be replaced by '<*masked*>'
141-
:type log_mask_re: ``typing.Optional[str]``
141+
:type log_mask_re: ``Optional[str]``
142142
:param stdin: pass STDIN text to the process
143-
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
143+
:type stdin: ``Union[bytes, str, bytearray, None]``
144144
:param open_stdout: open STDOUT stream for read
145145
:type open_stdout: ``bool``
146146
:param open_stderr: open STDERR stream for read
147147
:type open_stderr: ``bool``
148148
:param cwd: Sets the current directory before the child is executed.
149-
:type cwd: ``typing.Optional[typing.Union[str, bytes, pathlib.Path]]``
149+
:type cwd: ``Optional[Union[str, bytes, pathlib.Path]]``
150150
:param env: Defines the environment variables for the new process.
151-
:type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
151+
:type env: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
152152
:param env_patch: Defines the environment variables to ADD for the new process.
153-
:type env_patch: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
153+
:type env_patch: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
154154
:param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
155-
:type exception_class: typing.Type[CalledProcessError]
155+
:type exception_class: Type[CalledProcessError]
156156
:rtype: ExecResult
157157
:raises ExecHelperTimeoutError: Timeout exceeded
158158
:raises CalledProcessError: Unexpected exit code
@@ -171,30 +171,30 @@ API: Subprocess
171171
:param verbose: Produce log.info records for command call and output
172172
:type verbose: ``bool``
173173
:param timeout: Timeout for command execution.
174-
:type timeout: ``typing.Union[int, float, None]``
174+
:type timeout: ``Union[int, float, None]``
175175
:param error_info: Text for error details, if fail happens
176-
:type error_info: ``typing.Optional[str]``
176+
:type error_info: ``Optional[str]``
177177
:param raise_on_err: Raise exception on unexpected return code
178178
:type raise_on_err: ``bool``
179179
:param expected: expected return codes (0 by default)
180-
:type expected: typing.Iterable[typing.Union[int, ExitCodes]]
180+
:type expected: Iterable[Union[int, ExitCodes]]
181181
:param log_mask_re: regex lookup rule to mask command for logger.
182182
all MATCHED groups will be replaced by '<*masked*>'
183-
:type log_mask_re: ``typing.Optional[str]``
183+
:type log_mask_re: ``Optional[str]``
184184
:param stdin: pass STDIN text to the process
185-
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
185+
:type stdin: ``Union[bytes, str, bytearray, None]``
186186
:param open_stdout: open STDOUT stream for read
187187
:type open_stdout: ``bool``
188188
:param open_stderr: open STDERR stream for read
189189
:type open_stderr: ``bool``
190190
:param cwd: Sets the current directory before the child is executed.
191-
:type cwd: ``typing.Optional[typing.Union[str, bytes, pathlib.Path]]``
191+
:type cwd: ``Optional[Union[str, bytes, pathlib.Path]]``
192192
:param env: Defines the environment variables for the new process.
193-
:type env: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
193+
:type env: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
194194
:param env_patch: Defines the environment variables to ADD for the new process.
195-
:type env_patch: ``typing.Optional[typing.Mapping[typing.Union[str, bytes], typing.Union[str, bytes]]]``
195+
:type env_patch: ``Optional[Mapping[Union[str, bytes], Union[str, bytes]]]``
196196
:param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
197-
:type exception_class: typing.Type[CalledProcessError]
197+
:type exception_class: Type[CalledProcessError]
198198
:rtype: ExecResult
199199
:raises ExecHelperTimeoutError: Timeout exceeded
200200
:raises CalledProcessError: Unexpected exit code or stderr presents
@@ -215,15 +215,15 @@ API: Subprocess
215215

216216
.. py:attribute:: stdin
217217
218-
``typing.Optional[typing.IO[bytes]]``
218+
``Optional[IO[bytes]]``
219219

220220
.. py:attribute:: stderr
221221
222-
``typing.Optional[typing.IO[bytes]]``
222+
``Optional[IO[bytes]]``
223223

224224
.. py:attribute:: stdout
225225
226-
``typing.Optional[typing.IO[bytes]]``
226+
``Optional[IO[bytes]]``
227227

228228
.. py:attribute:: started
229229

0 commit comments

Comments
 (0)