<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import copy <EOL> import os <EOL> import sys <EOL> import re <EOL> import shlex <EOL> from collections import UserDict <EOL> import SCons . Action <EOL> import SCons . Builder <EOL> import SCons . Debug <EOL> from SCons . Debug import logInstanceCreation <EOL> import SCons . Defaults <EOL> import SCons . Errors <EOL> import SCons . Memoize <EOL> import SCons . Node <EOL> import SCons . Node . Alias <EOL> import SCons . Node . FS <EOL> import SCons . Node . Python <EOL> import SCons . Platform <EOL> import SCons . SConf <EOL> import SCons . SConsign <EOL> import SCons . Subst <EOL> import SCons . Tool <EOL> import SCons . Util <EOL> import SCons . Warnings <EOL> class _Null ( object ) : <EOL> pass <EOL> _null = _Null <EOL> _warn_copy_deprecated = True <EOL> _warn_source_signatures_deprecated = True <EOL> _warn_target_signatures_deprecated = True <EOL> CleanTargets = { } <EOL> CalculatorArgs = { } <EOL> semi_deepcopy = SCons . Util . semi_deepcopy <EOL> semi_deepcopy_dict = SCons . Util . semi_deepcopy_dict <EOL> UserError = SCons . Errors . UserError <EOL> def alias_builder ( env , target , source ) : <EOL> pass <EOL> AliasBuilder = SCons . Builder . Builder ( action = alias_builder , <EOL> target_factory = SCons . Node . Alias . default_ans . Alias , <EOL> source_factory = SCons . Node . FS . Entry , <EOL> multi = <NUM_LIT:1> , <EOL> is_explicit = None , <EOL> name = '<STR_LIT>' ) <EOL> def apply_tools ( env , tools , toolpath ) : <EOL> if toolpath is not None : <EOL> env [ '<STR_LIT>' ] = toolpath <EOL> if not tools : <EOL> return <EOL> for tool in [ _f for _f in tools if _f ] : <EOL> if SCons . Util . is_List ( tool ) or isinstance ( tool , tuple ) : <EOL> toolname = tool [ <NUM_LIT:0> ] <EOL> toolargs = tool [ <NUM_LIT:1> ] <EOL> tool = env . Tool ( toolname , ** toolargs ) <EOL> else : <EOL> env . Tool ( tool ) <EOL> reserved_construction_var_names = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> future_reserved_construction_var_names = [ <EOL> ] <EOL> def copy_non_reserved_keywords ( dict ) : <EOL> result = semi_deepcopy ( dict ) <EOL> for k in result . keys ( ) : <EOL> if k in reserved_construction_var_names : <EOL> msg = "<STR_LIT>" <EOL> SCons . Warnings . warn ( SCons . Warnings . ReservedVariableWarning , msg % k ) <EOL> del result [ k ] <EOL> return result <EOL> def _set_reserved ( env , key , value ) : <EOL> msg = "<STR_LIT>" <EOL> SCons . Warnings . warn ( SCons . Warnings . ReservedVariableWarning , msg % key ) <EOL> def _set_future_reserved ( env , key , value ) : <EOL> env . _dict [ key ] = value <EOL> msg = "<STR_LIT>" <EOL> SCons . Warnings . warn ( SCons . Warnings . FutureReservedVariableWarning , msg % key ) <EOL> def _set_BUILDERS ( env , key , value ) : <EOL> try : <EOL> bd = env . _dict [ key ] <EOL> for k in bd . keys ( ) : <EOL> del bd [ k ] <EOL> except KeyError : <EOL> bd = BuilderDict ( kwbd , env ) <EOL> env . _dict [ key ] = bd <EOL> for k , v in value . items ( ) : <EOL> if not SCons . Builder . is_a_Builder ( v ) : <EOL> raise SCons . Errors . UserError ( '<STR_LIT>' % repr ( v ) ) <EOL> bd . update ( value ) <EOL> def _del_SCANNERS ( env , key ) : <EOL> del env . _dict [ key ] <EOL> env . scanner_map_delete ( ) <EOL> def _set_SCANNERS ( env , key , value ) : <EOL> env . _dict [ key ] = value <EOL> env . scanner_map_delete ( ) <EOL> def _delete_duplicates ( l , keep_last ) : <EOL> """<STR_LIT>""" <EOL> seen = { } <EOL> result = [ ] <EOL> if keep_last : <EOL> l . reverse ( ) <EOL> for i in l : <EOL> try : <EOL> if i not in seen : <EOL> result . append ( i ) <EOL> seen [ i ] = <NUM_LIT:1> <EOL> except TypeError : <EOL> result . append ( i ) <EOL> if keep_last : <EOL> result . reverse ( ) <EOL> return result <EOL> class MethodWrapper ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , object , method , name = None ) : <EOL> if name is None : <EOL> name = method . __name__ <EOL> self . object = object <EOL> self . method = method <EOL> self . name = name <EOL> setattr ( self . object , name , self ) <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> nargs = ( self . object , ) + args <EOL> return self . method ( * nargs , ** kwargs ) <EOL> def clone ( self , new_object ) : <EOL> """<STR_LIT>""" <EOL> return self . __class__ ( new_object , self . method , self . name ) <EOL> class BuilderWrapper ( MethodWrapper ) : <EOL> """<STR_LIT>""" <EOL> def __call__ ( self , target = None , source = _null , * args , ** kw ) : <EOL> if source is _null : <EOL> source = target <EOL> target = None <EOL> if target is not None and not SCons . Util . is_List ( target ) : <EOL> target = [ target ] <EOL> if source is not None and not SCons . Util . is_List ( source ) : <EOL> source = [ source ] <EOL> return MethodWrapper . __call__ ( self , target , source , * args , ** kw ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % repr ( self . name ) <EOL> def __str__ ( self ) : <EOL> return self . __repr__ ( ) <EOL> def __getattr__ ( self , name ) : <EOL> if name == '<STR_LIT>' : <EOL> return self . object <EOL> elif name == '<STR_LIT>' : <EOL> return self . method <EOL> else : <EOL> raise AttributeError ( name ) <EOL> def __setattr__ ( self , name , value ) : <EOL> if name == '<STR_LIT>' : <EOL> self . object = value <EOL> elif name == '<STR_LIT>' : <EOL> self . method = value <EOL> else : <EOL> self . __dict__ [ name ] = value <EOL> class BuilderDict ( UserDict ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dict , env ) : <EOL> self . env = env <EOL> UserDict . __init__ ( self , dict ) <EOL> def __semi_deepcopy__ ( self ) : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> def __setitem__ ( self , item , val ) : <EOL> try : <EOL> method = getattr ( self . env , item ) . method <EOL> except AttributeError : <EOL> pass <EOL> else : <EOL> self . env . RemoveMethod ( method ) <EOL> UserDict . __setitem__ ( self , item , val ) <EOL> BuilderWrapper ( self . env , val , item ) <EOL> def __delitem__ ( self , item ) : <EOL> UserDict . __delitem__ ( self , item ) <EOL> delattr ( self . env , item ) <EOL> def update ( self , dict ) : <EOL> for i , v in dict . items ( ) : <EOL> self . __setitem__ ( i , v ) <EOL> _is_valid_var = re . compile ( r'<STR_LIT>' ) <EOL> def is_valid_construction_var ( varstr ) : <EOL> """<STR_LIT>""" <EOL> return _is_valid_var . match ( varstr ) <EOL> class SubstitutionEnvironment ( object ) : <EOL> """<STR_LIT>""" <EOL> if SCons . Memoize . use_memoizer : <EOL> __metaclass__ = SCons . Memoize . Memoized_Metaclass <EOL> def __init__ ( self , ** kw ) : <EOL> """<STR_LIT>""" <EOL> if SCons . Debug . track_instances : logInstanceCreation ( self , '<STR_LIT>' ) <EOL> self . fs = SCons . Node . FS . get_default_fs ( ) <EOL> self . ans = SCons . Node . Alias . default_ans <EOL> self . lookup_list = SCons . Node . arg2nodes_lookups <EOL> self . _dict = kw . copy ( ) <EOL> self . _init_special ( ) <EOL> self . added_methods = [ ] <EOL> def _init_special ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _special_del = { } <EOL> self . _special_del [ '<STR_LIT>' ] = _del_SCANNERS <EOL> self . _special_set = { } <EOL> for key in reserved_construction_var_names : <EOL> self . _special_set [ key ] = _set_reserved <EOL> for key in future_reserved_construction_var_names : <EOL> self . _special_set [ key ] = _set_future_reserved <EOL> self . _special_set [ '<STR_LIT>' ] = _set_BUILDERS <EOL> self . _special_set [ '<STR_LIT>' ] = _set_SCANNERS <EOL> self . _special_set_keys = list ( self . _special_set . keys ( ) ) <EOL> def __cmp__ ( self , other ) : <EOL> return cmp ( self . _dict , other . _dict ) <EOL> def __delitem__ ( self , key ) : <EOL> special = self . _special_del . get ( key ) <EOL> if special : <EOL> special ( self , key ) <EOL> else : <EOL> del self . _dict [ key ] <EOL> def __getitem__ ( self , key ) : <EOL> return self . _dict [ key ] <EOL> def __setitem__ ( self , key , value ) : <EOL> if key in self . _special_set_keys : <EOL> self . _special_set [ key ] ( self , key , value ) <EOL> else : <EOL> if key not in self . _dict and not _is_valid_var . match ( key ) : <EOL> raise SCons . Errors . UserError ( "<STR_LIT>" % key ) <EOL> self . _dict [ key ] = value <EOL> def get ( self , key , default = None ) : <EOL> """<STR_LIT>""" <EOL> return self . _dict . get ( key , default ) <EOL> def has_key ( self , key ) : <EOL> return key in self . _dict <EOL> def __contains__ ( self , key ) : <EOL> return self . _dict . __contains__ ( key ) <EOL> def items ( self ) : <EOL> return list ( self . _dict . items ( ) ) <EOL> def arg2nodes ( self , args , node_factory = _null , lookup_list = _null , ** kw ) : <EOL> if node_factory is _null : <EOL> node_factory = self . fs . File <EOL> if lookup_list is _null : <EOL> lookup_list = self . lookup_list <EOL> if not args : <EOL> return [ ] <EOL> args = SCons . Util . flatten ( args ) <EOL> nodes = [ ] <EOL> for v in args : <EOL> if SCons . Util . is_String ( v ) : <EOL> n = None <EOL> for l in lookup_list : <EOL> n = l ( v ) <EOL> if n is not None : <EOL> break <EOL> if n is not None : <EOL> if SCons . Util . is_String ( n ) : <EOL> kw [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> n = self . subst ( n , ** kw ) <EOL> if node_factory : <EOL> n = node_factory ( n ) <EOL> if SCons . Util . is_List ( n ) : <EOL> nodes . extend ( n ) <EOL> else : <EOL> nodes . append ( n ) <EOL> elif node_factory : <EOL> kw [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> v = node_factory ( self . subst ( v , ** kw ) ) <EOL> if SCons . Util . is_List ( v ) : <EOL> nodes . extend ( v ) <EOL> else : <EOL> nodes . append ( v ) <EOL> else : <EOL> nodes . append ( v ) <EOL> return nodes <EOL> def gvars ( self ) : <EOL> return self . _dict <EOL> def lvars ( self ) : <EOL> return { } <EOL> def subst ( self , string , raw = <NUM_LIT:0> , target = None , source = None , conv = None , executor = None ) : <EOL> """<STR_LIT>""" <EOL> gvars = self . gvars ( ) <EOL> lvars = self . lvars ( ) <EOL> lvars [ '<STR_LIT>' ] = self <EOL> if executor : <EOL> lvars . update ( executor . get_lvars ( ) ) <EOL> return SCons . Subst . scons_subst ( string , self , raw , target , source , gvars , lvars , conv ) <EOL> def subst_kw ( self , kw , raw = <NUM_LIT:0> , target = None , source = None ) : <EOL> nkw = { } <EOL> for k , v in kw . items ( ) : <EOL> k = self . subst ( k , raw , target , source ) <EOL> if SCons . Util . is_String ( v ) : <EOL> v = self . subst ( v , raw , target , source ) <EOL> nkw [ k ] = v <EOL> return nkw <EOL> def subst_list ( self , string , raw = <NUM_LIT:0> , target = None , source = None , conv = None , executor = None ) : <EOL> """<STR_LIT>""" <EOL> gvars = self . gvars ( ) <EOL> lvars = self . lvars ( ) <EOL> lvars [ '<STR_LIT>' ] = self <EOL> if executor : <EOL> lvars . update ( executor . get_lvars ( ) ) <EOL> return SCons . Subst . scons_subst_list ( string , self , raw , target , source , gvars , lvars , conv ) <EOL> def subst_path ( self , path , target = None , source = None ) : <EOL> """<STR_LIT>""" <EOL> if not SCons . Util . is_List ( path ) : <EOL> path = [ path ] <EOL> def s ( obj ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> get = obj . get <EOL> except AttributeError : <EOL> obj = SCons . Util . to_String_for_subst ( obj ) <EOL> else : <EOL> obj = get ( ) <EOL> return obj <EOL> r = [ ] <EOL> for p in path : <EOL> if SCons . Util . is_String ( p ) : <EOL> p = self . subst ( p , target = target , source = source , conv = s ) <EOL> if SCons . Util . is_List ( p ) : <EOL> if len ( p ) == <NUM_LIT:1> : <EOL> p = p [ <NUM_LIT:0> ] <EOL> else : <EOL> p = '<STR_LIT>' . join ( map ( SCons . Util . to_String_for_subst , p ) ) <EOL> else : <EOL> p = s ( p ) <EOL> r . append ( p ) <EOL> return r <EOL> subst_target_source = subst <EOL> def backtick ( self , command ) : <EOL> import subprocess <EOL> kw = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : subprocess . PIPE , <EOL> '<STR_LIT>' : subprocess . PIPE , <EOL> '<STR_LIT>' : True , <EOL> } <EOL> if not SCons . Util . is_List ( command ) : kw [ '<STR_LIT>' ] = True <EOL> p = SCons . Action . _subproc ( self , command , ** kw ) <EOL> out , err = p . communicate ( ) <EOL> status = p . wait ( ) <EOL> if err : <EOL> sys . stderr . write ( unicode ( err ) ) <EOL> if status : <EOL> raise OSError ( "<STR_LIT>" % ( command , status ) ) <EOL> return out <EOL> def AddMethod ( self , function , name = None ) : <EOL> """<STR_LIT>""" <EOL> method = MethodWrapper ( self , function , name ) <EOL> self . added_methods . append ( method ) <EOL> def RemoveMethod ( self , function ) : <EOL> """<STR_LIT>""" <EOL> self . added_methods = [ dm for dm in self . added_methods if not dm . method is function ] <EOL> def Override ( self , overrides ) : <EOL> """<STR_LIT>""" <EOL> if not overrides : return self <EOL> o = copy_non_reserved_keywords ( overrides ) <EOL> if not o : return self <EOL> overrides = { } <EOL> merges = None <EOL> for key , value in o . items ( ) : <EOL> if key == '<STR_LIT>' : <EOL> merges = value <EOL> else : <EOL> overrides [ key ] = SCons . Subst . scons_subst_once ( value , self , key ) <EOL> env = OverrideEnvironment ( self , overrides ) <EOL> if merges : env . MergeFlags ( merges ) <EOL> return env <EOL> def ParseFlags ( self , * flags ) : <EOL> """<STR_LIT>""" <EOL> dict = { <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : SCons . Util . CLVar ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : [ ] , <EOL> } <EOL> def do_parse ( arg ) : <EOL> if not arg : <EOL> return <EOL> if not SCons . Util . is_String ( arg ) : <EOL> for t in arg : do_parse ( t ) <EOL> return <EOL> if arg [ <NUM_LIT:0> ] == '<STR_LIT:!>' : <EOL> arg = self . backtick ( arg [ <NUM_LIT:1> : ] ) <EOL> def append_define ( name , dict = dict ) : <EOL> t = name . split ( '<STR_LIT:=>' ) <EOL> if len ( t ) == <NUM_LIT:1> : <EOL> dict [ '<STR_LIT>' ] . append ( name ) <EOL> else : <EOL> dict [ '<STR_LIT>' ] . append ( [ t [ <NUM_LIT:0> ] , '<STR_LIT:=>' . join ( t [ <NUM_LIT:1> : ] ) ] ) <EOL> params = shlex . split ( arg ) <EOL> append_next_arg_to = None <EOL> for arg in params : <EOL> if append_next_arg_to : <EOL> if append_next_arg_to == '<STR_LIT>' : <EOL> append_define ( arg ) <EOL> elif append_next_arg_to == '<STR_LIT>' : <EOL> t = ( '<STR_LIT>' , self . fs . File ( arg ) ) <EOL> dict [ '<STR_LIT>' ] . append ( t ) <EOL> elif append_next_arg_to == '<STR_LIT>' : <EOL> t = ( '<STR_LIT>' , arg ) <EOL> dict [ '<STR_LIT>' ] . append ( t ) <EOL> dict [ '<STR_LIT>' ] . append ( t ) <EOL> elif append_next_arg_to == '<STR_LIT>' : <EOL> t = ( '<STR_LIT>' , arg ) <EOL> dict [ '<STR_LIT>' ] . append ( t ) <EOL> dict [ '<STR_LIT>' ] . append ( t ) <EOL> else : <EOL> dict [ append_next_arg_to ] . append ( arg ) <EOL> append_next_arg_to = None <EOL> elif not arg [ <NUM_LIT:0> ] in [ '<STR_LIT:->' , '<STR_LIT:+>' ] : <EOL> dict [ '<STR_LIT>' ] . append ( self . fs . File ( arg ) ) <EOL> elif arg == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg [ : <NUM_LIT:2> ] == '<STR_LIT>' : <EOL> if arg [ <NUM_LIT:2> : ] : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:2> : ] ) <EOL> else : <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg [ : <NUM_LIT:2> ] == '<STR_LIT>' : <EOL> if arg [ <NUM_LIT:2> : ] : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:2> : ] ) <EOL> else : <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg [ : <NUM_LIT:2> ] == '<STR_LIT>' : <EOL> if arg [ <NUM_LIT:2> : ] : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:2> : ] ) <EOL> else : <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg [ : <NUM_LIT:4> ] == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:4> : ] ) <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> elif arg [ : <NUM_LIT:4> ] == '<STR_LIT>' : <EOL> if arg [ : <NUM_LIT:11> ] == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:11> : ] ) <EOL> elif arg [ : <NUM_LIT:7> ] == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:7> : ] ) <EOL> elif arg [ : <NUM_LIT:6> ] == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:6> : ] ) <EOL> else : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> elif arg [ : <NUM_LIT:4> ] == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> elif arg [ : <NUM_LIT:2> ] == '<STR_LIT>' : <EOL> if arg [ <NUM_LIT:2> : ] : <EOL> append_define ( arg [ <NUM_LIT:2> : ] ) <EOL> else : <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg == '<STR_LIT>' : <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg [ : <NUM_LIT> ] == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT> : ] ) <EOL> elif arg [ : <NUM_LIT:2> ] == '<STR_LIT>' : <EOL> if arg [ <NUM_LIT:2> : ] : <EOL> dict [ '<STR_LIT>' ] . append ( arg [ <NUM_LIT:2> : ] ) <EOL> else : <EOL> append_next_arg_to = '<STR_LIT>' <EOL> elif arg in [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> elif arg == '<STR_LIT>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> elif arg [ : <NUM_LIT:5> ] == '<STR_LIT>' : <EOL> if arg [ <NUM_LIT:5> : ] . find ( '<STR_LIT>' ) != - <NUM_LIT:1> : <EOL> key = '<STR_LIT>' <EOL> else : <EOL> key = '<STR_LIT>' <EOL> dict [ key ] . append ( arg ) <EOL> elif arg [ <NUM_LIT:0> ] == '<STR_LIT:+>' : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> elif arg in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> append_next_arg_to = arg <EOL> else : <EOL> dict [ '<STR_LIT>' ] . append ( arg ) <EOL> for arg in flags : <EOL> do_parse ( arg ) <EOL> return dict <EOL> def MergeFlags ( self , args , unique = <NUM_LIT:1> , dict = None ) : <EOL> """<STR_LIT>""" <EOL> if dict is None : <EOL> dict = self <EOL> if not SCons . Util . is_Dict ( args ) : <EOL> args = self . ParseFlags ( args ) <EOL> if not unique : <EOL> self . Append ( ** args ) <EOL> return self <EOL> for key , value in args . items ( ) : <EOL> if not value : <EOL> continue <EOL> try : <EOL> orig = self [ key ] <EOL> except KeyError : <EOL> orig = value <EOL> else : <EOL> if not orig : <EOL> orig = value <EOL> elif value : <EOL> try : <EOL> orig = orig + value <EOL> except ( KeyError , TypeError ) : <EOL> try : <EOL> add_to_orig = orig . append <EOL> except AttributeError : <EOL> value . insert ( <NUM_LIT:0> , orig ) <EOL> orig = value <EOL> else : <EOL> add_to_orig ( value ) <EOL> t = [ ] <EOL> if key [ - <NUM_LIT:4> : ] == '<STR_LIT>' : <EOL> for v in orig : <EOL> if v not in t : <EOL> t . append ( v ) <EOL> else : <EOL> orig . reverse ( ) <EOL> for v in orig : <EOL> if v not in t : <EOL> t . insert ( <NUM_LIT:0> , v ) <EOL> self [ key ] = t <EOL> return self <EOL> def default_decide_source ( dependency , target , prev_ni ) : <EOL> f = SCons . Defaults . DefaultEnvironment ( ) . decide_source <EOL> return f ( dependency , target , prev_ni ) <EOL> def default_decide_target ( dependency , target , prev_ni ) : <EOL> f = SCons . Defaults . DefaultEnvironment ( ) . decide_target <EOL> return f ( dependency , target , prev_ni ) <EOL> def default_copy_from_cache ( src , dst ) : <EOL> f = SCons . Defaults . DefaultEnvironment ( ) . copy_from_cache <EOL> return f ( src , dst ) <EOL> class Base ( SubstitutionEnvironment ) : <EOL> """<STR_LIT>""" <EOL> memoizer_counters = [ ] <EOL> def __init__ ( self , <EOL> platform = None , <EOL> tools = None , <EOL> toolpath = None , <EOL> variables = None , <EOL> parse_flags = None , <EOL> ** kw ) : <EOL> """<STR_LIT>""" <EOL> if SCons . Debug . track_instances : logInstanceCreation ( self , '<STR_LIT>' ) <EOL> self . _memo = { } <EOL> self . fs = SCons . Node . FS . get_default_fs ( ) <EOL> self . ans = SCons . Node . Alias . default_ans <EOL> self . lookup_list = SCons . Node . arg2nodes_lookups <EOL> self . _dict = semi_deepcopy ( SCons . Defaults . ConstructionEnvironment ) <EOL> self . _init_special ( ) <EOL> self . added_methods = [ ] <EOL> self . decide_target = default_decide_target <EOL> self . decide_source = default_decide_source <EOL> self . copy_from_cache = default_copy_from_cache <EOL> self . _dict [ '<STR_LIT>' ] = BuilderDict ( self . _dict [ '<STR_LIT>' ] , self ) <EOL> if platform is None : <EOL> platform = self . _dict . get ( '<STR_LIT>' , None ) <EOL> if platform is None : <EOL> platform = SCons . Platform . Platform ( ) <EOL> if SCons . Util . is_String ( platform ) : <EOL> platform = SCons . Platform . Platform ( platform ) <EOL> self . _dict [ '<STR_LIT>' ] = str ( platform ) <EOL> platform ( self ) <EOL> self . _dict [ '<STR_LIT>' ] = self . _dict . get ( '<STR_LIT>' , None ) <EOL> self . _dict [ '<STR_LIT>' ] = self . _dict . get ( '<STR_LIT>' , None ) <EOL> self . _dict [ '<STR_LIT>' ] = self . _dict . get ( '<STR_LIT>' , None ) <EOL> self . _dict [ '<STR_LIT>' ] = self . _dict . get ( '<STR_LIT>' , None ) <EOL> if '<STR_LIT>' in kw : <EOL> variables = kw [ '<STR_LIT>' ] <EOL> del kw [ '<STR_LIT>' ] <EOL> self . Replace ( ** kw ) <EOL> keys = list ( kw . keys ( ) ) <EOL> if variables : <EOL> keys = keys + list ( variables . keys ( ) ) <EOL> variables . Update ( self ) <EOL> save = { } <EOL> for k in keys : <EOL> try : <EOL> save [ k ] = self . _dict [ k ] <EOL> except KeyError : <EOL> pass <EOL> SCons . Tool . Initializers ( self ) <EOL> if tools is None : <EOL> tools = self . _dict . get ( '<STR_LIT>' , None ) <EOL> if tools is None : <EOL> tools = [ '<STR_LIT:default>' ] <EOL> apply_tools ( self , tools , toolpath ) <EOL> for key , val in save . items ( ) : <EOL> self . _dict [ key ] = val <EOL> if parse_flags : self . MergeFlags ( parse_flags ) <EOL> def get_builder ( self , name ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return self . _dict [ '<STR_LIT>' ] [ name ] <EOL> except KeyError : <EOL> return None <EOL> def get_CacheDir ( self ) : <EOL> try : <EOL> path = self . _CacheDir_path <EOL> except AttributeError : <EOL> path = SCons . Defaults . DefaultEnvironment ( ) . _CacheDir_path <EOL> try : <EOL> if path == self . _last_CacheDir_path : <EOL> return self . _last_CacheDir <EOL> except AttributeError : <EOL> pass <EOL> cd = SCons . CacheDir . CacheDir ( path ) <EOL> self . _last_CacheDir_path = path <EOL> self . _last_CacheDir = cd <EOL> return cd <EOL> def get_factory ( self , factory , default = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> name = default <EOL> try : <EOL> is_node = issubclass ( factory , SCons . Node . FS . Base ) <EOL> except TypeError : <EOL> pass <EOL> else : <EOL> if is_node : <EOL> try : name = factory . __name__ <EOL> except AttributeError : pass <EOL> else : factory = None <EOL> if not factory : <EOL> factory = getattr ( self . fs , name ) <EOL> return factory <EOL> memoizer_counters . append ( SCons . Memoize . CountValue ( '<STR_LIT>' ) ) <EOL> def _gsm ( self ) : <EOL> try : <EOL> return self . _memo [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> result = { } <EOL> try : <EOL> scanners = self . _dict [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> else : <EOL> if not SCons . Util . is_List ( scanners ) : <EOL> scanners = [ scanners ] <EOL> else : <EOL> scanners = scanners [ : ] <EOL> scanners . reverse ( ) <EOL> for scanner in scanners : <EOL> for k in scanner . get_skeys ( self ) : <EOL> if k and self [ '<STR_LIT>' ] == '<STR_LIT:win32>' : <EOL> k = k . lower ( ) <EOL> result [ k ] = scanner <EOL> self . _memo [ '<STR_LIT>' ] = result <EOL> return result <EOL> def get_scanner ( self , skey ) : <EOL> """<STR_LIT>""" <EOL> if skey and self [ '<STR_LIT>' ] == '<STR_LIT:win32>' : <EOL> skey = skey . lower ( ) <EOL> return self . _gsm ( ) . get ( skey ) <EOL> def scanner_map_delete ( self , kw = None ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> del self . _memo [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> def _update ( self , dict ) : <EOL> """<STR_LIT>""" <EOL> self . _dict . update ( dict ) <EOL> def get_src_sig_type ( self ) : <EOL> try : <EOL> return self . src_sig_type <EOL> except AttributeError : <EOL> t = SCons . Defaults . DefaultEnvironment ( ) . src_sig_type <EOL> self . src_sig_type = t <EOL> return t <EOL> def get_tgt_sig_type ( self ) : <EOL> try : <EOL> return self . tgt_sig_type <EOL> except AttributeError : <EOL> t = SCons . Defaults . DefaultEnvironment ( ) . tgt_sig_type <EOL> self . tgt_sig_type = t <EOL> return t <EOL> def Append ( self , ** kw ) : <EOL> """<STR_LIT>""" <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> for key , val in kw . items ( ) : <EOL> try : <EOL> if key == '<STR_LIT>' and SCons . Util . is_String ( self . _dict [ key ] ) : <EOL> self . _dict [ key ] = [ self . _dict [ key ] ] <EOL> orig = self . _dict [ key ] <EOL> except KeyError : <EOL> if key == '<STR_LIT>' and SCons . Util . is_String ( val ) : <EOL> self . _dict [ key ] = [ val ] <EOL> else : <EOL> self . _dict [ key ] = val <EOL> else : <EOL> try : <EOL> update_dict = orig . update <EOL> except AttributeError : <EOL> try : <EOL> self . _dict [ key ] = orig + val <EOL> except ( KeyError , TypeError ) : <EOL> try : <EOL> add_to_orig = orig . append <EOL> except AttributeError : <EOL> if orig : <EOL> val . insert ( <NUM_LIT:0> , orig ) <EOL> self . _dict [ key ] = val <EOL> else : <EOL> if val : <EOL> add_to_orig ( val ) <EOL> else : <EOL> if SCons . Util . is_List ( val ) : <EOL> if key == '<STR_LIT>' : <EOL> orig = orig . items ( ) <EOL> orig += val <EOL> self . _dict [ key ] = orig <EOL> else : <EOL> for v in val : <EOL> orig [ v ] = None <EOL> else : <EOL> try : <EOL> update_dict ( val ) <EOL> except ( AttributeError , TypeError , ValueError ) : <EOL> if SCons . Util . is_Dict ( val ) : <EOL> for k , v in val . items ( ) : <EOL> orig [ k ] = v <EOL> else : <EOL> orig [ val ] = None <EOL> self . scanner_map_delete ( kw ) <EOL> def _canonicalize ( self , path ) : <EOL> if not SCons . Util . is_String ( path ) : <EOL> path = str ( path ) <EOL> if path and path [ <NUM_LIT:0> ] == '<STR_LIT:#>' : <EOL> path = str ( self . fs . Dir ( path ) ) <EOL> return path <EOL> def AppendENVPath ( self , name , newpath , envname = '<STR_LIT>' , <EOL> sep = os . pathsep , delete_existing = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> orig = '<STR_LIT>' <EOL> if envname in self . _dict and name in self . _dict [ envname ] : <EOL> orig = self . _dict [ envname ] [ name ] <EOL> nv = SCons . Util . AppendPath ( orig , newpath , sep , delete_existing , <EOL> canonicalize = self . _canonicalize ) <EOL> if envname not in self . _dict : <EOL> self . _dict [ envname ] = { } <EOL> self . _dict [ envname ] [ name ] = nv <EOL> def AppendUnique ( self , delete_existing = <NUM_LIT:0> , ** kw ) : <EOL> """<STR_LIT>""" <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> for key , val in kw . items ( ) : <EOL> if SCons . Util . is_List ( val ) : <EOL> val = _delete_duplicates ( val , delete_existing ) <EOL> if key not in self . _dict or self . _dict [ key ] in ( '<STR_LIT>' , None ) : <EOL> self . _dict [ key ] = val <EOL> elif SCons . Util . is_Dict ( self . _dict [ key ] ) and SCons . Util . is_Dict ( val ) : <EOL> self . _dict [ key ] . update ( val ) <EOL> elif SCons . Util . is_List ( val ) : <EOL> dk = self . _dict [ key ] <EOL> if key == '<STR_LIT>' : <EOL> tmp = [ ] <EOL> for i in val : <EOL> if SCons . Util . is_List ( i ) : <EOL> if len ( i ) >= <NUM_LIT:2> : <EOL> tmp . append ( ( i [ <NUM_LIT:0> ] , i [ <NUM_LIT:1> ] ) ) <EOL> else : <EOL> tmp . append ( ( i [ <NUM_LIT:0> ] , ) ) <EOL> elif SCons . Util . is_Tuple ( i ) : <EOL> tmp . append ( i ) <EOL> else : <EOL> tmp . append ( ( i , ) ) <EOL> val = tmp <EOL> if SCons . Util . is_Dict ( dk ) : <EOL> dk = dk . items ( ) <EOL> elif SCons . Util . is_String ( dk ) : <EOL> dk = [ ( dk , ) ] <EOL> else : <EOL> tmp = [ ] <EOL> for i in dk : <EOL> if SCons . Util . is_List ( i ) : <EOL> if len ( i ) >= <NUM_LIT:2> : <EOL> tmp . append ( ( i [ <NUM_LIT:0> ] , i [ <NUM_LIT:1> ] ) ) <EOL> else : <EOL> tmp . append ( ( i [ <NUM_LIT:0> ] , ) ) <EOL> elif SCons . Util . is_Tuple ( i ) : <EOL> tmp . append ( i ) <EOL> else : <EOL> tmp . append ( ( i , ) ) <EOL> dk = tmp <EOL> else : <EOL> if not SCons . Util . is_List ( dk ) : <EOL> dk = [ dk ] <EOL> if delete_existing : <EOL> dk = [ x for x in dk if x not in val ] <EOL> else : <EOL> val = [ x for x in val if x not in dk ] <EOL> self . _dict [ key ] = dk + val <EOL> else : <EOL> dk = self . _dict [ key ] <EOL> if SCons . Util . is_List ( dk ) : <EOL> if key == '<STR_LIT>' : <EOL> tmp = [ ] <EOL> for i in dk : <EOL> if SCons . Util . is_List ( i ) : <EOL> if len ( i ) >= <NUM_LIT:2> : <EOL> tmp . append ( ( i [ <NUM_LIT:0> ] , i [ <NUM_LIT:1> ] ) ) <EOL> else : <EOL> tmp . append ( ( i [ <NUM_LIT:0> ] , ) ) <EOL> elif SCons . Util . is_Tuple ( i ) : <EOL> tmp . append ( i ) <EOL> else : <EOL> tmp . append ( ( i , ) ) <EOL> dk = tmp <EOL> if SCons . Util . is_Dict ( val ) : <EOL> val = val . items ( ) <EOL> elif SCons . Util . is_String ( val ) : <EOL> val = [ ( val , ) ] <EOL> if delete_existing : <EOL> dk = filter ( lambda x , val = val : x not in val , dk ) <EOL> self . _dict [ key ] = dk + val <EOL> else : <EOL> dk = [ x for x in dk if x not in val ] <EOL> self . _dict [ key ] = dk + val <EOL> else : <EOL> if delete_existing : <EOL> dk = filter ( lambda x , val = val : x not in val , dk ) <EOL> self . _dict [ key ] = dk + [ val ] <EOL> else : <EOL> if not val in dk : <EOL> self . _dict [ key ] = dk + [ val ] <EOL> else : <EOL> if key == '<STR_LIT>' : <EOL> if SCons . Util . is_String ( dk ) : <EOL> dk = [ dk ] <EOL> elif SCons . Util . is_Dict ( dk ) : <EOL> dk = dk . items ( ) <EOL> if SCons . Util . is_String ( val ) : <EOL> if val in dk : <EOL> val = [ ] <EOL> else : <EOL> val = [ val ] <EOL> elif SCons . Util . is_Dict ( val ) : <EOL> tmp = [ ] <EOL> for i , j in val . iteritems ( ) : <EOL> if j is not None : <EOL> tmp . append ( ( i , j ) ) <EOL> else : <EOL> tmp . append ( i ) <EOL> val = tmp <EOL> if delete_existing : <EOL> dk = [ x for x in dk if x not in val ] <EOL> self . _dict [ key ] = dk + val <EOL> self . scanner_map_delete ( kw ) <EOL> def Clone ( self , tools = [ ] , toolpath = None , parse_flags = None , ** kw ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> builders = self . _dict [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> clone = copy . copy ( self ) <EOL> clone . _dict = semi_deepcopy_dict ( self . _dict , [ '<STR_LIT>' ] ) <EOL> clone . _dict [ '<STR_LIT>' ] = BuilderDict ( builders , clone ) <EOL> clone . added_methods = [ ] <EOL> for mw in self . added_methods : <EOL> if mw == getattr ( self , mw . name ) : <EOL> clone . added_methods . append ( mw . clone ( clone ) ) <EOL> clone . _memo = { } <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> new = { } <EOL> for key , value in kw . items ( ) : <EOL> new [ key ] = SCons . Subst . scons_subst_once ( value , self , key ) <EOL> clone . Replace ( ** new ) <EOL> apply_tools ( clone , tools , toolpath ) <EOL> clone . Replace ( ** new ) <EOL> if parse_flags : clone . MergeFlags ( parse_flags ) <EOL> if SCons . Debug . track_instances : logInstanceCreation ( self , '<STR_LIT>' ) <EOL> return clone <EOL> def Copy ( self , * args , ** kw ) : <EOL> global _warn_copy_deprecated <EOL> if _warn_copy_deprecated : <EOL> msg = "<STR_LIT>" <EOL> SCons . Warnings . warn ( SCons . Warnings . DeprecatedCopyWarning , msg ) <EOL> _warn_copy_deprecated = False <EOL> return self . Clone ( * args , ** kw ) <EOL> def _changed_build ( self , dependency , target , prev_ni ) : <EOL> if dependency . changed_state ( target , prev_ni ) : <EOL> return <NUM_LIT:1> <EOL> return self . decide_source ( dependency , target , prev_ni ) <EOL> def _changed_content ( self , dependency , target , prev_ni ) : <EOL> return dependency . changed_content ( target , prev_ni ) <EOL> def _changed_source ( self , dependency , target , prev_ni ) : <EOL> target_env = dependency . get_build_env ( ) <EOL> type = target_env . get_tgt_sig_type ( ) <EOL> if type == '<STR_LIT:source>' : <EOL> return target_env . decide_source ( dependency , target , prev_ni ) <EOL> else : <EOL> return target_env . decide_target ( dependency , target , prev_ni ) <EOL> def _changed_timestamp_then_content ( self , dependency , target , prev_ni ) : <EOL> return dependency . changed_timestamp_then_content ( target , prev_ni ) <EOL> def _changed_timestamp_newer ( self , dependency , target , prev_ni ) : <EOL> return dependency . changed_timestamp_newer ( target , prev_ni ) <EOL> def _changed_timestamp_match ( self , dependency , target , prev_ni ) : <EOL> return dependency . changed_timestamp_match ( target , prev_ni ) <EOL> def _copy_from_cache ( self , src , dst ) : <EOL> return self . fs . copy ( src , dst ) <EOL> def _copy2_from_cache ( self , src , dst ) : <EOL> return self . fs . copy2 ( src , dst ) <EOL> def Decider ( self , function ) : <EOL> copy_function = self . _copy2_from_cache <EOL> if function in ( '<STR_LIT>' , '<STR_LIT:content>' ) : <EOL> if not SCons . Util . md5 : <EOL> raise UserError ( "<STR_LIT>" ) <EOL> function = self . _changed_content <EOL> elif function == '<STR_LIT>' : <EOL> function = self . _changed_timestamp_then_content <EOL> elif function in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> function = self . _changed_timestamp_newer <EOL> copy_function = self . _copy_from_cache <EOL> elif function == '<STR_LIT>' : <EOL> function = self . _changed_timestamp_match <EOL> elif not callable ( function ) : <EOL> raise UserError ( "<STR_LIT>" % repr ( function ) ) <EOL> self . decide_target = function <EOL> self . decide_source = function <EOL> self . copy_from_cache = copy_function <EOL> def Detect ( self , progs ) : <EOL> """<STR_LIT>""" <EOL> if not SCons . Util . is_List ( progs ) : <EOL> progs = [ progs ] <EOL> for prog in progs : <EOL> path = self . WhereIs ( prog ) <EOL> if path : return prog <EOL> return None <EOL> def Dictionary ( self , * args ) : <EOL> if not args : <EOL> return self . _dict <EOL> dlist = [ self . _dict [ x ] for x in args ] <EOL> if len ( dlist ) == <NUM_LIT:1> : <EOL> dlist = dlist [ <NUM_LIT:0> ] <EOL> return dlist <EOL> def Dump ( self , key = None ) : <EOL> """<STR_LIT>""" <EOL> import pprint <EOL> pp = pprint . PrettyPrinter ( indent = <NUM_LIT:2> ) <EOL> if key : <EOL> dict = self . Dictionary ( key ) <EOL> else : <EOL> dict = self . Dictionary ( ) <EOL> return pp . pformat ( dict ) <EOL> def FindIxes ( self , paths , prefix , suffix ) : <EOL> """<STR_LIT>""" <EOL> suffix = self . subst ( '<STR_LIT:$>' + suffix ) <EOL> prefix = self . subst ( '<STR_LIT:$>' + prefix ) <EOL> for path in paths : <EOL> dir , name = os . path . split ( str ( path ) ) <EOL> if name [ : len ( prefix ) ] == prefix and name [ - len ( suffix ) : ] == suffix : <EOL> return path <EOL> def ParseConfig ( self , command , function = None , unique = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> if function is None : <EOL> def parse_conf ( env , cmd , unique = unique ) : <EOL> return env . MergeFlags ( cmd , unique ) <EOL> function = parse_conf <EOL> if SCons . Util . is_List ( command ) : <EOL> command = '<STR_LIT:U+0020>' . join ( command ) <EOL> command = self . subst ( command ) <EOL> return function ( self , self . backtick ( command ) ) <EOL> def ParseDepends ( self , filename , must_exist = None , only_one = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> filename = self . subst ( filename ) <EOL> try : <EOL> fp = open ( filename , '<STR_LIT:r>' ) <EOL> except IOError : <EOL> if must_exist : <EOL> raise <EOL> return <EOL> lines = SCons . Util . LogicalLines ( fp ) . readlines ( ) <EOL> lines = [ l for l in lines if l [ <NUM_LIT:0> ] != '<STR_LIT:#>' ] <EOL> tdlist = [ ] <EOL> for line in lines : <EOL> try : <EOL> target , depends = line . split ( '<STR_LIT::>' , <NUM_LIT:1> ) <EOL> except ( AttributeError , ValueError ) : <EOL> pass <EOL> else : <EOL> tdlist . append ( ( target . split ( ) , depends . split ( ) ) ) <EOL> if only_one : <EOL> targets = [ ] <EOL> for td in tdlist : <EOL> targets . extend ( td [ <NUM_LIT:0> ] ) <EOL> if len ( targets ) > <NUM_LIT:1> : <EOL> raise SCons . Errors . UserError ( <EOL> "<STR_LIT>" <EOL> % ( filename , targets ) ) <EOL> for target , depends in tdlist : <EOL> self . Depends ( target , depends ) <EOL> def Platform ( self , platform ) : <EOL> platform = self . subst ( platform ) <EOL> return SCons . Platform . Platform ( platform ) ( self ) <EOL> def Prepend ( self , ** kw ) : <EOL> """<STR_LIT>""" <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> for key , val in kw . items ( ) : <EOL> try : <EOL> orig = self . _dict [ key ] <EOL> except KeyError : <EOL> self . _dict [ key ] = val <EOL> else : <EOL> try : <EOL> update_dict = orig . update <EOL> except AttributeError : <EOL> try : <EOL> self . _dict [ key ] = val + orig <EOL> except ( KeyError , TypeError ) : <EOL> try : <EOL> add_to_val = val . append <EOL> except AttributeError : <EOL> if val : <EOL> orig . insert ( <NUM_LIT:0> , val ) <EOL> else : <EOL> if orig : <EOL> add_to_val ( orig ) <EOL> self . _dict [ key ] = val <EOL> else : <EOL> if SCons . Util . is_List ( val ) : <EOL> for v in val : <EOL> orig [ v ] = None <EOL> else : <EOL> try : <EOL> update_dict ( val ) <EOL> except ( AttributeError , TypeError , ValueError ) : <EOL> if SCons . Util . is_Dict ( val ) : <EOL> for k , v in val . items ( ) : <EOL> orig [ k ] = v <EOL> else : <EOL> orig [ val ] = None <EOL> self . scanner_map_delete ( kw ) <EOL> def PrependENVPath ( self , name , newpath , envname = '<STR_LIT>' , sep = os . pathsep , <EOL> delete_existing = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> orig = '<STR_LIT>' <EOL> if envname in self . _dict and name in self . _dict [ envname ] : <EOL> orig = self . _dict [ envname ] [ name ] <EOL> nv = SCons . Util . PrependPath ( orig , newpath , sep , delete_existing , <EOL> canonicalize = self . _canonicalize ) <EOL> if envname not in self . _dict : <EOL> self . _dict [ envname ] = { } <EOL> self . _dict [ envname ] [ name ] = nv <EOL> def PrependUnique ( self , delete_existing = <NUM_LIT:0> , ** kw ) : <EOL> """<STR_LIT>""" <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> for key , val in kw . items ( ) : <EOL> if SCons . Util . is_List ( val ) : <EOL> val = _delete_duplicates ( val , not delete_existing ) <EOL> if key not in self . _dict or self . _dict [ key ] in ( '<STR_LIT>' , None ) : <EOL> self . _dict [ key ] = val <EOL> elif SCons . Util . is_Dict ( self . _dict [ key ] ) and SCons . Util . is_Dict ( val ) : <EOL> self . _dict [ key ] . update ( val ) <EOL> elif SCons . Util . is_List ( val ) : <EOL> dk = self . _dict [ key ] <EOL> if not SCons . Util . is_List ( dk ) : <EOL> dk = [ dk ] <EOL> if delete_existing : <EOL> dk = [ x for x in dk if x not in val ] <EOL> else : <EOL> val = [ x for x in val if x not in dk ] <EOL> self . _dict [ key ] = val + dk <EOL> else : <EOL> dk = self . _dict [ key ] <EOL> if SCons . Util . is_List ( dk ) : <EOL> if delete_existing : <EOL> dk = [ x for x in dk if x not in val ] <EOL> self . _dict [ key ] = [ val ] + dk <EOL> else : <EOL> if not val in dk : <EOL> self . _dict [ key ] = [ val ] + dk <EOL> else : <EOL> if delete_existing : <EOL> dk = [ x for x in dk if x not in val ] <EOL> self . _dict [ key ] = val + dk <EOL> self . scanner_map_delete ( kw ) <EOL> def Replace ( self , ** kw ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> kwbd = kw [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> else : <EOL> kwbd = BuilderDict ( kwbd , self ) <EOL> del kw [ '<STR_LIT>' ] <EOL> self . __setitem__ ( '<STR_LIT>' , kwbd ) <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> self . _update ( semi_deepcopy ( kw ) ) <EOL> self . scanner_map_delete ( kw ) <EOL> def ReplaceIxes ( self , path , old_prefix , old_suffix , new_prefix , new_suffix ) : <EOL> """<STR_LIT>""" <EOL> old_prefix = self . subst ( '<STR_LIT:$>' + old_prefix ) <EOL> old_suffix = self . subst ( '<STR_LIT:$>' + old_suffix ) <EOL> new_prefix = self . subst ( '<STR_LIT:$>' + new_prefix ) <EOL> new_suffix = self . subst ( '<STR_LIT:$>' + new_suffix ) <EOL> dir , name = os . path . split ( str ( path ) ) <EOL> if name [ : len ( old_prefix ) ] == old_prefix : <EOL> name = name [ len ( old_prefix ) : ] <EOL> if name [ - len ( old_suffix ) : ] == old_suffix : <EOL> name = name [ : - len ( old_suffix ) ] <EOL> return os . path . join ( dir , new_prefix + name + new_suffix ) <EOL> def SetDefault ( self , ** kw ) : <EOL> for k in kw . keys ( ) : <EOL> if k in self . _dict : <EOL> del kw [ k ] <EOL> self . Replace ( ** kw ) <EOL> def _find_toolpath_dir ( self , tp ) : <EOL> return self . fs . Dir ( self . subst ( tp ) ) . srcnode ( ) . abspath <EOL> def Tool ( self , tool , toolpath = None , ** kw ) : <EOL> if SCons . Util . is_String ( tool ) : <EOL> tool = self . subst ( tool ) <EOL> if toolpath is None : <EOL> toolpath = self . get ( '<STR_LIT>' , [ ] ) <EOL> toolpath = list ( map ( self . _find_toolpath_dir , toolpath ) ) <EOL> tool = SCons . Tool . Tool ( tool , toolpath , ** kw ) <EOL> tool ( self ) <EOL> def WhereIs ( self , prog , path = None , pathext = None , reject = [ ] ) : <EOL> """<STR_LIT>""" <EOL> if path is None : <EOL> try : <EOL> path = self [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> elif SCons . Util . is_String ( path ) : <EOL> path = self . subst ( path ) <EOL> if pathext is None : <EOL> try : <EOL> pathext = self [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> elif SCons . Util . is_String ( pathext ) : <EOL> pathext = self . subst ( pathext ) <EOL> prog = SCons . Util . CLVar ( self . subst ( prog ) ) <EOL> path = SCons . Util . WhereIs ( prog [ <NUM_LIT:0> ] , path , pathext , reject ) <EOL> if path : return path <EOL> return None <EOL> def Action ( self , * args , ** kw ) : <EOL> def subst_string ( a , self = self ) : <EOL> if SCons . Util . is_String ( a ) : <EOL> a = self . subst ( a ) <EOL> return a <EOL> nargs = list ( map ( subst_string , args ) ) <EOL> nkw = self . subst_kw ( kw ) <EOL> return SCons . Action . Action ( * nargs , ** nkw ) <EOL> def AddPreAction ( self , files , action ) : <EOL> nodes = self . arg2nodes ( files , self . fs . Entry ) <EOL> action = SCons . Action . Action ( action ) <EOL> uniq = { } <EOL> for executor in [ n . get_executor ( ) for n in nodes ] : <EOL> uniq [ executor ] = <NUM_LIT:1> <EOL> for executor in uniq . keys ( ) : <EOL> executor . add_pre_action ( action ) <EOL> return nodes <EOL> def AddPostAction ( self , files , action ) : <EOL> nodes = self . arg2nodes ( files , self . fs . Entry ) <EOL> action = SCons . Action . Action ( action ) <EOL> uniq = { } <EOL> for executor in [ n . get_executor ( ) for n in nodes ] : <EOL> uniq [ executor ] = <NUM_LIT:1> <EOL> for executor in uniq . keys ( ) : <EOL> executor . add_post_action ( action ) <EOL> return nodes <EOL> def Alias ( self , target , source = [ ] , action = None , ** kw ) : <EOL> tlist = self . arg2nodes ( target , self . ans . Alias ) <EOL> if not SCons . Util . is_List ( source ) : <EOL> source = [ source ] <EOL> source = [ _f for _f in source if _f ] <EOL> if not action : <EOL> if not source : <EOL> return tlist <EOL> result = [ ] <EOL> for t in tlist : <EOL> bld = t . get_builder ( AliasBuilder ) <EOL> result . extend ( bld ( self , t , source ) ) <EOL> return result <EOL> nkw = self . subst_kw ( kw ) <EOL> nkw . update ( { <EOL> '<STR_LIT:action>' : SCons . Action . Action ( action ) , <EOL> '<STR_LIT>' : self . fs . Entry , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : None , <EOL> } ) <EOL> bld = SCons . Builder . Builder ( ** nkw ) <EOL> result = [ ] <EOL> for t in tlist : <EOL> b = t . get_builder ( ) <EOL> if b is None or b is AliasBuilder : <EOL> b = bld <EOL> else : <EOL> nkw [ '<STR_LIT:action>' ] = b . action + action <EOL> b = SCons . Builder . Builder ( ** nkw ) <EOL> t . convert ( ) <EOL> result . extend ( b ( self , t , t . sources + source ) ) <EOL> return result <EOL> def AlwaysBuild ( self , * targets ) : <EOL> tlist = [ ] <EOL> for t in targets : <EOL> tlist . extend ( self . arg2nodes ( t , self . fs . Entry ) ) <EOL> for t in tlist : <EOL> t . set_always_build ( ) <EOL> return tlist <EOL> def BuildDir ( self , * args , ** kw ) : <EOL> msg = """<STR_LIT>""" <EOL> SCons . Warnings . warn ( SCons . Warnings . DeprecatedBuildDirWarning , msg ) <EOL> if '<STR_LIT>' in kw : <EOL> kw [ '<STR_LIT>' ] = kw [ '<STR_LIT>' ] <EOL> del kw [ '<STR_LIT>' ] <EOL> return self . VariantDir ( * args , ** kw ) <EOL> def Builder ( self , ** kw ) : <EOL> nkw = self . subst_kw ( kw ) <EOL> return SCons . Builder . Builder ( ** nkw ) <EOL> def CacheDir ( self , path ) : <EOL> import SCons . CacheDir <EOL> if path is not None : <EOL> path = self . subst ( path ) <EOL> self . _CacheDir_path = path <EOL> def Clean ( self , targets , files ) : <EOL> global CleanTargets <EOL> tlist = self . arg2nodes ( targets , self . fs . Entry ) <EOL> flist = self . arg2nodes ( files , self . fs . Entry ) <EOL> for t in tlist : <EOL> try : <EOL> CleanTargets [ t ] . extend ( flist ) <EOL> except KeyError : <EOL> CleanTargets [ t ] = flist <EOL> def Configure ( self , * args , ** kw ) : <EOL> nargs = [ self ] <EOL> if args : <EOL> nargs = nargs + self . subst_list ( args ) [ <NUM_LIT:0> ] <EOL> nkw = self . subst_kw ( kw ) <EOL> nkw [ '<STR_LIT>' ] = kw . get ( '<STR_LIT>' , <NUM_LIT:0> ) + <NUM_LIT:1> <EOL> try : <EOL> nkw [ '<STR_LIT>' ] = self . subst_kw ( nkw [ '<STR_LIT>' ] ) <EOL> except KeyError : <EOL> pass <EOL> return SCons . SConf . SConf ( * nargs , ** nkw ) <EOL> def Command ( self , target , source , action , ** kw ) : <EOL> """<STR_LIT>""" <EOL> bkw = { <EOL> '<STR_LIT:action>' : action , <EOL> '<STR_LIT>' : self . fs . Entry , <EOL> '<STR_LIT>' : self . fs . Entry , <EOL> } <EOL> try : bkw [ '<STR_LIT>' ] = kw [ '<STR_LIT>' ] <EOL> except KeyError : pass <EOL> else : del kw [ '<STR_LIT>' ] <EOL> bld = SCons . Builder . Builder ( ** bkw ) <EOL> return bld ( self , target , source , ** kw ) <EOL> def Depends ( self , target , dependency ) : <EOL> """<STR_LIT>""" <EOL> tlist = self . arg2nodes ( target , self . fs . Entry ) <EOL> dlist = self . arg2nodes ( dependency , self . fs . Entry ) <EOL> for t in tlist : <EOL> t . add_dependency ( dlist ) <EOL> return tlist <EOL> def Dir ( self , name , * args , ** kw ) : <EOL> """<STR_LIT:U+0020>""" <EOL> s = self . subst ( name ) <EOL> if SCons . Util . is_Sequence ( s ) : <EOL> result = [ ] <EOL> for e in s : <EOL> result . append ( self . fs . Dir ( e , * args , ** kw ) ) <EOL> return result <EOL> return self . fs . Dir ( s , * args , ** kw ) <EOL> def NoClean ( self , * targets ) : <EOL> """<STR_LIT>""" <EOL> tlist = [ ] <EOL> for t in targets : <EOL> tlist . extend ( self . arg2nodes ( t , self . fs . Entry ) ) <EOL> for t in tlist : <EOL> t . set_noclean ( ) <EOL> return tlist <EOL> def NoCache ( self , * targets ) : <EOL> """<STR_LIT>""" <EOL> tlist = [ ] <EOL> for t in targets : <EOL> tlist . extend ( self . arg2nodes ( t , self . fs . Entry ) ) <EOL> for t in tlist : <EOL> t . set_nocache ( ) <EOL> return tlist <EOL> def Entry ( self , name , * args , ** kw ) : <EOL> """<STR_LIT:U+0020>""" <EOL> s = self . subst ( name ) <EOL> if SCons . Util . is_Sequence ( s ) : <EOL> result = [ ] <EOL> for e in s : <EOL> result . append ( self . fs . Entry ( e , * args , ** kw ) ) <EOL> return result <EOL> return self . fs . Entry ( s , * args , ** kw ) <EOL> def Environment ( self , ** kw ) : <EOL> return SCons . Environment . Environment ( ** self . subst_kw ( kw ) ) <EOL> def Execute ( self , action , * args , ** kw ) : <EOL> """<STR_LIT>""" <EOL> action = self . Action ( action , * args , ** kw ) <EOL> result = action ( [ ] , [ ] , self ) <EOL> if isinstance ( result , SCons . Errors . BuildError ) : <EOL> errstr = result . errstr <EOL> if result . filename : <EOL> errstr = result . filename + '<STR_LIT>' + errstr <EOL> sys . stderr . write ( "<STR_LIT>" % errstr ) <EOL> return result . status <EOL> else : <EOL> return result <EOL> def File ( self , name , * args , ** kw ) : <EOL> """<STR_LIT:U+0020>""" <EOL> s = self . subst ( name ) <EOL> if SCons . Util . is_Sequence ( s ) : <EOL> result = [ ] <EOL> for e in s : <EOL> result . append ( self . fs . File ( e , * args , ** kw ) ) <EOL> return result <EOL> return self . fs . File ( s , * args , ** kw ) <EOL> def FindFile ( self , file , dirs ) : <EOL> file = self . subst ( file ) <EOL> nodes = self . arg2nodes ( dirs , self . fs . Dir ) <EOL> return SCons . Node . FS . find_file ( file , tuple ( nodes ) ) <EOL> def Flatten ( self , sequence ) : <EOL> return SCons . Util . flatten ( sequence ) <EOL> def GetBuildPath ( self , files ) : <EOL> result = list ( map ( str , self . arg2nodes ( files , self . fs . Entry ) ) ) <EOL> if SCons . Util . is_List ( files ) : <EOL> return result <EOL> else : <EOL> return result [ <NUM_LIT:0> ] <EOL> def Glob ( self , pattern , ondisk = True , source = False , strings = False ) : <EOL> return self . fs . Glob ( self . subst ( pattern ) , ondisk , source , strings ) <EOL> def Ignore ( self , target , dependency ) : <EOL> """<STR_LIT>""" <EOL> tlist = self . arg2nodes ( target , self . fs . Entry ) <EOL> dlist = self . arg2nodes ( dependency , self . fs . Entry ) <EOL> for t in tlist : <EOL> t . add_ignore ( dlist ) <EOL> return tlist <EOL> def Literal ( self , string ) : <EOL> return SCons . Subst . Literal ( string ) <EOL> def Local ( self , * targets ) : <EOL> ret = [ ] <EOL> for targ in targets : <EOL> if isinstance ( targ , SCons . Node . Node ) : <EOL> targ . set_local ( ) <EOL> ret . append ( targ ) <EOL> else : <EOL> for t in self . arg2nodes ( targ , self . fs . Entry ) : <EOL> t . set_local ( ) <EOL> ret . append ( t ) <EOL> return ret <EOL> def Precious ( self , * targets ) : <EOL> tlist = [ ] <EOL> for t in targets : <EOL> tlist . extend ( self . arg2nodes ( t , self . fs . Entry ) ) <EOL> for t in tlist : <EOL> t . set_precious ( ) <EOL> return tlist <EOL> def Pseudo ( self , * targets ) : <EOL> tlist = [ ] <EOL> for t in targets : <EOL> tlist . extend ( self . arg2nodes ( t , self . fs . Entry ) ) <EOL> for t in tlist : <EOL> t . set_pseudo ( ) <EOL> return tlist <EOL> def Repository ( self , * dirs , ** kw ) : <EOL> dirs = self . arg2nodes ( list ( dirs ) , self . fs . Dir ) <EOL> self . fs . Repository ( * dirs , ** kw ) <EOL> def Requires ( self , target , prerequisite ) : <EOL> """<STR_LIT>""" <EOL> tlist = self . arg2nodes ( target , self . fs . Entry ) <EOL> plist = self . arg2nodes ( prerequisite , self . fs . Entry ) <EOL> for t in tlist : <EOL> t . add_prerequisite ( plist ) <EOL> return tlist <EOL> def Scanner ( self , * args , ** kw ) : <EOL> nargs = [ ] <EOL> for arg in args : <EOL> if SCons . Util . is_String ( arg ) : <EOL> arg = self . subst ( arg ) <EOL> nargs . append ( arg ) <EOL> nkw = self . subst_kw ( kw ) <EOL> return SCons . Scanner . Base ( * nargs , ** nkw ) <EOL> def SConsignFile ( self , name = "<STR_LIT>" , dbm_module = None ) : <EOL> if name is not None : <EOL> name = self . subst ( name ) <EOL> if not os . path . isabs ( name ) : <EOL> name = os . path . join ( str ( self . fs . SConstruct_dir ) , name ) <EOL> if name : <EOL> name = os . path . normpath ( name ) <EOL> sconsign_dir = os . path . dirname ( name ) <EOL> if sconsign_dir and not os . path . exists ( sconsign_dir ) : <EOL> self . Execute ( SCons . Defaults . Mkdir ( sconsign_dir ) ) <EOL> SCons . SConsign . File ( name , dbm_module ) <EOL> def SideEffect ( self , side_effect , target ) : <EOL> """<STR_LIT>""" <EOL> side_effects = self . arg2nodes ( side_effect , self . fs . Entry ) <EOL> targets = self . arg2nodes ( target , self . fs . Entry ) <EOL> for side_effect in side_effects : <EOL> if side_effect . multiple_side_effect_has_builder ( ) : <EOL> raise SCons . Errors . UserError ( "<STR_LIT>" % str ( side_effect ) ) <EOL> side_effect . add_source ( targets ) <EOL> side_effect . side_effect = <NUM_LIT:1> <EOL> self . Precious ( side_effect ) <EOL> for target in targets : <EOL> target . side_effects . append ( side_effect ) <EOL> return side_effects <EOL> def SourceCode ( self , entry , builder ) : <EOL> """<STR_LIT>""" <EOL> msg = """<STR_LIT>""" <EOL> SCons . Warnings . warn ( SCons . Warnings . DeprecatedSourceCodeWarning , msg ) <EOL> entries = self . arg2nodes ( entry , self . fs . Entry ) <EOL> for entry in entries : <EOL> entry . set_src_builder ( builder ) <EOL> return entries <EOL> def SourceSignatures ( self , type ) : <EOL> global _warn_source_signatures_deprecated <EOL> if _warn_source_signatures_deprecated : <EOL> msg = "<STR_LIT>" + "<STR_LIT>" <EOL> SCons . Warnings . warn ( SCons . Warnings . DeprecatedSourceSignaturesWarning , msg ) <EOL> _warn_source_signatures_deprecated = False <EOL> type = self . subst ( type ) <EOL> self . src_sig_type = type <EOL> if type == '<STR_LIT>' : <EOL> if not SCons . Util . md5 : <EOL> raise UserError ( "<STR_LIT>" ) <EOL> self . decide_source = self . _changed_content <EOL> elif type == '<STR_LIT>' : <EOL> self . decide_source = self . _changed_timestamp_match <EOL> else : <EOL> raise UserError ( "<STR_LIT>" % type ) <EOL> def Split ( self , arg ) : <EOL> """<STR_LIT>""" <EOL> if SCons . Util . is_List ( arg ) : <EOL> return list ( map ( self . subst , arg ) ) <EOL> elif SCons . Util . is_String ( arg ) : <EOL> return self . subst ( arg ) . split ( ) <EOL> else : <EOL> return [ self . subst ( arg ) ] <EOL> def TargetSignatures ( self , type ) : <EOL> global _warn_target_signatures_deprecated <EOL> if _warn_target_signatures_deprecated : <EOL> msg = "<STR_LIT>" + "<STR_LIT>" <EOL> SCons . Warnings . warn ( SCons . Warnings . DeprecatedTargetSignaturesWarning , msg ) <EOL> _warn_target_signatures_deprecated = False <EOL> type = self . subst ( type ) <EOL> self . tgt_sig_type = type <EOL> if type in ( '<STR_LIT>' , '<STR_LIT:content>' ) : <EOL> if not SCons . Util . md5 : <EOL> raise UserError ( "<STR_LIT>" ) <EOL> self . decide_target = self . _changed_content <EOL> elif type == '<STR_LIT>' : <EOL> self . decide_target = self . _changed_timestamp_match <EOL> elif type == '<STR_LIT>' : <EOL> self . decide_target = self . _changed_build <EOL> elif type == '<STR_LIT:source>' : <EOL> self . decide_target = self . _changed_source <EOL> else : <EOL> raise UserError ( "<STR_LIT>" % type ) <EOL> def Value ( self , value , built_value = None ) : <EOL> """<STR_LIT:U+0020>""" <EOL> return SCons . Node . Python . Value ( value , built_value ) <EOL> def VariantDir ( self , variant_dir , src_dir , duplicate = <NUM_LIT:1> ) : <EOL> variant_dir = self . arg2nodes ( variant_dir , self . fs . Dir ) [ <NUM_LIT:0> ] <EOL> src_dir = self . arg2nodes ( src_dir , self . fs . Dir ) [ <NUM_LIT:0> ] <EOL> self . fs . VariantDir ( variant_dir , src_dir , duplicate ) <EOL> def FindSourceFiles ( self , node = '<STR_LIT:.>' ) : <EOL> """<STR_LIT>""" <EOL> node = self . arg2nodes ( node , self . fs . Entry ) [ <NUM_LIT:0> ] <EOL> sources = [ ] <EOL> def build_source ( ss ) : <EOL> for s in ss : <EOL> if isinstance ( s , SCons . Node . FS . Dir ) : <EOL> build_source ( s . all_children ( ) ) <EOL> elif s . has_builder ( ) : <EOL> build_source ( s . sources ) <EOL> elif isinstance ( s . disambiguate ( ) , SCons . Node . FS . File ) : <EOL> sources . append ( s ) <EOL> build_source ( node . all_children ( ) ) <EOL> def final_source ( node ) : <EOL> while ( node != node . srcnode ( ) ) : <EOL> node = node . srcnode ( ) <EOL> return node <EOL> sources = map ( final_source , sources ) ; <EOL> return list ( set ( sources ) ) <EOL> def FindInstalledFiles ( self ) : <EOL> """<STR_LIT>""" <EOL> from SCons . Tool import install <EOL> if install . _UNIQUE_INSTALLED_FILES is None : <EOL> install . _UNIQUE_INSTALLED_FILES = SCons . Util . uniquer_hashables ( install . _INSTALLED_FILES ) <EOL> return install . _UNIQUE_INSTALLED_FILES <EOL> class OverrideEnvironment ( Base ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , subject , overrides = { } ) : <EOL> if SCons . Debug . track_instances : logInstanceCreation ( self , '<STR_LIT>' ) <EOL> self . __dict__ [ '<STR_LIT>' ] = subject <EOL> self . __dict__ [ '<STR_LIT>' ] = overrides <EOL> def __getattr__ ( self , name ) : <EOL> return getattr ( self . __dict__ [ '<STR_LIT>' ] , name ) <EOL> def __setattr__ ( self , name , value ) : <EOL> setattr ( self . __dict__ [ '<STR_LIT>' ] , name , value ) <EOL> def __getitem__ ( self , key ) : <EOL> try : <EOL> return self . __dict__ [ '<STR_LIT>' ] [ key ] <EOL> except KeyError : <EOL> return self . __dict__ [ '<STR_LIT>' ] . __getitem__ ( key ) <EOL> def __setitem__ ( self , key , value ) : <EOL> if not is_valid_construction_var ( key ) : <EOL> raise SCons . Errors . UserError ( "<STR_LIT>" % key ) <EOL> self . __dict__ [ '<STR_LIT>' ] [ key ] = value <EOL> def __delitem__ ( self , key ) : <EOL> try : <EOL> del self . __dict__ [ '<STR_LIT>' ] [ key ] <EOL> except KeyError : <EOL> deleted = <NUM_LIT:0> <EOL> else : <EOL> deleted = <NUM_LIT:1> <EOL> try : <EOL> result = self . __dict__ [ '<STR_LIT>' ] . __delitem__ ( key ) <EOL> except KeyError : <EOL> if not deleted : <EOL> raise <EOL> result = None <EOL> return result <EOL> def get ( self , key , default = None ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return self . __dict__ [ '<STR_LIT>' ] [ key ] <EOL> except KeyError : <EOL> return self . __dict__ [ '<STR_LIT>' ] . get ( key , default ) <EOL> def has_key ( self , key ) : <EOL> try : <EOL> self . __dict__ [ '<STR_LIT>' ] [ key ] <EOL> return <NUM_LIT:1> <EOL> except KeyError : <EOL> return key in self . __dict__ [ '<STR_LIT>' ] <EOL> def __contains__ ( self , key ) : <EOL> if self . __dict__ [ '<STR_LIT>' ] . __contains__ ( key ) : <EOL> return <NUM_LIT:1> <EOL> return self . __dict__ [ '<STR_LIT>' ] . __contains__ ( key ) <EOL> def Dictionary ( self ) : <EOL> """<STR_LIT>""" <EOL> d = self . __dict__ [ '<STR_LIT>' ] . Dictionary ( ) . copy ( ) <EOL> d . update ( self . __dict__ [ '<STR_LIT>' ] ) <EOL> return d <EOL> def items ( self ) : <EOL> """<STR_LIT>""" <EOL> return list ( self . Dictionary ( ) . items ( ) ) <EOL> def _update ( self , dict ) : <EOL> """<STR_LIT>""" <EOL> self . __dict__ [ '<STR_LIT>' ] . update ( dict ) <EOL> def gvars ( self ) : <EOL> return self . __dict__ [ '<STR_LIT>' ] . gvars ( ) <EOL> def lvars ( self ) : <EOL> lvars = self . __dict__ [ '<STR_LIT>' ] . lvars ( ) <EOL> lvars . update ( self . __dict__ [ '<STR_LIT>' ] ) <EOL> return lvars <EOL> def Replace ( self , ** kw ) : <EOL> kw = copy_non_reserved_keywords ( kw ) <EOL> self . __dict__ [ '<STR_LIT>' ] . update ( semi_deepcopy ( kw ) ) <EOL> Environment = Base <EOL> def NoSubstitutionProxy ( subject ) : <EOL> class _NoSubstitutionProxy ( Environment ) : <EOL> def __init__ ( self , subject ) : <EOL> self . __dict__ [ '<STR_LIT>' ] = subject <EOL> def __getattr__ ( self , name ) : <EOL> return getattr ( self . __dict__ [ '<STR_LIT>' ] , name ) <EOL> def __setattr__ ( self , name , value ) : <EOL> return setattr ( self . __dict__ [ '<STR_LIT>' ] , name , value ) <EOL> def executor_to_lvars ( self , kwdict ) : <EOL> if kwdict . has_key ( '<STR_LIT>' ) : <EOL> kwdict [ '<STR_LIT>' ] = kwdict [ '<STR_LIT>' ] . get_lvars ( ) <EOL> del kwdict [ '<STR_LIT>' ] <EOL> else : <EOL> kwdict [ '<STR_LIT>' ] = { } <EOL> def raw_to_mode ( self , dict ) : <EOL> try : <EOL> raw = dict [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> pass <EOL> else : <EOL> del dict [ '<STR_LIT>' ] <EOL> dict [ '<STR_LIT>' ] = raw <EOL> def subst ( self , string , * args , ** kwargs ) : <EOL> return string <EOL> def subst_kw ( self , kw , * args , ** kwargs ) : <EOL> return kw <EOL> def subst_list ( self , string , * args , ** kwargs ) : <EOL> nargs = ( string , self , ) + args <EOL> nkw = kwargs . copy ( ) <EOL> nkw [ '<STR_LIT>' ] = { } <EOL> self . executor_to_lvars ( nkw ) <EOL> self . raw_to_mode ( nkw ) <EOL> return SCons . Subst . scons_subst_list ( * nargs , ** nkw ) <EOL> def subst_target_source ( self , string , * args , ** kwargs ) : <EOL> nargs = ( string , self , ) + args <EOL> nkw = kwargs . copy ( ) <EOL> nkw [ '<STR_LIT>' ] = { } <EOL> self . executor_to_lvars ( nkw ) <EOL> self . raw_to_mode ( nkw ) <EOL> return SCons . Subst . scons_subst ( * nargs , ** nkw ) <EOL> return _NoSubstitutionProxy ( subject ) </s>
