How to use the pyflow.src.pyflowTaskWrapper.SimpleFifo function in pyflow

To help you get started, we’ve selected a few pyflow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Illumina / pyflow / pyflow / src / pyflowTaskWrapper.py View on Github external
raise
            time.sleep(retryDelaySec)
            continue
        break

    if params.cmd is None :
        badUsage("Invalid TaskWrapper input: task command set to NONE")

    if params.cwd == "" or params.cwd == "None" :
        params.cwd = None

    toutFp = open(params.outFile, "a")
    terrFp = open(params.errFile, "a")

    # always keep last N lines of task stderr:
    fifo = SimpleFifo(40)

    isWin=isWindows()

    # Present shell as arg list with Popen(shell=False), so that
    # we minimize quoting/escaping issues for 'cmd' itself:
    #
    fullcmd = []
    if (not isWin) and params.isShellCmd :
        # TODO shell selection should be configurable somewhere:
        shell = ["/bin/bash", "--noprofile", "-o", "pipefail"]
        fullcmd = shell + ["-c", params.cmd]
    else :
        fullcmd = params.cmd

    retval = 1