parameters: (cli_str, timeout=0, usepipes=True, cwd=None)
return_statement: return [out,err]
docstring: There may actually still be references to this function where check_output
     would've been more appropriate.  But I didn't know about check_output at 
     the time...
docstring_summary: There may actually still be references to this function where check_output
     would've been more appropriate.  But I didn't know about check_output at 
     the time...
docstring_tokens: There may actually still be references to this function where check_output would ve been more appropriate . But I didn t know about check_output at the time ...
function: def execAndWait(cli_str, timeout=0, usepipes=True, cwd=None):
     """ 
     There may actually still be references to this function where check_output
     would've been more appropriate.  But I didn't know about check_output at 
     the time...
     """
     if isinstance(cli_str, (list, tuple)):
        cli_str = ' '.join(cli_str)
     print 'Executing:', '"' + cli_str + '"'
     if usepipes:
        process = Popen(cli_str, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True, cwd=cwd)
     else:
        process = Popen(cli_str, shell=True, cwd=cwd)
  
     pid = process.pid
     start = time.time()
     while process.poll() == None:
        time.sleep(0.1)
        if timeout>0 and (time.time() - start)>timeout:
           print 'Process exceeded timeout, killing it'
           killProcess(pid)
     out,err = process.communicate()
     return [out,err]
function_tokens: def execAndWait ( cli_str , timeout = 0 , usepipes = True , cwd = None ) : if isinstance ( cli_str , ( list , tuple ) ) : cli_str = ' ' . join ( cli_str ) print 'Executing:' , '"' + cli_str + '"' if usepipes : process = Popen ( cli_str , stdin = PIPE , stdout = PIPE , stderr = PIPE , shell = True , cwd = cwd ) else : process = Popen ( cli_str , shell = True , cwd = cwd ) pid = process . pid start = time . time ( ) while process . poll ( ) == None : time . sleep ( 0.1 ) if timeout > 0 and ( time . time ( ) - start ) > timeout : print 'Process exceeded timeout, killing it' killProcess ( pid ) out , err = process . communicate ( ) return [ out , err ]