gui/backend/gui_plugin/core/lib/SystemUtils.py
def popen(cmd, mode="r", buffering=-1):
    """A custom implementation of popen that redirects STDERR to STDOUT

    Args:
        cmd (str): The shell command to execute
        mode (str): The mode as in os.popen
        buffering (int): The buffering ias in os.popen

    Returns:
       The output of the process
    """

    if mode not in ("r", "w"):
        raise ValueError("invalid mode %r" % mode)
    if buffering == 0 or buffering is None:
        raise ValueError("popen() does not support unbuffered streams")
    import subprocess
    import io
    # cSpell:ignore bufsize
    if mode == "r":
        proc = subprocess.Popen(cmd,
                                text=True,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                bufsize=buffering)
        return _wrap_close(proc.stdout, proc)
    else:
        proc = subprocess.Popen(cmd,
                                text=True,
                                stdin=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                bufsize=buffering)
        return _wrap_close(proc.stdin, proc)
A custom implementation of popen that redirects STDERR to STDOUT

    Args:
        cmd (str): The shell command to execute
        mode (str): The mode as in os.popen
        buffering (int): The buffering ias in os.popen

    Returns:
       The output of the process
    
A custom implementation of popen that redirects STDERR to STDOUT
A custom implementation of popen that redirects STDERR to STDOUT
def popen(cmd, mode="r", buffering=-1):
    if mode not in ("r", "w"):
        raise ValueError("invalid mode %r" % mode)
    if buffering == 0 or buffering is None:
        raise ValueError("popen() does not support unbuffered streams")
    import subprocess
    import io
    if mode == "r":
        proc = subprocess.Popen(cmd,
                                text=True,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                bufsize=buffering)
        return _wrap_close(proc.stdout, proc)
    else:
        proc = subprocess.Popen(cmd,
                                text=True,
                                stdin=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                bufsize=buffering)
        return _wrap_close(proc.stdin, proc)
def popen ( cmd , mode = "r" , buffering = - 1 ) : if mode not in ( "r" , "w" ) : raise ValueError ( "invalid mode %r" % mode ) if buffering == 0 or buffering is None : raise ValueError ( "popen() does not support unbuffered streams" ) import subprocess import io if mode == "r" : proc = subprocess . Popen ( cmd , text = True , stdout = subprocess . PIPE , stderr = subprocess . STDOUT , bufsize = buffering ) return _wrap_close ( proc . stdout , proc ) else : proc = subprocess . Popen ( cmd , text = True , stdin = subprocess . PIPE , stderr = subprocess . STDOUT , bufsize = buffering ) return _wrap_close ( proc . stdin , proc )
A custom implementation of popen that redirects STDERR to STDOUT
A custom implementation of popen that redirects STDERR to STDOUT
"""A custom implementation of popen that redirects STDERR to STDOUT

    Args:
        cmd (str): The shell command to execute
        mode (str): The mode as in os.popen
        buffering (int): The buffering ias in os.popen

    Returns:
       The output of the process
    """ # cSpell:ignore bufsize
The output of the process
The output of the process
cmd
The shell command to execute
The shell command to execute
mode
The mode as in os.popen
The mode as in os . popen
buffering
The buffering ias in os.popen
The buffering ias in os . popen