o
    yAf                     @  sL   d dl mZ d dlZd dlZd dlmZ G dd dZG dd dZeZ	dS )    )annotationsN)Anyc                   @  s   e Zd ZdZd'ddZed(ddZed)d*ddZd)d*ddZ	d)d*ddZ
d)d*ddZd)d*ddZd)d*ddZd+d,ddZd)d*ddZd+d-d!d"Zd.d$d%Zd&S )/Applicationa  
    The way output is displayed can be [configured](../config/hatch.md#terminal) by users.

    !!! important
        Never import this directly; Hatch judiciously decides if a type of plugin requires
        the capabilities herein and will grant access via an attribute.
    returnNonec                 C  s*   t tjddt tjdd | _d S )NZHATCH_VERBOSE0ZHATCH_QUIET)intosenvironget_Application__verbosityself r   9/usr/lib/python3.10/site-packages/hatchling/bridge/app.py__init__   s   *zApplication.__init__r   c                 C  s   | j S )zP
        The verbosity level of the application, with 0 as the default.
        )r   r   r   r   r   	verbosity   s   zApplication.verbosity messagestrkwargsr   c                 K  s   t |  d S N)_display)r   r   r   r   r   display   s   zApplication.displayc                 K     | j dkrt| dS dS )zL
        Meant to be used for messages conveying basic information.
        r   Nr   r   r   r   r   r   r   r   display_info       
zApplication.display_infoc                 K  r   )zc
        Meant to be used for messages shown before potentially time consuming operations.
        r   Nr   r   r   r   r   display_waiting'   r   zApplication.display_waitingc                 K  r   )zQ
        Meant to be used for messages indicating some positive outcome.
        r   Nr   r   r   r   r   display_success.   r   zApplication.display_successc                 K  r   )zP
        Meant to be used for messages conveying important information.
        Nr   r   r   r   r   display_warning5   r   zApplication.display_warningc                 K  r   )zT
        Meant to be used for messages indicating some unrecoverable error.
        Nr   r   r   r   r   display_error<   r   zApplication.display_error   levelc                 K  s<   d|  kr
dksn d}t || j|krt| dS dS )z
        Meant to be used for messages that are not useful for most user experiences.
        The `level` option must be between 1 and 3 (inclusive).
        r%      zGDebug output can only have verbosity levels between 1 and 3 (inclusive)N)
ValueErrorr   r   )r   r   r&   r   error_messager   r   r   display_debugC   s   
zApplication.display_debugc                 K  s"   | j dkrtd| d d S d S )Nr   []r   r   r   r   r   display_mini_headerO   s   
zApplication.display_mini_headercodec                 K  s$   |r| j dkrt| t| dS )zC
        Terminate the program with the given return code.
        r#   N)r   r   sysexit)r   r   r.   r   r   r   r   abortS   s   zApplication.abortSafeApplicationc                 C  s   t | S r   )r2   r   r   r   r   get_safe_application\   s   z Application.get_safe_applicationN)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   r2   )__name__
__module____qualname____doc__r   propertyr   staticmethodr   r   r   r    r"   r$   r*   r-   r1   r3   r   r   r   r   r      s     
	r   c                   @  s   e Zd ZdddZdS )	r2   appr   r   r   c                 C  sT   |j | _ |j| _|j| _|j| _|j| _|j| _|j| _|j| _|j| _|j	| _	d S r   )
r1   r   r   r   r$   r    r   r"   r*   r-   )r   r:   r   r   r   r   a   s   zSafeApplication.__init__N)r:   r   r   r   )r4   r5   r6   r   r   r   r   r   r2   `   s    r2   )

__future__r   r	   r/   typingr   r   r2   printr   r   r   r   r   <module>   s    X