Skip to content

Commit 908a748

Browse files
committed
Update docs
Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com> (cherry picked from commit 9460417) Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com>
1 parent 99a80ce commit 908a748

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ This methods are almost the same for `SSHCleint` and `Subprocess`, except specif
132132
timeout=1 * 60 * 60, # type: typing.Union[int, float, None]
133133
# Keyword only:
134134
log_mask_re=None, # type: typing.Optional[str]
135+
stdin=None, # type: typing.Union[bytes, str, bytearray, None]
135136
**kwargs
136137
)
137138
@@ -147,6 +148,7 @@ This methods are almost the same for `SSHCleint` and `Subprocess`, except specif
147148
raise_on_err=True, # type: bool
148149
# Keyword only:
149150
log_mask_re=None, # type: typing.Optional[str]
151+
stdin=None, # type: typing.Union[bytes, str, bytearray, None]
150152
exception_class=CalledProcessError, # typing.Type[CalledProcessError]
151153
**kwargs
152154
)
@@ -160,8 +162,9 @@ This methods are almost the same for `SSHCleint` and `Subprocess`, except specif
160162
error_info=None, # type: typing.Optional[str]
161163
raise_on_err=True, # type: bool
162164
# Keyword only:
163-
log_mask_re=None, # type: typing.Optional[str]
164165
expected=(0,), # typing.Iterable[typing.Union[int, ExitCodes]]
166+
log_mask_re=None, # type: typing.Optional[str]
167+
stdin=None, # type: typing.Union[bytes, str, bytearray, None]
165168
exception_class=CalledProcessError, # typing.Type[CalledProcessError]
166169
)
167170
@@ -173,6 +176,7 @@ This methods are almost the same for `SSHCleint` and `Subprocess`, except specif
173176
timeout=1 * 60 * 60, # type: typing.Union[int, float, None]
174177
# Keyword only:
175178
log_mask_re=None, # type: typing.Optional[str]
179+
stdin=None, # type: typing.Union[bytes, str, bytearray, None]
176180
**kwargs
177181
)
178182

doc/source/SSHClient.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ API: SSHClient and SSHAuth.
166166
.. versionchanged:: 2.1.0 Use typed NamedTuple as result
167167
.. versionchanged:: 3.2.0 Expose pty options as optional keyword-only arguments
168168

169-
.. py:method:: execute(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, **kwargs)
169+
.. py:method:: execute(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, stdin=None, **kwargs)
170170
171171
Execute command and wait for return code.
172172

@@ -179,12 +179,14 @@ API: SSHClient and SSHAuth.
179179
:param log_mask_re: regex lookup rule to mask command for logger.
180180
all MATCHED groups will be replaced by '<*masked*>'
181181
:type log_mask_re: ``typing.Optional[str]``
182+
:param stdin: pass STDIN text to the process
183+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
182184
:rtype: ExecResult
183185
:raises ExecHelperTimeoutError: Timeout exceeded
184186

185187
.. versionchanged:: 1.2.0 default timeout 1 hour
186188

187-
.. py:method:: __call__(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, **kwargs)
189+
.. py:method:: __call__(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, stdin=None, **kwargs)
188190
189191
Execute command and wait for return code.
190192

@@ -197,12 +199,14 @@ API: SSHClient and SSHAuth.
197199
:param log_mask_re: regex lookup rule to mask command for logger.
198200
all MATCHED groups will be replaced by '<*masked*>'
199201
:type log_mask_re: ``typing.Optional[str]``
202+
:param stdin: pass STDIN text to the process
203+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
200204
:rtype: ExecResult
201205
:raises ExecHelperTimeoutError: Timeout exceeded
202206

203207
.. versionadded:: 2.9.4
204208

205-
.. py:method:: check_call(command, verbose=False, timeout=1*60*60, error_info=None, expected=(0,), raise_on_err=True, *, log_mask_re=None, exception_class=CalledProcessError, **kwargs)
209+
.. py:method:: check_call(command, verbose=False, timeout=1*60*60, error_info=None, expected=(0,), raise_on_err=True, *, log_mask_re=None, stdin=None, exception_class=CalledProcessError, **kwargs)
206210
207211
Execute command and check for return code.
208212

@@ -221,6 +225,8 @@ API: SSHClient and SSHAuth.
221225
:param log_mask_re: regex lookup rule to mask command for logger.
222226
all MATCHED groups will be replaced by '<*masked*>'
223227
:type log_mask_re: ``typing.Optional[str]``
228+
:param stdin: pass STDIN text to the process
229+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
224230
:param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
225231
:type exception_class: typing.Type[CalledProcessError]
226232
:rtype: ExecResult
@@ -231,7 +237,7 @@ API: SSHClient and SSHAuth.
231237
.. versionchanged:: 3.2.0 Exception class can be substituted
232238
.. versionchanged:: 2.11.0 Expected is not optional, defaults os dependent
233239

234-
.. py:method:: check_stderr(command, verbose=False, timeout=1*60*60, error_info=None, raise_on_err=True, *, log_mask_re=None, expected=(0,), exception_class=CalledProcessError, **kwargs)
240+
.. py:method:: check_stderr(command, verbose=False, timeout=1*60*60, error_info=None, raise_on_err=True, *, expected=(0,), log_mask_re=None, stdin=None, exception_class=CalledProcessError, **kwargs)
235241
236242
Execute command expecting return code 0 and empty STDERR.
237243

@@ -250,6 +256,8 @@ API: SSHClient and SSHAuth.
250256
:param log_mask_re: regex lookup rule to mask command for logger.
251257
all MATCHED groups will be replaced by '<*masked*>'
252258
:type log_mask_re: ``typing.Optional[str]``
259+
:param stdin: pass STDIN text to the process
260+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
253261
:param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
254262
:type exception_class: typing.Type[CalledProcessError]
255263
:rtype: ExecResult

doc/source/Subprocess.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ API: Subprocess
8686
.. versionchanged:: 2.1.0 Use typed NamedTuple as result
8787
.. versionchanged:: 2.9.3 Expose cwd and env as optional keyword-only arguments
8888

89-
.. py:method:: execute(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, **kwargs)
89+
.. py:method:: execute(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, stdin=None, **kwargs)
9090
9191
Execute command and wait for return code.
9292

@@ -99,6 +99,8 @@ API: Subprocess
9999
:param log_mask_re: regex lookup rule to mask command for logger.
100100
all MATCHED groups will be replaced by '<*masked*>'
101101
:type log_mask_re: ``typing.Optional[str]``
102+
:param stdin: pass STDIN text to the process
103+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
102104
:rtype: ExecResult
103105
:raises ExecHelperTimeoutError: Timeout exceeded
104106

@@ -108,7 +110,7 @@ API: Subprocess
108110
.. versionchanged:: 1.2.0 default timeout 1 hour
109111
.. versionchanged:: 1.2.0 stdin data
110112

111-
.. py:method:: __call__(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, **kwargs)
113+
.. py:method:: __call__(command, verbose=False, timeout=1*60*60, *, log_mask_re=None, stdin=None, **kwargs)
112114
113115
Execute command and wait for return code.
114116

@@ -121,13 +123,15 @@ API: Subprocess
121123
:param log_mask_re: regex lookup rule to mask command for logger.
122124
all MATCHED groups will be replaced by '<*masked*>'
123125
:type log_mask_re: ``typing.Optional[str]``
126+
:param stdin: pass STDIN text to the process
127+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
124128
:rtype: ExecResult
125129
:raises ExecHelperTimeoutError: Timeout exceeded
126130

127131
.. note:: stdin channel is closed after the input processing
128132
.. versionadded:: 2.9.4
129133

130-
.. py:method:: check_call(command, verbose=False, timeout=1*60*60, error_info=None, expected=(0,), raise_on_err=True, *, log_mask_re=None, exception_class=CalledProcessError, **kwargs)
134+
.. py:method:: check_call(command, verbose=False, timeout=1*60*60, error_info=None, expected=(0,), raise_on_err=True, *, log_mask_re=None, stdin=None, exception_class=CalledProcessError, **kwargs)
131135
132136
Execute command and check for return code.
133137

@@ -146,6 +150,8 @@ API: Subprocess
146150
:param log_mask_re: regex lookup rule to mask command for logger.
147151
all MATCHED groups will be replaced by '<*masked*>'
148152
:type log_mask_re: ``typing.Optional[str]``
153+
:param stdin: pass STDIN text to the process
154+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
149155
:param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
150156
:type exception_class: typing.Type[CalledProcessError]
151157
:rtype: ExecResult
@@ -157,7 +163,7 @@ API: Subprocess
157163
.. versionchanged:: 2.9.3 Exception class can be substituted
158164
.. versionchanged:: 2.11.0 Expected is not optional, defaults os dependent
159165

160-
.. py:method:: check_stderr(command, verbose=False, timeout=1*60*60, error_info=None, raise_on_err=True, *, log_mask_re=None, expected=(0,), exception_class=CalledProcessError, **kwargs)
166+
.. py:method:: check_stderr(command, verbose=False, timeout=1*60*60, error_info=None, raise_on_err=True, *, expected=(0,), log_mask_re=None, stdin=None, exception_class=CalledProcessError, **kwargs)
161167
162168
Execute command expecting return code 0 and empty STDERR.
163169

@@ -176,6 +182,8 @@ API: Subprocess
176182
:param log_mask_re: regex lookup rule to mask command for logger.
177183
all MATCHED groups will be replaced by '<*masked*>'
178184
:type log_mask_re: ``typing.Optional[str]``
185+
:param stdin: pass STDIN text to the process
186+
:type stdin: ``typing.Union[bytes, str, bytearray, None]``
179187
:param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
180188
:type exception_class: typing.Type[CalledProcessError]
181189
:rtype: ExecResult

0 commit comments

Comments
 (0)