Logo Search packages:      
Sourcecode: abakus version File versions  Download package

Warnings.py

import SCons.Errors
00002 class Warning(SCons.Errors.UserError):
    pass
00004 class CacheWriteErrorWarning(Warning):
    pass
00006 class CorruptSConsignWarning(Warning):
    pass
00008 class DependencyWarning(Warning):
    pass
00010 class DeprecatedWarning(Warning):
    pass
00012 class DuplicateEnvironmentWarning(Warning):
    pass
00014 class MissingSConscriptWarning(Warning):
    pass
00016 class NoParallelSupportWarning(Warning):
    pass
00018 class ReservedVariableWarning(Warning):
    pass
00020 class MisleadingKeywordsWarning(Warning):
    pass
_warningAsException=0
_enabled=[]
_warningOut=None
def suppressWarningClass(clazz):
    _enabled.insert(0, (clazz, 0))
def enableWarningClass(clazz):
    _enabled.insert(0, (clazz, 1))
def warningAsException(flag=1):
    global _warningAsException
    old=_warningAsException
    _warningAsException=flag
    return old
def warn(clazz, *args):
    global _enabled, _warningAsException, _warningOut
    warning=clazz(args)
    for clazz, flag in _enabled:
        if isinstance(warning, clazz):
            if flag:
                if _warningAsException:
                    raise warning
                if _warningOut:
                    _warningOut(warning)
            break

Generated by  Doxygen 1.6.0   Back to index