<s> __revision__ = "<STR_LIT>" <EOL> import optparse <EOL> import re <EOL> import string <EOL> import sys <EOL> import textwrap <EOL> try : <EOL> no_hyphen_re = re . compile ( r'<STR_LIT>' ) <EOL> except re . error : <EOL> no_hyphen_re = re . compile ( r'<STR_LIT>' ) <EOL> try : <EOL> from gettext import gettext <EOL> except ImportError : <EOL> def gettext ( message ) : <EOL> return message <EOL> _ = gettext <EOL> import SCons . Node . FS <EOL> import SCons . Warnings <EOL> OptionValueError = optparse . OptionValueError <EOL> SUPPRESS_HELP = optparse . SUPPRESS_HELP <EOL> diskcheck_all = SCons . Node . FS . diskcheck_types ( ) <EOL> def diskcheck_convert ( value ) : <EOL> if value is None : <EOL> return [ ] <EOL> if not SCons . Util . is_List ( value ) : <EOL> value = string . split ( value , '<STR_LIT:U+002C>' ) <EOL> result = [ ] <EOL> for v in map ( string . lower , value ) : <EOL> if v == '<STR_LIT:all>' : <EOL> result = diskcheck_all <EOL> elif v == '<STR_LIT:none>' : <EOL> result = [ ] <EOL> elif v in diskcheck_all : <EOL> result . append ( v ) <EOL> else : <EOL> raise ValueError , v <EOL> return result <EOL> class SConsValues ( optparse . Values ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , defaults ) : <EOL> self . __dict__ [ '<STR_LIT>' ] = defaults <EOL> self . __dict__ [ '<STR_LIT>' ] = { } <EOL> def __getattr__ ( self , attr ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return self . __dict__ [ attr ] <EOL> except KeyError : <EOL> try : <EOL> return self . __dict__ [ '<STR_LIT>' ] [ attr ] <EOL> except KeyError : <EOL> return getattr ( self . __dict__ [ '<STR_LIT>' ] , attr ) <EOL> settable = [ <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> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def set_option ( self , name , value ) : <EOL> """<STR_LIT>""" <EOL> if not name in self . settable : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % name <EOL> if name == '<STR_LIT>' : <EOL> try : <EOL> value = int ( value ) <EOL> if value < <NUM_LIT:1> : <EOL> raise ValueError <EOL> except ValueError : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % repr ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> try : <EOL> value = int ( value ) <EOL> except ValueError : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % repr ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> try : <EOL> value = str ( value ) <EOL> except ValueError : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % repr ( value ) <EOL> if not value in SCons . Node . FS . Valid_Duplicates : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % value <EOL> SCons . Node . FS . set_duplicate ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> try : <EOL> value = diskcheck_convert ( value ) <EOL> except ValueError , v : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % v <EOL> if not self . __dict__ . has_key ( '<STR_LIT>' ) : <EOL> SCons . Node . FS . set_diskcheck ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> try : <EOL> value = int ( value ) <EOL> except ValueError : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % repr ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> try : <EOL> value = int ( value ) <EOL> except ValueError : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % repr ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> if SCons . Util . is_String ( value ) : <EOL> value = [ value ] <EOL> value = self . __SConscript_settings__ . get ( name , [ ] ) + value <EOL> SCons . Warnings . process_warn_strings ( value ) <EOL> self . __SConscript_settings__ [ name ] = value <EOL> class SConsOption ( optparse . Option ) : <EOL> def convert_value ( self , opt , value ) : <EOL> if value is not None : <EOL> if self . nargs in ( <NUM_LIT:1> , '<STR_LIT:?>' ) : <EOL> return self . check_value ( opt , value ) <EOL> else : <EOL> return tuple ( map ( lambda v , o = opt , s = self : s . check_value ( o , v ) , value ) ) <EOL> def process ( self , opt , value , values , parser ) : <EOL> value = self . convert_value ( opt , value ) <EOL> return self . take_action ( <EOL> self . action , self . dest , opt , value , values , parser ) <EOL> def _check_nargs_optional ( self ) : <EOL> if self . nargs == '<STR_LIT:?>' and self . _short_opts : <EOL> fmt = "<STR_LIT>" <EOL> raise SCons . Errors . UserError , fmt % self . _short_opts [ <NUM_LIT:0> ] <EOL> try : <EOL> _orig_CONST_ACTIONS = optparse . Option . CONST_ACTIONS <EOL> _orig_CHECK_METHODS = optparse . Option . CHECK_METHODS <EOL> except AttributeError : <EOL> _orig_CONST_ACTIONS = ( "<STR_LIT>" , ) <EOL> def _check_const ( self ) : <EOL> if self . action not in self . CONST_ACTIONS and self . const is not None : <EOL> raise OptionError ( <EOL> "<STR_LIT>" % self . action , <EOL> self ) <EOL> _orig_CHECK_METHODS = [ optparse . Option . _check_action , <EOL> optparse . Option . _check_type , <EOL> optparse . Option . _check_choice , <EOL> optparse . Option . _check_dest , <EOL> _check_const , <EOL> optparse . Option . _check_nargs , <EOL> optparse . Option . _check_callback ] <EOL> CHECK_METHODS = _orig_CHECK_METHODS + [ _check_nargs_optional ] <EOL> CONST_ACTIONS = _orig_CONST_ACTIONS + optparse . Option . TYPED_ACTIONS <EOL> class SConsOptionGroup ( optparse . OptionGroup ) : <EOL> """<STR_LIT>""" <EOL> def format_help ( self , formatter ) : <EOL> """<STR_LIT>""" <EOL> formatter . dedent ( ) <EOL> result = formatter . format_heading ( self . title ) <EOL> formatter . indent ( ) <EOL> result = result + optparse . OptionContainer . format_help ( self , formatter ) <EOL> return result <EOL> class SConsOptionParser ( optparse . OptionParser ) : <EOL> preserve_unknown_options = False <EOL> def error ( self , msg ) : <EOL> self . print_usage ( sys . stderr ) <EOL> sys . stderr . write ( "<STR_LIT>" % msg ) <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> def _process_long_opt ( self , rargs , values ) : <EOL> """<STR_LIT>""" <EOL> arg = rargs . pop ( <NUM_LIT:0> ) <EOL> if "<STR_LIT:=>" in arg : <EOL> ( opt , next_arg ) = string . split ( arg , "<STR_LIT:=>" , <NUM_LIT:1> ) <EOL> rargs . insert ( <NUM_LIT:0> , next_arg ) <EOL> had_explicit_value = True <EOL> else : <EOL> opt = arg <EOL> had_explicit_value = False <EOL> try : <EOL> opt = self . _match_long_opt ( opt ) <EOL> except optparse . BadOptionError : <EOL> if self . preserve_unknown_options : <EOL> self . largs . append ( arg ) <EOL> if had_explicit_value : <EOL> rargs . pop ( <NUM_LIT:0> ) <EOL> return <EOL> raise <EOL> option = self . _long_opt [ opt ] <EOL> if option . takes_value ( ) : <EOL> nargs = option . nargs <EOL> if nargs == '<STR_LIT:?>' : <EOL> if had_explicit_value : <EOL> value = rargs . pop ( <NUM_LIT:0> ) <EOL> else : <EOL> value = option . const <EOL> elif len ( rargs ) < nargs : <EOL> if nargs == <NUM_LIT:1> : <EOL> self . error ( _ ( "<STR_LIT>" ) % opt ) <EOL> else : <EOL> self . error ( _ ( "<STR_LIT>" ) <EOL> % ( opt , nargs ) ) <EOL> elif nargs == <NUM_LIT:1> : <EOL> value = rargs . pop ( <NUM_LIT:0> ) <EOL> else : <EOL> value = tuple ( rargs [ <NUM_LIT:0> : nargs ] ) <EOL> del rargs [ <NUM_LIT:0> : nargs ] <EOL> elif had_explicit_value : <EOL> self . error ( _ ( "<STR_LIT>" ) % opt ) <EOL> else : <EOL> value = None <EOL> option . process ( opt , value , values , self ) <EOL> def add_local_option ( self , * args , ** kw ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> group = self . local_option_group <EOL> except AttributeError : <EOL> group = SConsOptionGroup ( self , '<STR_LIT>' ) <EOL> group = self . add_option_group ( group ) <EOL> self . local_option_group = group <EOL> result = apply ( group . add_option , args , kw ) <EOL> if result : <EOL> setattr ( self . values . __defaults__ , result . dest , result . default ) <EOL> self . parse_args ( self . largs , self . values ) <EOL> return result <EOL> class SConsIndentedHelpFormatter ( optparse . IndentedHelpFormatter ) : <EOL> def format_usage ( self , usage ) : <EOL> return "<STR_LIT>" % usage <EOL> def format_heading ( self , heading ) : <EOL> """<STR_LIT>""" <EOL> if heading == '<STR_LIT>' : <EOL> heading = "<STR_LIT>" <EOL> if heading == '<STR_LIT>' : <EOL> heading = "<STR_LIT>" <EOL> return optparse . IndentedHelpFormatter . format_heading ( self , heading ) <EOL> def format_option ( self , option ) : <EOL> """<STR_LIT>""" <EOL> result = [ ] <EOL> try : <EOL> opts = self . option_strings [ option ] <EOL> except AttributeError : <EOL> opts = option . option_strings <EOL> opt_width = self . help_position - self . current_indent - <NUM_LIT:2> <EOL> if len ( opts ) > opt_width : <EOL> wrapper = textwrap . TextWrapper ( width = self . width , <EOL> initial_indent = '<STR_LIT:U+0020>' , <EOL> subsequent_indent = '<STR_LIT:U+0020>' ) <EOL> wrapper . wordsep_re = no_hyphen_re <EOL> opts = wrapper . fill ( opts ) + '<STR_LIT:\n>' <EOL> indent_first = self . help_position <EOL> else : <EOL> opts = "<STR_LIT>" % ( self . current_indent , "<STR_LIT>" , opt_width , opts ) <EOL> indent_first = <NUM_LIT:0> <EOL> result . append ( opts ) <EOL> if option . help : <EOL> try : <EOL> expand_default = self . expand_default <EOL> except AttributeError : <EOL> help_text = option . help <EOL> else : <EOL> help_text = expand_default ( option ) <EOL> wrapper = textwrap . TextWrapper ( width = self . help_width , <EOL> subsequent_indent = '<STR_LIT:U+0020>' ) <EOL> wrapper . wordsep_re = no_hyphen_re <EOL> help_lines = wrapper . wrap ( help_text ) <EOL> result . append ( "<STR_LIT>" % ( indent_first , "<STR_LIT>" , help_lines [ <NUM_LIT:0> ] ) ) <EOL> for line in help_lines [ <NUM_LIT:1> : ] : <EOL> result . append ( "<STR_LIT>" % ( self . help_position , "<STR_LIT>" , line ) ) <EOL> elif opts [ - <NUM_LIT:1> ] != "<STR_LIT:\n>" : <EOL> result . append ( "<STR_LIT:\n>" ) <EOL> return string . join ( result , "<STR_LIT>" ) <EOL> _short_opt_fmt = "<STR_LIT>" <EOL> _long_opt_fmt = "<STR_LIT>" <EOL> def format_option_strings ( self , option ) : <EOL> """<STR_LIT>""" <EOL> if option . takes_value ( ) : <EOL> metavar = option . metavar or string . upper ( option . dest ) <EOL> short_opts = [ ] <EOL> for sopt in option . _short_opts : <EOL> short_opts . append ( self . _short_opt_fmt % ( sopt , metavar ) ) <EOL> long_opts = [ ] <EOL> for lopt in option . _long_opts : <EOL> long_opts . append ( self . _long_opt_fmt % ( lopt , metavar ) ) <EOL> else : <EOL> short_opts = option . _short_opts <EOL> long_opts = option . _long_opts <EOL> if self . short_first : <EOL> opts = short_opts + long_opts <EOL> else : <EOL> opts = long_opts + short_opts <EOL> return string . join ( opts , "<STR_LIT:U+002CU+0020>" ) <EOL> def Parser ( version ) : <EOL> """<STR_LIT>""" <EOL> formatter = SConsIndentedHelpFormatter ( max_help_position = <NUM_LIT:30> ) <EOL> op = SConsOptionParser ( option_class = SConsOption , <EOL> add_help_option = False , <EOL> formatter = formatter , <EOL> usage = "<STR_LIT>" , ) <EOL> op . preserve_unknown_options = True <EOL> op . version = version <EOL> def opt_ignore ( option , opt , value , parser ) : <EOL> sys . stderr . write ( "<STR_LIT>" % opt ) <EOL> op . add_option ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_ignore , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT:-c>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , <EOL> dest = "<STR_LIT>" , default = None , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> config_options = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> def opt_config ( option , opt , value , parser , c_options = config_options ) : <EOL> if not value in c_options : <EOL> raise OptionValueError ( "<STR_LIT>" % value ) <EOL> setattr ( parser . values , option . dest , value ) <EOL> opt_config_help = "<STR_LIT>" % string . join ( config_options , "<STR_LIT:U+002CU+0020>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_config , <EOL> help = opt_config_help , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = None , <EOL> action = "<STR_LIT>" , const = <NUM_LIT:2> , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> deprecated_debug_options = { <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> "<STR_LIT>" : '<STR_LIT>' , <EOL> } <EOL> debug_options = [ "<STR_LIT:count>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT:time>" ] + deprecated_debug_options . keys ( ) <EOL> def opt_debug ( option , opt , value , parser , <EOL> debug_options = debug_options , <EOL> deprecated_debug_options = deprecated_debug_options ) : <EOL> if value in debug_options : <EOL> parser . values . debug . append ( value ) <EOL> if value in deprecated_debug_options . keys ( ) : <EOL> try : <EOL> parser . values . delayed_warnings <EOL> except AttributeError : <EOL> parser . values . delayed_warnings = [ ] <EOL> msg = deprecated_debug_options [ value ] <EOL> w = "<STR_LIT>" % ( value , msg ) <EOL> t = ( SCons . Warnings . DeprecatedWarning , w ) <EOL> parser . values . delayed_warnings . append ( t ) <EOL> else : <EOL> raise OptionValueError ( "<STR_LIT>" % value ) <EOL> opt_debug_help = "<STR_LIT>" % string . join ( debug_options , "<STR_LIT:U+002CU+0020>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , callback = opt_debug , <EOL> help = opt_debug_help , <EOL> metavar = "<STR_LIT>" ) <EOL> def opt_diskcheck ( option , opt , value , parser ) : <EOL> try : <EOL> diskcheck_value = diskcheck_convert ( value ) <EOL> except ValueError , e : <EOL> raise OptionValueError ( "<STR_LIT>" % e ) <EOL> setattr ( parser . values , option . dest , diskcheck_value ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = '<STR_LIT>' , default = None , <EOL> action = "<STR_LIT>" , callback = opt_diskcheck , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> def opt_duplicate ( option , opt , value , parser ) : <EOL> if not value in SCons . Node . FS . Valid_Duplicates : <EOL> raise OptionValueError ( "<STR_LIT>" % value ) <EOL> setattr ( parser . values , option . dest , value ) <EOL> SCons . Node . FS . set_duplicate ( value ) <EOL> opt_duplicate_help = "<STR_LIT>" + string . join ( SCons . Node . FS . Valid_Duplicates , "<STR_LIT:U+002CU+0020>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = '<STR_LIT>' , <EOL> action = "<STR_LIT>" , callback = opt_duplicate , <EOL> help = opt_duplicate_help ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT:file>" , default = [ ] , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , <EOL> dest = '<STR_LIT>' , default = [ ] , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> def opt_implicit_deps ( option , opt , value , parser ) : <EOL> setattr ( parser . values , '<STR_LIT>' , True ) <EOL> setattr ( parser . values , option . dest , True ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT>" , callback = opt_implicit_deps , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT>" , callback = opt_implicit_deps , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:int>" , <EOL> dest = "<STR_LIT>" , default = <NUM_LIT:1> , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT:N>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:int>" , <EOL> dest = '<STR_LIT>' , default = SCons . Node . FS . default_max_drift , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT:N>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:int>" , <EOL> dest = '<STR_LIT>' , default = SCons . Node . FS . File . md5_chunksize , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT:N>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , <EOL> dest = "<STR_LIT>" , default = None , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = False , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , <EOL> dest = '<STR_LIT>' , default = None , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:int>" , <EOL> dest = '<STR_LIT>' , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT:N>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , <EOL> dest = "<STR_LIT>" , default = None , <EOL> action = "<STR_LIT:store>" , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> tree_options = [ "<STR_LIT:all>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:status>" ] <EOL> def opt_tree ( option , opt , value , parser , tree_options = tree_options ) : <EOL> import Main <EOL> tp = Main . TreePrinter ( ) <EOL> for o in string . split ( value , '<STR_LIT:U+002C>' ) : <EOL> if o == '<STR_LIT:all>' : <EOL> tp . derived = False <EOL> elif o == '<STR_LIT>' : <EOL> tp . derived = True <EOL> elif o == '<STR_LIT>' : <EOL> tp . prune = True <EOL> elif o == '<STR_LIT:status>' : <EOL> tp . status = True <EOL> else : <EOL> raise OptionValueError ( "<STR_LIT>" % o ) <EOL> parser . values . tree_printers . append ( tp ) <EOL> opt_tree_help = "<STR_LIT>" % string . join ( tree_options , "<STR_LIT:U+002CU+0020>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , callback = opt_tree , <EOL> help = opt_tree_help , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = <NUM_LIT:0> , <EOL> action = "<STR_LIT>" , const = <NUM_LIT:1> , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , default = <NUM_LIT:0> , <EOL> action = "<STR_LIT>" , const = <NUM_LIT:3> , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> def opt_version ( option , opt , value , parser ) : <EOL> sys . stdout . write ( parser . version + '<STR_LIT:\n>' ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> op . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_version , <EOL> help = "<STR_LIT>" ) <EOL> def opt_warn ( option , opt , value , parser , tree_options = tree_options ) : <EOL> if SCons . Util . is_String ( value ) : <EOL> value = string . split ( value , '<STR_LIT:U+002C>' ) <EOL> parser . values . warn . extend ( value ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , callback = opt_warn , <EOL> help = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , <EOL> dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> def opt_not_yet ( option , opt , value , parser ) : <EOL> msg = "<STR_LIT>" % opt <EOL> sys . stderr . write ( msg ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:int>" , <EOL> dest = "<STR_LIT>" , default = <NUM_LIT:0> , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , default = [ ] , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> dest = "<STR_LIT>" , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> dest = "<STR_LIT:p>" , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> dest = "<STR_LIT>" , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> nargs = <NUM_LIT:1> , type = "<STR_LIT:string>" , <EOL> dest = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> op . add_option ( '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , <EOL> action = "<STR_LIT>" , callback = opt_not_yet , <EOL> help = SUPPRESS_HELP ) <EOL> return op </s>
