B
    b                 @   sB  d Z ddlZddlZG dd dejjZG dd deZG dd deZG d	d
 d
eZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd  d eZG d!d" d"eZG d#d$ d$eZG d%d& d&eZG d'd( d(eZG d)d* d*eZG d+d, d,eZG d-d. d.eZG d/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZ G d9d: d:eZ!G d;d< d<eZ"G d=d> d>eZ#G d?d@ d@eZ$g Z%dAa&dZ'dBdC Z(dDdE Z)dMdGdHZ*dIdJ Z+dKdL Z,dS )NzThe SCons warnings framework.    Nc               @   s   e Zd ZdS )SConsWarningN)__name__
__module____qualname__ r   r   -lib/python3.7/site-packages/SCons/Warnings.pyr      s   r   c               @   s   e Zd ZdS )WarningOnByDefaultN)r   r   r   r   r   r   r   r   !   s   r   c               @   s   e Zd ZdS )TargetNotBuiltWarningN)r   r   r   r   r   r   r   r	   (   s   r	   c               @   s   e Zd ZdS )CacheVersionWarningN)r   r   r   r   r   r   r   r
   +   s   r
   c               @   s   e Zd ZdS )CacheWriteErrorWarningN)r   r   r   r   r   r   r   r   .   s   r   c               @   s   e Zd ZdS )CorruptSConsignWarningN)r   r   r   r   r   r   r   r   1   s   r   c               @   s   e Zd ZdS )DependencyWarningN)r   r   r   r   r   r   r   r   4   s   r   c               @   s   e Zd ZdS )DevelopmentVersionWarningN)r   r   r   r   r   r   r   r   7   s   r   c               @   s   e Zd ZdS )DuplicateEnvironmentWarningN)r   r   r   r   r   r   r   r   :   s   r   c               @   s   e Zd ZdS )FutureReservedVariableWarningN)r   r   r   r   r   r   r   r   =   s   r   c               @   s   e Zd ZdS )LinkWarningN)r   r   r   r   r   r   r   r   @   s   r   c               @   s   e Zd ZdS )MisleadingKeywordsWarningN)r   r   r   r   r   r   r   r   C   s   r   c               @   s   e Zd ZdS )MissingSConscriptWarningN)r   r   r   r   r   r   r   r   F   s   r   c               @   s   e Zd ZdS )NoObjectCountWarningN)r   r   r   r   r   r   r   r   I   s   r   c               @   s   e Zd ZdS )NoParallelSupportWarningN)r   r   r   r   r   r   r   r   L   s   r   c               @   s   e Zd ZdS )ReservedVariableWarningN)r   r   r   r   r   r   r   r   O   s   r   c               @   s   e Zd ZdS )StackSizeWarningN)r   r   r   r   r   r   r   r   R   s   r   c               @   s   e Zd ZdS )VisualCMissingWarningN)r   r   r   r   r   r   r   r   U   s   r   c               @   s   e Zd ZdS )VisualVersionMismatchN)r   r   r   r   r   r   r   r   Z   s   r   c               @   s   e Zd ZdS )VisualStudioMissingWarningN)r   r   r   r   r   r   r   r   ]   s   r   c               @   s   e Zd ZdS )FortranCxxMixWarningN)r   r   r   r   r   r   r   r   `   s   r   c               @   s   e Zd ZdS )FutureDeprecatedWarningN)r   r   r   r   r   r   r   r   f   s   r   c               @   s   e Zd ZdS )DeprecatedWarningN)r   r   r   r   r   r   r   r   i   s   r   c               @   s   e Zd ZdS )MandatoryDeprecatedWarningN)r   r   r   r   r   r   r   r   l   s   r   c               @   s   e Zd ZdS )PythonVersionWarningN)r   r   r   r   r   r   r   r   q   s   r   c               @   s   e Zd ZdS )DeprecatedSourceCodeWarningN)r   r   r   r   r   r   r   r    t   s   r    c               @   s   e Zd ZdS )TaskmasterNeedsExecuteWarningN)r   r   r   r   r   r   r   r!   w   s   r!   c               @   s   e Zd ZdS )DeprecatedOptionsWarningN)r   r   r   r   r   r   r   r"   z   s   r"   c               @   s   e Zd ZdS )DeprecatedDebugOptionsWarningN)r   r   r   r   r   r   r   r#   }   s   r#   c               @   s   e Zd ZdS )"DeprecatedMissingSConscriptWarningN)r   r   r   r   r   r   r   r$      s   r$   c               @   s   e Zd ZdS )ToolQtDeprecatedWarningN)r   r   r   r   r   r   r   r%      s   r%   Fc             C   s   t d| df dS )z<Suppresses all warnings of type clazz or derived from clazz.r   FN)_enabledinsert)clazzr   r   r   suppressWarningClass   s    r)   c             C   s   t d| df dS )z9Enables all warnings of type clazz or derived from clazz.r   TN)r&   r'   )r(   r   r   r   enableWarningClass   s    r*   Tc             C   s   t }| a |S )zSet global _warningAsExeption flag.

    Args:
        flag: value to set warnings-as-exceptions to [default: True]

    Returns:
        The previous value.
    )_warningAsException)flagoldr   r   r   warningAsException   s    
r.   c             G   sB   | |}x4t D ],\}}t||r|r8tr,|tr8t| P qW dS )a)  Issue a warning, accounting for SCons rules.

    Check if warnings for this class are enabled.
    If warnings are treated as exceptions, raise exception.
    Use the global warning-emitter _warningOut, which allows selecting
    different ways of presenting a traceback (see Script/Main.py)
    N)r&   
isinstancer+   _warningOut)r(   argsZwarningclsr,   r   r   r   warn   s    
r3   c          	   C   s   dd }x| D ]}d}| dr4d}|tdd }|dkrBd}n||d	 }yt | }W n$ tk
r   tjd
|  Y qX |rt| qt|t	rd}tj||  qt
| qW dS )a  Process requests to enable/disable warnings.

    The requests are strings passed to the --warn option or the
    SetOption('warn') function.

    An argument to this option should be of the form "warning-class"
    or "no-warning-class".  The warning class is munged and has
    the suffix "Warning" added in order to get an actual class name
    from the classes above, which we need to pass to the
    {enable,disable}WarningClass() functions.

    For example, "deprecated" will enable the DeprecatedWarning class.
    "no-dependency" will disable the DependencyWarning class.

    As a special case, --warn=all and --warn=no-all will enable or
    disable (respectively) the base class of all SCons warnings.
    c             S   s$   |  dd  dd} |  ddS )zxConvert a warning argument to SConsCase.

        The result is CamelCase, except "Scons" is changed to "SCons"
        -  ZSconsSCons)replacetitle)sr   r   r   _classmunge   s    z)process_warn_strings.<locals>._classmungeTzno-FNallr   WarningzNo warning type: '%s'
z)Can not disable mandataory warning: '%s'
)
startswithlenglobalsKeyErrorsysstderrwriter*   
issubclassr   r)   )Z	argumentsr;   argenable
class_namer(   Zfmtr   r   r   process_warn_strings   s&    



rI   )T)-__doc__rB   ZSCons.Errorsr7   ZErrorsZ	UserErrorr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r+   r0   r)   r*   r.   r3   rI   r   r   r   r   <module>   sR   
