
    ,h%                        d dl Zd dlmZ d dlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ ej                  rdd	lmZ dd
lmZ ddlmZ dej"                  ej$                  ej&                  e   ef      dej"                  e   fdZ G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d d e      Z  G d! d"e      Z!y)#    N)gettext)ngettext   )get_text_stderr)resolve_color_default)echo)format_filename)Command)Context)	Parameter
param_hintreturnc                 Z    | (t        | t              sdj                  d | D              S | S )Nz / c              3   2   K   | ]  }t        |        y wN)repr).0xs     R/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/click/exceptions.py	<genexpr>z$_join_param_hints.<locals>.<genexpr>   s     6a$q'6s   )
isinstancestrjoin)r   s    r   _join_param_hintsr      s.     jS&Azz6:666    c                        e Zd ZdZdZdeddf fdZdefdZdefdZdd	e	j                  e	j                  e	j                        ddfd
Z xZS )ClickExceptionz8An exception that Click can handle and show to the user.r   messager   Nc                 P    t         |   |       t               | _        || _        y r   )super__init__r   
show_colorr   )selfr   	__class__s     r   r!   zClickException.__init__   s$    ! -B,Cr   c                     | j                   S r   r   r#   s    r   format_messagezClickException.format_message&       ||r   c                     | j                   S r   r&   r'   s    r   __str__zClickException.__str__)   r)   r   filec                     |
t               }t        t        d      j                  | j	                               || j
                         y )NError: {message}r&   r,   color)r   r   _formatr(   r"   )r#   r,   s     r   showzClickException.show,   sA    <"$D !((1D1D1F(G//	
r   r   )__name__
__module____qualname____doc__	exit_coder   r!   r(   r+   tOptionalIOAnyr3   __classcell__r$   s   @r   r   r      s`    B I    
ADDK0 
D 
r   r   c                        e Zd ZdZdZddedej                  d   ddf fdZdd	ej                  ej                  ej                        ddfd
Z xZS )
UsageErrora+  An internal exception that signals a usage error.  This typically
    aborts any further handling.

    :param message: the error message to display.
    :param ctx: optionally the context that caused this error.  Click will
                fill in the context automatically in some situations.
       Nr   ctxr   r   c                     t         |   |       || _        | j                  r| j                  j                  | _        y d | _        y r   )r    r!   rB   commandcmd)r#   r   rB   r$   s      r   r!   zUsageError.__init__B   s4    !<@HH(8(8$r   r,   c                 6   |
t               }d }d}| j                  {| j                  j                  j                  | j                        Lt	        d      j                  | j                  j                  | j                  j                  d         }| d}| j                  A| j                  j                  }t        | j                  j                          d| ||       t        t	        d      j                  | j                               ||       y )	N z"Try '{command} {option}' for help.r   )rD   option
r/   r.   r&   )r   rB   rD   get_help_optionr1   r2   command_pathhelp_option_namesr0   r   	get_usager(   )r#   r,   r0   hints       r   r3   zUsageError.showG   s    <"$DHH   00:F9:AA--dhh6P6PQR6S B D V2;D88HHNNEDHH&&()D62UK !((1D1D1F(G	
r   r   )r4   r5   r6   r7   r8   r   r9   r:   r!   r;   r<   r3   r=   r>   s   @r   r@   r@   7   s^     IO O!**Y*? O4 O

ADDK0 
D 
r   r@   c                        e Zd ZdZ	 	 	 ddedej                  d   dej                  d   dej                  e   d	df
 fd
Zd	efdZ xZ	S )BadParametera  An exception that formats out a standardized error message for a
    bad parameter.  This is useful when thrown from a callback or type as
    Click will attach contextual information to it (for instance, which
    parameter it is).

    .. versionadded:: 2.0

    :param param: the parameter object that caused this error.  This can
                  be left out, and Click will attach this info itself
                  if possible.
    :param param_hint: a string that shows up as parameter name.  This
                       can be used as alternative to `param` in cases
                       where custom validation should happen.  If it is
                       a string it's used as such, if it's a list then
                       each item is quoted and separated.
    Nr   rB   r   paramr   r   r   c                 B    t         |   ||       || _        || _        y r   )r    r!   rQ   r   )r#   r   rB   rQ   r   r$   s        r   r!   zBadParameter.__init__p   s"     	#&
$r   c                 @   | j                   | j                   }nW| j                  &| j                  j                  | j                        }n%t	        d      j                  | j                        S t	        d      j                  t        |      | j                        S )NzInvalid value: {message}r&   z)Invalid value for {param_hint}: {message})r   r   )r   rQ   get_error_hintrB   r1   r2   r   r   )r#   r   s     r   r(   zBadParameter.format_message{   s    ??&JZZ#22488<J/0777MM<=DD(4dll E 
 	
r   NNN
r4   r5   r6   r7   r   r9   r:   r!   r(   r=   r>   s   @r   rP   rP   ^   sn    ( &*)-&*	%	% ZZ	"	% zz+&		%
 JJsO	% 
	%

 

r   rP   c                        e Zd ZdZ	 	 	 	 	 ddej
                  e   dej
                  d   dej
                  d   dej
                  e   d	ej
                  e   d
df fdZd
efdZd
efdZ	 xZ
S )MissingParametera  Raised if click required an option or argument but it was not
    provided when invoking the script.

    .. versionadded:: 4.0

    :param param_type: a string that indicates the type of the parameter.
                       The default is to inherit the parameter type from
                       the given `param`.  Valid values are ``'parameter'``,
                       ``'option'`` or ``'argument'``.
    Nr   rB   r   rQ   r   r   
param_typer   c                 @    t         |   |xs d|||       || _        y )NrG   )r    r!   rY   )r#   r   rB   rQ   r   rY   r$   s         r   r!   zMissingParameter.__init__   s#     	BUJ?$r   c                    | j                   | j                   }n4| j                  &| j                  j                  | j                        }nd }t	        |      }|rd| nd}| j
                  }|"| j                  | j                  j                  }| j                  }| j                  >| j                  j                  j                  | j                        }|r|r	|d| z  }n|}|rd| nd}|dk(  rt        d      }n=|dk(  rt        d      }n,|dk(  rt        d	      }nt        d
      j                  |      }| | d| S )N rG   z. argumentzMissing argumentrH   zMissing option	parameterzMissing parameterzMissing {param_type})rY   .)r   rQ   rT   rB   r   rY   param_type_namer   typeget_missing_messager1   r2   )r#   r   rY   msg	msg_extramissings         r   r(   zMissingParameter.format_message   s@   ??&*.//JZZ#22488<JJ&z2
)3q%
__
$**"833Jll::!

;;DJJGIR	{++C#C#iB #*+G8#()G;&+,G./66*6MG:,au--r   c                     | j                   s?| j                  r| j                  j                  nd }t        d      j	                  |      S | j                   S )NzMissing parameter: {param_name})
param_name)r   rQ   namer1   r2   )r#   rg   s     r   r+   zMissingParameter.__str__   sB    ||,0JJDJ67>>*>UU<<r   )NNNNN)r4   r5   r6   r7   r9   r:   r   r!   r(   r+   r=   r>   s   @r   rX   rX      s    	 $(%))-&*&*	%C	% ZZ	"	% zz+&		%
 JJsO	% JJsO	% 
	%$. $.L   r   rX   c                        e Zd ZdZ	 	 	 ddedej                  e   dej                  ej                  e      dej                  d   ddf
 fd	Zdefd
Z	 xZ
S )NoSuchOptionzfRaised if click attempted to handle an option that does not
    exist.

    .. versionadded:: 4.0
    Noption_namer   possibilitiesrB   r   r   c                 |    |t        d      j                  |      }t        |   ||       || _        || _        y )NzNo such option: {name})rh   )r1   r2   r    r!   rk   rl   )r#   rk   r   rl   rB   r$   s        r   r!   zNoSuchOption.__init__   sB     ?0188k8JG#&&*r   c                     | j                   s| j                  S dj                  t        | j                               }t	        ddt        | j                               j                  ||      }| j                   d| S )Nz, zDid you mean {possibility}?z#(Possible options: {possibilities}))possibilityrl   r\   )rl   r   r   sortedr   lenr2   )r#   possibility_strsuggests      r   r(   zNoSuchOption.format_message   sv    !!<<))F4+=+=$>?)1""#
 &_O&
L	 	
 ,,q	**r   rU   )r4   r5   r6   r7   r   r9   r:   Sequencer!   r(   r=   r>   s   @r   rj   rj      sv     $(59%)++ C+ zz!**S/2	+
 ZZ	"+ 
+
+ 
+r   rj   c            	       R     e Zd ZdZ	 d	dededej                  d   ddf fdZ xZS )
BadOptionUsagea  Raised if an option is generally supplied but the use of the option
    was incorrect.  This is for instance raised if the number of arguments
    for an option is not correct.

    .. versionadded:: 4.0

    :param option_name: the name of the option being used incorrectly.
    Nrk   r   rB   r   r   c                 4    t         |   ||       || _        y r   )r    r!   rk   )r#   rk   r   rB   r$   s       r   r!   zBadOptionUsage.__init__   s     	#&&r   r   )	r4   r5   r6   r7   r   r9   r:   r!   r=   r>   s   @r   rv   rv      sB     LP''),'34::i3H'	' 'r   rv   c                       e Zd ZdZy)BadArgumentUsagezRaised if an argument is generally supplied but the use of the argument
    was incorrect.  This is for instance raised if the number of values
    for an argument is not correct.

    .. versionadded:: 6.0
    Nr4   r5   r6   r7    r   r   ry   ry      s    r   ry   c                   X     e Zd ZdZddedej                  e   ddf fdZdefdZ xZ	S )		FileErrorz"Raised if a file cannot be opened.NfilenamerN   r   c                 l    |t        d      }t        | 	  |       t        |      | _        || _        y )Nzunknown error)r1   r    r!   r	   ui_filenamer~   )r#   r~   rN   r$   s      r   r!   zFileError.__init__  s3    <_%D / 9 r   c                 b    t        d      j                  | j                  | j                        S )Nz+Could not open file {filename!r}: {message})r~   r   )r1   r2   r   r   r'   s    r   r(   zFileError.format_message  s0    >?FF%%t|| G 
 	
r   r   rV   r>   s   @r   r}   r}   	  s4    ,! !AJJsO !t !
 
r   r}   c                       e Zd ZdZy)Abortz=An internal signalling exception that signals Click to abort.Nrz   r{   r   r   r   r     s    Gr   r   c                   &    e Zd ZdZdZddeddfdZy)ExitzAn exception that indicates that the application should exit with some
    status code.

    :param code: the status code to exit with.
    r8   coder   Nc                     || _         y r   r   )r#   r   s     r   r!   zExit.__init__'  s	    "r   )r   )r4   r5   r6   r7   	__slots__intr!   r{   r   r   r   r     s!     I#S # #r   r   )"typingr9   r   r1   r   _compatr   globalsr   utilsr   r	   TYPE_CHECKINGcorer
   r   r   r:   Unionrt   r   r   	Exceptionr   r@   rP   rX   rj   rv   ry   r}   RuntimeErrorr   r   r{   r   r   <module>r      s        $ *  "??

1771::c?C#789ZZ_
Y 
<$
 $
N'
: '
TB | B J+: +D'Z '"z 
 
"HL H
#< 
#r   