#NEWLINE# def connect( command , data = None , env = None , cwd = None ) : #NEWLINE# #INDENT# 'Spawns a new process from the given command.' #NEWLINE# command_str = expand_args ( command ) . pop ( ) #NEWLINE# environ = dict ( os . environ ) #NEWLINE# environ . update ( ( env or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# process = subprocess . Popen ( command_str , universal_newlines = True , shell = False , env = environ , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE , bufsize = 0 , cwd = cwd ) #NEWLINE# return ConnectedCommand ( process = process )