mirror of
https://github.com/powerline/powerline.git
synced 2025-07-29 00:34:49 +02:00
Add documentation for powerline.lib.shell.run_cmd
This commit is contained in:
parent
1498fc714c
commit
ed267933ed
@ -11,6 +11,17 @@ def _get_shell_encoding():
|
||||
|
||||
|
||||
def run_cmd(pl, cmd, stdin=None):
|
||||
'''Run command and return its stdout, stripped
|
||||
|
||||
If running command fails returns None and logs failure to ``pl`` argument.
|
||||
|
||||
:param PowerlineLogger pl:
|
||||
Logger used to log failures.
|
||||
:param list cmd:
|
||||
Command which will be run.
|
||||
:param str stdin:
|
||||
String passed to command. May be None.
|
||||
'''
|
||||
try:
|
||||
p = Popen(cmd, stdout=PIPE, stdin=PIPE)
|
||||
except OSError as e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user