#NEWLINE# def run_python_script( script , env , config , required_env = None ) : #NEWLINE# #INDENT# if required_env : #NEWLINE# #INDENT# check_required_env ( env , required_env ) #NEWLINE# #UNINDENT# p = sarge . Command ( ( 'python %s/ci/%s' % ( config . cumulusci_path , script ) ) , stdout = sarge . Capture ( buffer_size = ( - 1 ) ) , env = env ) #NEWLINE# p . run ( async = True ) #NEWLINE# log = [ ] #NEWLINE# while ( script . returncode is None ) : #NEWLINE# #INDENT# for line in p . stdout : #NEWLINE# #INDENT# log . append ( line . rstrip ( ) ) #NEWLINE# click . echo ( line . rstrip ( ) ) #NEWLINE# #UNINDENT# p . poll ( ) #NEWLINE# #UNINDENT# return p