
    Dh!                         d Z ddlZddlZddlmZmZmZ ddlmZ ddl	m
Z
mZ erddlmZ d	efd
Zded	efdZd	efdZy)zDecorators Hub.    N)TYPE_CHECKINGAnyCallable   )RefreshOption)ReadTimeoutErrorWriteTimeoutError   )MySQLConnectionAbstractreturnc                  &    dt         dt         fd} | S )z|Decorator verifying which options are relevant and which aren't based on
    the server version the client is connecting to.cmd_refreshr   c           	      l     t        j                         dddt        dt        dt        f fd       }|S )Ncnxr   argskwargsr   c                    K   |d   }|t         j                  z  r+| j                  dk\  rt        j                  dt
        d        | |fi | d {   S 7 w)Nr   )	   r   r   zAs of MySQL Server 9.2.0, refreshing grant tables is not needed if you use statements GRANT, REVOKE, CREATE, DROP, or ALTER. You should expect this option to be unsupported in a future version of MySQL Connector/Python when MySQL Server removes it.r
   category
stacklevel)r   GRANTserver_versionwarningswarnDeprecationWarning)r   r   r   optionsr   s       uC:\Users\Erick Rodrigues\AppData\Local\Programs\Python\Python312\Lib\site-packages\mysql/connector/aio/_decorating.pywrapperz>cmd_refresh_verify_options.<locals>.decorator.<locals>.wrapper0   si       7G----33E3E J 4
 V 0  %S'<V<<<<s   AAAA	functoolswrapsr   r   )r   r   s   ` r   	decoratorz-cmd_refresh_verify_options.<locals>.decorator/   sE    		%	=*	=36	=BE	=	= 
&	=(     r   r#   s    r   cmd_refresh_verify_optionsr'   +   s    x H 0 r$   reasonc                 ,     dt         dt         f fd}|S )z&Use it to decorate deprecated methods.funcr   c                 l     t        j                         dt        dt        dt        f fd       }|S )Nr   r   r   c                     K   t        j                  dj                   d t        d        | i | d {   S 7 w)NzCall to deprecated function z
. Reason: r   r   )r   r   __name__r   )r   r   r*   r(   s     r   r   z.deprecated.<locals>.decorator.<locals>.wrapperN   sE     MM.t}}oZxP+
 t.v....s   8AA Ar    )r*   r   r(   s   ` r   r#   zdeprecated.<locals>.decoratorM   s:    			/ 	/ 	/ 	/ 
	/ r$   r%   )r(   r#   s   ` r   
deprecatedr.   J   s    
 
X 
 r$   c                  &    dt         dt         fd} | S )z
    Decorator to close the current connection if a read or a write timeout
    is raised by the method passed via the func parameter.
    
cnx_methodr   c           	      l     t        j                         dddt        dt        dt        f fd       }|S )Nr   r   r   r   r   c                    K   	  | g|i | d {   S 7 # t         $ r6}t        |t        t        f      r| j	                          d {  7   |d }~ww xY ww)N)	Exception
isinstancer   r	   close)r   r   r   errr0   s       r   handle_cnx_methodzGhandle_read_write_timeout.<locals>.decorator.<locals>.handle_cnx_methodc   s[     '=d=f==== c$46G#HI))+%%	s<   A  A 	A)AAAAA)r!   r"   r   )r0   r7   s   ` r   r#   z,handle_read_write_timeout.<locals>.decoratorb   sF    		$	*	36	BE		 
%	 ! r$   r%   r&   s    r   handle_read_write_timeoutr8   \   s    !h !8 ! r$   )__doc__r!   r   typingr   r   r   	constantsr   errorsr   r	   	abstractsr   r'   strr.   r8    r$   r   <module>r@      sM   :    / / % 82H >s x $8 r$   