<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import string <EOL> import sys <EOL> import SCons . Errors <EOL> class Warning ( SCons . Errors . UserError ) : <EOL> pass <EOL> class MandatoryWarning ( Warning ) : <EOL> pass <EOL> class FutureDeprecatedWarning ( Warning ) : <EOL> pass <EOL> class DeprecatedWarning ( Warning ) : <EOL> pass <EOL> class MandatoryDeprecatedWarning ( MandatoryWarning ) : <EOL> pass <EOL> class CacheWriteErrorWarning ( Warning ) : <EOL> pass <EOL> class CorruptSConsignWarning ( Warning ) : <EOL> pass <EOL> class DependencyWarning ( Warning ) : <EOL> pass <EOL> class DeprecatedCopyWarning ( DeprecatedWarning ) : <EOL> pass <EOL> class DeprecatedOptionsWarning ( DeprecatedWarning ) : <EOL> pass <EOL> class DeprecatedSourceSignaturesWarning ( DeprecatedWarning ) : <EOL> pass <EOL> class DeprecatedTargetSignaturesWarning ( DeprecatedWarning ) : <EOL> pass <EOL> class DuplicateEnvironmentWarning ( Warning ) : <EOL> pass <EOL> class FutureReservedVariableWarning ( Warning ) : <EOL> pass <EOL> class LinkWarning ( Warning ) : <EOL> pass <EOL> class MisleadingKeywordsWarning ( Warning ) : <EOL> pass <EOL> class MissingSConscriptWarning ( Warning ) : <EOL> pass <EOL> class NoMD5ModuleWarning ( Warning ) : <EOL> pass <EOL> class NoMetaclassSupportWarning ( Warning ) : <EOL> pass <EOL> class NoObjectCountWarning ( Warning ) : <EOL> pass <EOL> class NoParallelSupportWarning ( Warning ) : <EOL> pass <EOL> class PythonVersionWarning ( DeprecatedWarning ) : <EOL> pass <EOL> class ReservedVariableWarning ( Warning ) : <EOL> pass <EOL> class StackSizeWarning ( Warning ) : <EOL> pass <EOL> class TaskmasterNeedsExecuteWarning ( FutureDeprecatedWarning ) : <EOL> pass <EOL> class FortranCxxMixWarning ( LinkWarning ) : <EOL> pass <EOL> _warningAsException = <NUM_LIT:0> <EOL> _enabled = [ ] <EOL> _warningOut = None <EOL> def suppressWarningClass ( clazz ) : <EOL> """<STR_LIT>""" <EOL> _enabled . insert ( <NUM_LIT:0> , ( clazz , <NUM_LIT:0> ) ) <EOL> def enableWarningClass ( clazz ) : <EOL> """<STR_LIT>""" <EOL> _enabled . insert ( <NUM_LIT:0> , ( clazz , <NUM_LIT:1> ) ) <EOL> def warningAsException ( flag = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> global _warningAsException <EOL> old = _warningAsException <EOL> _warningAsException = flag <EOL> return old <EOL> def warn ( clazz , * args ) : <EOL> global _enabled , _warningAsException , _warningOut <EOL> warning = clazz ( args ) <EOL> for clazz , flag in _enabled : <EOL> if isinstance ( warning , clazz ) : <EOL> if flag : <EOL> if _warningAsException : <EOL> raise warning <EOL> if _warningOut : <EOL> _warningOut ( warning ) <EOL> break <EOL> def process_warn_strings ( arguments ) : <EOL> """<STR_LIT>""" <EOL> def _capitalize ( s ) : <EOL> if s [ : <NUM_LIT:5> ] == "<STR_LIT>" : <EOL> return "<STR_LIT>" + s [ <NUM_LIT:5> : ] <EOL> else : <EOL> return string . capitalize ( s ) <EOL> for arg in arguments : <EOL> elems = string . split ( string . lower ( arg ) , '<STR_LIT:->' ) <EOL> enable = <NUM_LIT:1> <EOL> if elems [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> enable = <NUM_LIT:0> <EOL> del elems [ <NUM_LIT:0> ] <EOL> if len ( elems ) == <NUM_LIT:1> and elems [ <NUM_LIT:0> ] == '<STR_LIT:all>' : <EOL> class_name = "<STR_LIT>" <EOL> else : <EOL> class_name = string . join ( map ( _capitalize , elems ) , '<STR_LIT>' ) + "<STR_LIT>" <EOL> try : <EOL> clazz = globals ( ) [ class_name ] <EOL> except KeyError : <EOL> sys . stderr . write ( "<STR_LIT>" % arg ) <EOL> else : <EOL> if enable : <EOL> enableWarningClass ( clazz ) <EOL> elif issubclass ( clazz , MandatoryDeprecatedWarning ) : <EOL> fmt = "<STR_LIT>" <EOL> sys . stderr . write ( fmt % arg ) <EOL> else : <EOL> suppressWarningClass ( clazz ) </s>
