ragtag_utilities/utilities.py
def run_oae(cmd, out, err):
    """ Run a command and redirect stdout/stderr. Append rather than write to err"""

    if not isinstance(out, str) or not isinstance(err, str):
        raise TypeError("out/err should be file names (strings)")

    f_out = open(out, "w")
    f_err = open(err, "a")

    log("INFO", "Running: %s > %s 2> %s" % (" ".join(cmd), out, err))
    if subprocess.call(cmd, stdout=f_out, stderr=f_err) != 0:
        raise RuntimeError('Failed : %s > %s 2> %s. Check stderr file for details.' % (" ".join(cmd), out, err))

    log("INFO", "Finished running : %s > %s 2> %s" % (" ".join(cmd), out, err))

    f_out.close()
    f_err.close()
 Run a command and redirect stdout/stderr. Append rather than write to err
Run a command and redirect stdout/stderr. Append rather than write to err
Run a command and redirect stdout / stderr . Append rather than write to err
def run_oae(cmd, out, err):
    if not isinstance(out, str) or not isinstance(err, str):
        raise TypeError("out/err should be file names (strings)")
    f_out = open(out, "w")
    f_err = open(err, "a")
    log("INFO", "Running: %s > %s 2> %s" % (" ".join(cmd), out, err))
    if subprocess.call(cmd, stdout=f_out, stderr=f_err) != 0:
        raise RuntimeError('Failed : %s > %s 2> %s. Check stderr file for details.' % (" ".join(cmd), out, err))
    log("INFO", "Finished running : %s > %s 2> %s" % (" ".join(cmd), out, err))
    f_out.close()
    f_err.close()
def run_oae ( cmd , out , err ) : if not isinstance ( out , str ) or not isinstance ( err , str ) : raise TypeError ( "out/err should be file names (strings)" ) f_out = open ( out , "w" ) f_err = open ( err , "a" ) log ( "INFO" , "Running: %s > %s 2> %s" % ( " " . join ( cmd ) , out , err ) ) if subprocess . call ( cmd , stdout = f_out , stderr = f_err ) != 0 : raise RuntimeError ( 'Failed : %s > %s 2> %s. Check stderr file for details.' % ( " " . join ( cmd ) , out , err ) ) log ( "INFO" , "Finished running : %s > %s 2> %s" % ( " " . join ( cmd ) , out , err ) ) f_out . close ( ) f_err . close ( )
Run a command and redirect stdout/stderr.
Run a command and redirect stdout / stderr .
""" Run a command and redirect stdout/stderr. Append rather than write to err"""
cmd
out
err