a
    SicI                     @   s   d Z ddlZddlmZ ejeeje  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dS )zException classes in ABSL flags library.

Do NOT import this module directly. Import the flags package and use the
aliases defined at the package level instead.
    N)_helpersc                   @   s   e Zd ZdZdS )Errorz$The base class for all flags errors.N__name__
__module____qualname____doc__ r	   r	   R/var/www/html/django/DPS/env/lib/python3.9/site-packages/absl/flags/_exceptions.pyr      s   r   c                   @   s   e Zd ZdZdS )CantOpenFlagFileErrorz`Raised when flagfile fails to open.

  E.g. the file doesn't exist, or has wrong permissions.
  Nr   r	   r	   r	   r
   r   !   s   r   c                   @   s   e Zd ZdZedddZdS )DuplicateFlagErrorz*Raised if there is a flag naming conflict.Nc                 C   sP   |j |dd}|du r t }n|j |dd}|| j}d||||f }| |S )a  Creates a DuplicateFlagError by providing flag name and values.

    Args:
      flagname: str, the name of the flag being redefined.
      flag_values: :class:`FlagValues`, the FlagValues instance containing the
        first definition of flagname.
      other_flag_values: :class:`FlagValues`, if it is not None, it should be
        the FlagValues object where the second definition of flagname occurs.
        If it is None, we assume that we're being called when attempting to
        create the flag a second time, and we use the module calling this one
        as the source of the second definition.

    Returns:
      An instance of DuplicateFlagError.
    z	<unknown>)defaultNzeThe flag '%s' is defined twice. First from %s, Second from %s.  Description from first occurrence: %s)Zfind_module_defining_flagr   get_calling_modulehelp)clsflagnameflag_valuesZother_flag_valuesZfirst_moduleZsecond_moduleZflag_summarymsgr	   r	   r
   	from_flag+   s    

zDuplicateFlagError.from_flag)N)r   r   r   r   classmethodr   r	   r	   r	   r
   r   (   s   r   c                   @   s   e Zd ZdZdS )IllegalFlagValueErrorz6Raised when the flag command line argument is illegal.Nr   r	   r	   r	   r
   r   J   s   r   c                       s"   e Zd ZdZd fdd	Z  ZS )UnrecognizedFlagErrorzRaised when a flag is unrecognized.

  Attributes:
    flagname: str, the name of the unrecognized flag.
    flagvalue: The value of the flag, empty if the flag is not defined.
   Nc                    s@   || _ || _|r dd| }nd}tt| d||f  d S )Nz. Did you mean: %s ?z, r   z Unknown command line flag '%s'%s)r   	flagvaluejoinsuperr   __init__)selfr   r   suggestionsZtip	__class__r	   r
   r   V   s    

zUnrecognizedFlagError.__init__)r   N)r   r   r   r   r   __classcell__r	   r	   r   r
   r   N   s   r   c                   @   s   e Zd ZdZdS )UnparsedFlagAccessErrorzGRaised when accessing the flag value from unparsed :class:`FlagValues`.Nr   r	   r	   r	   r
   r"   c   s   r"   c                   @   s   e Zd ZdZdS )ValidationErrorz7Raised when flag validator constraint is not satisfied.Nr   r	   r	   r	   r
   r#   g   s   r#   c                   @   s   e Zd ZdZdS ) FlagNameConflictsWithMethodErrorzCRaised when a flag name conflicts with :class:`FlagValues` methods.Nr   r	   r	   r	   r
   r$   k   s   r$   )r   sys
absl.flagsr   disclaim_module_idsaddidmodulesr   	Exceptionr   r   r   r   r   r"   r#   r$   r	   r	   r	   r
   <module>   s   "