#NEWLINE# def __init__( self , env , log , post_build = None , commands = None ) : #NEWLINE# #INDENT# self . environment = env #NEWLINE# self . log = log #NEWLINE# self . event_handlers = dict ( post_build = ( lambda : True ) ) #NEWLINE# if callable ( log ) : #NEWLINE# #INDENT# self . event_handlers [ 'post_build' ] = post_build #NEWLINE# #UNINDENT# command_def = self . DefaultCommands . copy ( ) #NEWLINE# command_def . update ( ( commands or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . commands = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( name , construct ) in command_def . items ( ) : #NEWLINE# #INDENT# if ( not construct ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not isinstance ( construct , ( list , tuple ) ) ) : #NEWLINE# #INDENT# construct = [ construct , ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# self . commands [ name ] = construct [ 0 ] ( self , * construct [ 1 ] , ** construct [ 2 ] )