#NEWLINE# def __install_eggs( self , config ) : #NEWLINE# #INDENT# ' Install eggs for a particular configuration ' #NEWLINE# eggs = [ ] #NEWLINE# if config . has ( 'egg' ) : #NEWLINE# #INDENT# eggs += [ config . get ( 'egg' ) ] #NEWLINE# #UNINDENT# if config . has ( 'eggs' ) : #NEWLINE# #INDENT# eggs += [ egg . strip ( ) for egg in re . split ( ',(?!<)|\n' , config . get ( 'eggs' ) ) ] #NEWLINE# #UNINDENT# self . logger . debug ( ( 'Installing eggs %s...' % eggs ) ) #NEWLINE# with open ( os . path . join ( self . directory . install_directory ( self . feature_name ) , 'requirements.txt' ) , 'w+' ) as fh : #NEWLINE# #INDENT# fh . write ( '\n' . join ( eggs ) ) #NEWLINE# #UNINDENT# stdout = ( subprocess . PIPE if config . is_affirmative ( 'redirect_stdout_to_log' , 'true' ) else None ) #NEWLINE# ( return_code , output ) = lib . call ( "PYTHONPATH='' bin/pip install -r requirements.txt --upgrade" , cwd = self . directory . install_directory ( self . feature_name ) , output_log_level = logging . DEBUG , shell = True , stdout = stdout ) #NEWLINE# if ( config . is_affirmative ( 'fail_on_error' , True ) and ( return_code != 0 ) ) : #NEWLINE# #INDENT# raise EggscriptFormulaException ( 'Egg script {name} returned a return code of {code}!' . format ( name = self . feature_name , code = fh ) )