
    l:i                         d dl mZ d dlmZ d dlZd dlmZ d dlZddlmZ ddl	m
Z
 d Zd	 Zd
 Zd Zd Zd Zd Zd Zed        Zd Zd Zd Zd Zy)    )contextmanager)datetimeN)format_exception   )settings)constc                 (    t         j                  ry| S )z0Utility for ability to disabling colored output. )r   	no_colors)color_s    C/var/www/html/bot/venv/lib/python3.12/site-packages/thefuck/logs.pycolorr      s        c                 V   t         j                  j                  dj                  t	        t
        j                  j                  t
        j                  j                  z   t
        j                  j                  z         t	        t
        j                  j                        |              y )Nz{warn}[WARN] {title}{reset}
)warnresettitle)sysstderrwriteformatr   coloramaBackREDForeWHITEStyleBRIGHT	RESET_ALL)r   s    r   r   r      sq    JJ5<<8==$$x}}':'::^^**+ ,HNN,,-	 =  r   c                    t         j                  j                  dj                  t	        t
        j                  j                  t
        j                  j                  z   t
        j                  j                  z         t	        t
        j                  j                        | dj                  t        |                    y )NzO{warn}[WARN] {title}:{reset}
{trace}{warn}----------------------------{reset}

r
   )r   r   r   trace)r   r   r   r   r   r   r   r   r   r   r   r   r   joinr   )r   exc_infos     r   	exceptionr$      s    JJ	99?x}}((8==+>+>>!../ 0001''*H56 :@ :89r   c                 N    t        dj                  | j                        |       y )NzRule {})r$   r   name)ruler#   s     r   rule_failedr(   '   s    j		*H5r   c           	          t         j                  j                  dj                  | t	        t
        j                  j                        t	        t
        j                  j                                     y )Nz{red}{msg}{reset}
)msgredr   )
r   r   r   r   r   r   r   r   r   r   r*   s    r   failedr-   +   sN    JJ+22(--##$HNN,,- 3 / 0r   c                 :   t         j                  j                  dj                  t        j
                  | j                  | j                  rdndt        t        j                  j                        t        t        j                  j                                     y )Nz+{prefix}{bold}{script}{reset}{side_effect}
 (+side effect)r
   )prefixscriptside_effectboldr   )r   r   r   r   r   USER_COMMAND_MARKr1   r2   r   r   r   r   r   corrected_commands    r   show_corrected_commandr7   2   sl    JJDKK&& ''*;*G*G&S8>>(()HNN,,- L / 0r   c                    t         j                  j                  dj                  t        j
                  | j                  | j                  rdnddt        t        j                  j                        t        t        j                  j                        t        t        j                  j                        t        t        j                  j                        t        t        j                  j                         	             y )Nu|   {prefix}{clear}{bold}{script}{reset}{side_effect} [{green}enter{reset}/{blue}↑{reset}/{blue}↓{reset}/{red}ctrl+c{reset}]r/   r
   z[1K)	r0   r1   r2   clearr3   greenr+   r   blue)r   r   r   r   r   r4   r1   r2   r   r   r   r   r   GREENr   r   BLUEr5   s    r   confirm_textr>   ;   s    JJ
!"(&**$++->-J-J)PRx~~,,-++,hmm''(001x}}))* #) 	#,-r   c           
      P   t         j                  rt        j                  j	                  dj                  | t        t        j                  j                        t        t        j                  j                        t        t        j                  j                                     y y )Nz {blue}{bold}DEBUG:{reset} {msg}
)r*   r   r;   r3   )r   debugr   r   r   r   r   r   r   r   r   r=   r   r,   s    r   r@   r@   K   sm    ~~

=DD001x}}))*x~~,,-	 E / 	0 r   c           	   #     K   t        j                         }	 d  t        dj                  | t        j                         |z
               y # t        dj                  | t        j                         |z
               w xY ww)Nz{} took: {})r   nowr@   r   )r*   starteds     r   
debug_timerD   T   sZ     llnGDn##C')ABCn##C')ABCs   BA 1B2A??Bc           	         t        dj                  t        t        j                  j
                        t        t        j                  j                                     | rt         dj                  dt        t        j                  j
                        t        t        j                  j                        d| j                                | j                  r^t        dj                  t        t        j                  j
                        t        t        j                  j                                     t        d       y )Nz4Seems like {bold}fuck{reset} alias isn't configured!)r3   r   zPlease put {bold}{content}{reset} in your {bold}{path}{reset} and apply changes with {bold}{reload}{reset} or restart your shell.zEOr run {bold}fuck{reset} a second time to configure it automatically.zBMore details - https://github.com/nvbn/thefuck#manual-installation )	printr   r   r   r   r   r   _asdictcan_configure_automaticallyconfiguration_detailss    r   how_to_configure_aliasrL   ]   s    	
A
H
H8>>(()HNN,,- I / 0 P IIO3 8>>001HNN445	3
 (//13	4 !<<&&,fx~~445 8 89 '- ';< 

OPr   c                     t        dj                  t        t        j                  j
                        t        t        j                  j                        | j                               y )Nz|Seems like {bold}fuck{reset} alias already configured!
For applying changes run {bold}{reload}{reset} or restart your shell.r3   r   reloadrG   r   r   r   r   r   r   rO   rJ   s    r   already_configuredrQ   u   K    		##)6x~~,,-001(// $* $12r   c                     t        dj                  t        t        j                  j
                        t        t        j                  j                        | j                               y )Nzv{bold}fuck{reset} alias configured successfully!
For applying changes run {bold}{reload}{reset} or restart your shell.rN   rP   rJ   s    r   configured_successfullyrT      rR   r   c                 d    t         j                  j                  dj                  | ||             y )Nz#The Fuck {} using Python {} and {}
)r   r   r   r   )thefuck_versionpython_version
shell_infos      r   versionrY      s,    JJ/667E7A	CDr   )
contextlibr   r   r   	tracebackr   r   confr   r
   r   r   r   r$   r(   r-   r7   r>   r@   rD   rL   rQ   rT   rY   rF   r   r   <module>r]      sp    &  
 &   9600- 0 D DQ022Dr   