From ed267933edf8b6e2e2b63d11ece7457943fe9646 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 25 Jun 2014 21:00:12 +0400 Subject: [PATCH] Add documentation for powerline.lib.shell.run_cmd --- powerline/lib/shell.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/powerline/lib/shell.py b/powerline/lib/shell.py index dd995b48..a74affce 100644 --- a/powerline/lib/shell.py +++ b/powerline/lib/shell.py @@ -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: