def __init__(self, cmd, cwd=None, stderr=subprocess.PIPE,
                 stdout=subprocess.PIPE, env=None):
        """
        execute the given command
        :param cmd: the command
        :param cwd: the directory in which to execute the command
        :param stderr: the pipe for stderror
        :param stdout: the pipe for the stdoutput
        :param env: 
        """
        Console.debug_msg('Running cmd: {}'.format(' '.join(map(quote, cmd))))

        proc = subprocess.Popen(cmd, stderr=stderr, stdout=stdout, cwd=cwd,
                                env=env)
        stdout, stderr = proc.communicate()

        self.returncode = proc.returncode
        self.stderr = stderr
        self.stdout = stdout

        if self.returncode != 0:
            raise SubprocessError(cmd, self.returncode, self.stderr,
                                  self.stdout)
def __init__ ( self , cmd , cwd = None , stderr = subprocess . PIPE , stdout = subprocess . PIPE , env = None ) : Console . debug_msg ( 'Running cmd: {}' . format ( ' ' . join ( map ( quote , cmd ) ) ) ) proc = subprocess . Popen ( cmd , stderr = stderr , stdout = stdout , cwd = cwd , env = env ) stdout , stderr = proc . communicate ( ) self . returncode = proc . returncode self . stderr = stderr self . stdout = stdout if self . returncode != 0 : raise SubprocessError ( cmd , self . returncode , self . stderr , self . stdout )
execute the given command
        :param cmd: the command
        :param cwd: the directory in which to execute the command
        :param stderr: the pipe for stderror
        :param stdout: the pipe for the stdoutput
        :param env: