docs: def _AsynchronouslyGetProcessOutput(formattedCmd, printStdOut, printStdErr, **kwargs):
      ''' Asynchronously read the process '''
      opts = filterKWArgsForFunc(kwargs, subprocess.Popen)
      opts['stdout'] = subprocess.PIPE
      opts['stderr'] = subprocess.PIPE
      process = subprocess.Popen(formattedCmd, **opts)
  
      # Launch the asynchronous readers of the process' stdout and stderr.
      stdout_queue = Queue.Queue()
      stdout_reader = _AsynchronousFileReader(process.stdout, stdout_queue)
      stdout_reader.start()
      stderr_queue = Queue.Queue()
      stderr_reader = _AsynchronousFileReader(process.stderr, stderr_queue)
      stderr_reader.start()
  
      stdOutLines = []
      stdErrLines = []
      # Check the queues if we received some output (until there is nothing more to get).
      while not stdout_reader.eof() or not stderr_reader.eof():
          # Show what we received from standard output.
          while not stdout_queue.empty():
              line = stdout_queue.get()
              stdOutLines.append(line)
              if printStdOut:
                  print line.rstrip()
   
          # Show what we received from standard error.
          while not stderr_queue.empty():
              line = stderr_queue.get()
              stdErrLines.append(line)
              if printStdErr:
                  print colored(line.rstrip(),'red')
   
          # Sleep a bit before asking the readers again.
          time.sleep(.05)
   
      # Let's be tidy and join the threads we've started.
      stdout_reader.join()
      stderr_reader.join()
   
      # Close subprocess' file descriptors.
      process.stdout.close()
      process.stderr.close()
      process.wait()
  
      stdOut = ''.join(stdOutLines)
      stdErr = ''.join(stdErrLines)
      return (process.returncode, stdOut, stdErr)