#NEWLINE# def run( self , config , args ) : #NEWLINE# #INDENT# if ( not config . use_procfile ) : #NEWLINE# #INDENT# raise RuntimeError ( 'procfile not found' ) #NEWLINE# #UNINDENT# concurrency = self . parse_concurrency ( args ) #NEWLINE# m = Manager ( ) #NEWLINE# m . start ( apps = [ SigHandler ( ) , ConsoleOutput ( ) ] ) #NEWLINE# if args [ '-v' ] : #NEWLINE# #INDENT# redirect_output = [ 'out' , 'err' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# redirect_output = [ ] #NEWLINE# #UNINDENT# if args [ '<job>' ] : #NEWLINE# #INDENT# name = args [ '<job>' ] #NEWLINE# cmd_str = config . procfile . cfg [ name ] #NEWLINE# ( cmd , cmd_args ) = config . procfile . parse_cmd ( cmd_str ) #NEWLINE# appname = config . procfile . get_appname ( ) #NEWLINE# params = dict ( args = cmd_args , env = config . procfile . env , numprocesses = concurrency . get ( name , 1 ) , redirect_output = redirect_output ) #NEWLINE# pconfig = ProcessConfig ( name , cmd , ** params ) #NEWLINE# m . load ( pconfig , sessionid = appname ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# appname = config . procfile . get_appname ( ) #NEWLINE# for ( name , cmd_str ) in config . procfile . processes ( ) : #NEWLINE# #INDENT# ( cmd , cmd_args ) = config . procfile . parse_cmd ( cmd_str ) #NEWLINE# params = dict ( args = cmd_args , env = params . procfile . env , numprocesses = concurrency . get ( name , 1 ) , redirect_output = redirect_output ) #NEWLINE# pconfig = ProcessConfig ( name , cmd , ** params ) #NEWLINE# m . load ( pconfig , sessionid = appname ) #NEWLINE# #UNINDENT# #UNINDENT# m . run ( )