§
    øyIf  ã                  óð   — d Z ddlmZ ddlZddlZddl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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 ddlmZ  ej        e¦  «        Z G d„ d¦  «        ZdS )z3Module containing the application logic for Flake8.é    )ÚannotationsN)ÚSequence)Úchecker)Údefaults)Ú
exceptions)Ústyle_guide)ÚBaseFormatter)Údebug)Ú
parse_args)Úfinder)Úreporterc                  óz   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dd„Z
dd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚApplicationz&Abstract our application into a class.ÚreturnÚNonec                ó´   — t          j         ¦   «         | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _	        d| _
        dS )zInitialize our application.Nr   F)ÚtimeÚ
start_timeÚend_timeÚpluginsÚ	formatterÚguideÚfile_checker_managerÚoptionsÚresult_countÚtotal_result_countÚcatastrophic_failure©Úselfs    úK/var/www/piapp/venv/lib/python3.11/site-packages/flake8/main/application.pyÚ__init__zApplication.__init__   sh   € õ œ)™+œ+ˆŒà&*ˆŒà.2ˆŒà/3ˆŒð <@ˆŒ
ð =AˆÔ!ð 37ˆŒð ˆÔð #$ˆÔð %*ˆÔ!Ð!Ð!ó    Úintc                ór   — | j         rdS | j        €J ‚| j        j        rdS t          | j        dk    ¦  «        S )zReturn the program exit code.é   Nr   )r   r   Ú	exit_zeror#   r   r   s    r    Ú	exit_codezApplication.exit_code:   sH   € àÔ$ð 	Ø�1ØŒ|Ð'Ð'Ð'ØŒ<Ô!ð 	.Ø�1å�tÔ(¨1Ò,Ñ-Ô-Ð-r"   c                ó|   — | j         €J ‚| j        €J ‚t          j        | j         j        | j        ¦  «        | _        dS )z3Initialize a formatter based on the parsed options.N)r   r   r   ÚmakeÚ	reportersr   r   s    r    Úmake_formatterzApplication.make_formatterD   s<   € àŒ|Ð'Ð'Ð'ØŒ|Ð'Ð'Ð'Ý!œ t¤|Ô'=¸t¼|ÑLÔLˆŒˆˆr"   c                ór   — | j         €J ‚| j        €J ‚t          j        | j        | j         ¦  «        | _        dS )zInitialize our StyleGuide.N)r   r   r   ÚStyleGuideManagerr   r   s    r    Ú
make_guidezApplication.make_guideJ   s?   € àŒ~Ð)Ð)Ð)ØŒ|Ð'Ð'Ð'Ý Ô2ØŒL˜$œ.ñ
ô 
ˆŒ
ˆ
ˆ
r"   ÚargvúSequence[str]c                ó€   — | j         €J ‚| j        €J ‚t          j        | j         | j        j        |¬¦  «        | _        dS )z#Initialize our FileChecker Manager.N)r   r   r/   )r   r   r   ÚManagerÚcheckersr   ©r   r/   s     r    Úmake_file_checker_managerz%Application.make_file_checker_managerR   sM   € àŒzÐ%Ð%Ð%ØŒ|Ð'Ð'Ð'Ý$+¤OØœ
Ø”LÔ)Øð%
ñ %
ô %
ˆÔ!Ð!Ð!r"   c                ó²  — | j         €J ‚| j                              ¦   «          	 | j                              ¦   «          nN# t          j        $ r<}t          t          |¦  «        ¦  «         t          d¦  «         d| _        Y d}~nd}~ww xY wt           	                    d¦  «         | j          
                    ¦   «          t          j        ¦   «         | _        dS )zÊRun the actual checks with the FileChecker Manager.

        This method encapsulates the logic to make a
        :class:`~flake8.checker.Manger` instance run the checks it is
        managing.
        Nz5Run flake8 with greater verbosity to see more detailsTzFinished running)r   ÚstartÚrunr   ÚPluginExecutionFailedÚprintÚstrr   ÚLOGÚinfoÚstopr   r   )r   Úplugin_faileds     r    Ú
run_checkszApplication.run_checks\   sÞ   € ð Ô(Ð4Ð4Ð4àÔ!×'Ò'Ñ)Ô)Ð)ð	-ØÔ%×)Ò)Ñ+Ô+Ð+Ð+øÝÔ/ð 	-ð 	-ð 	-Ý•#�mÑ$Ô$Ñ%Ô%Ð%ÝÐIÑJÔJÐJØ(,ˆDÔ%Ð%Ð%Ð%Ð%Ð%øøøøð	-øøøõ 	�ŠÐ#Ñ$Ô$Ð$ØÔ!×&Ò&Ñ(Ô(Ð(Ýœ	™œˆŒˆˆs   ¤> ¾B	Á2BÂB	c                ó†  — | j         €J ‚| j         j        sdS | j        €J ‚| j        €J ‚| j        | j        z
  }d|fg}|j        }t          j        dz   D ]I}| j        j        |         }d|› d�} |||f¦  «         |› d�} ||t          ||z  ¦  «        f¦  «         ŒJ| j
        €J ‚| j
                             |¦  «         dS )z9Aggregate, calculate, and report benchmarks for this run.Nzseconds elapsed)Úfilesztotal z
 processedz processed per second)r   Ú	benchmarkr   r   r   Úappendr   ÚSTATISTIC_NAMESÚ
statisticsr#   r   Úshow_benchmarks)r   Útime_elapsedrF   Úadd_statisticÚ	statisticÚvalueÚtotal_descriptionÚper_second_descriptions           r    Úreport_benchmarkszApplication.report_benchmarksp   s  € àŒ|Ð'Ð'Ð'ØŒ|Ô%ð 	ØˆFàÔ(Ð4Ð4Ð4ØŒ}Ð(Ð(Ð(Ø”} t¤Ñ6ˆØ(¨,Ð7Ð8ˆ
Ø"Ô)ˆÝ!Ô1°JÑ>ð 	Oð 	OˆIØÔ-Ô8¸ÔCˆEØ >¨Ð >Ð >Ð >ÐØˆMÐ,¨eÐ4Ñ5Ô5Ð5Ø(1Ð%HÐ%HÐ%HÐ"ØˆMÐ1µ3°u¸|Ñ7KÑ3LÔ3LÐMÑNÔNÐNÐNàŒ~Ð)Ð)Ð)ØŒ×&Ò& zÑ2Ô2Ð2Ð2Ð2r"   c                óè   — t                                d¦  «         | j        €J ‚| j                             ¦   «         }|\  | _        | _        t                                d| j        | j        ¦  «         dS )z¾Report all the errors found by flake8 3.0.

        This also updates the :attr:`result_count` attribute with the total
        number of errors, warnings, and other messages found.
        zReporting errorsNz.Found a total of %d violations and reported %d)r<   r=   r   Úreportr   r   )r   Úresultss     r    Úreport_errorszApplication.report_errors…   sy   € õ 	�ŠÐ#Ñ$Ô$Ð$ØÔ(Ð4Ð4Ð4ØÔ+×2Ò2Ñ4Ô4ˆØ5<Ñ2ˆÔ Ô!2Ý�ŠØ<ØÔ#ØÔñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó    — | j         €J ‚| j         j        sdS | j        €J ‚| j        €J ‚| j                             | j        j        ¦  «         dS )z.Aggregate and report statistics from this run.N)r   rF   r   r   Úshow_statisticsÚstatsr   s    r    Úreport_statisticszApplication.report_statistics•   s_   € àŒ|Ð'Ð'Ð'ØŒ|Ô&ð 	ØˆFàŒ~Ð)Ð)Ð)ØŒzÐ%Ð%Ð%ØŒ×&Ò& t¤zÔ'7Ñ8Ô8Ð8Ð8Ð8r"   c                ó~  — t          |¦  «        \  | _        | _        | j        j        rWt	          j        t          j        | j        ¦  «        }t          t          j
        |dd¬¦  «        ¦  «         t          d¦  «        ‚|                      ¦   «          |                      ¦   «          |                      |¦  «         dS )z—Initialize the application to be run.

        This finds the plugins, registers their options, and parses the
        command-line arguments.
        é   T)ÚindentÚ	sort_keysr   N)r   r   r   Ú
bug_reportr
   ÚinformationÚflake8Ú__version__r:   ÚjsonÚdumpsÚ
SystemExitr+   r.   r5   )r   r/   r=   s      r    Ú
initializezApplication.initializeŸ   s¥   € õ &0°Ñ%5Ô%5Ñ"ˆŒ�d”làŒ<Ô"ð 	 ÝÔ$¥VÔ%7¸¼ÑFÔFˆDÝ•$”*˜T¨!°tÐ<Ñ<Ô<Ñ=Ô=Ð=Ý˜Q‘-”-Ðà×ÒÑÔÐØ�ŠÑÔÐØ×&Ò& tÑ,Ô,Ð,Ð,Ð,r"   c                óô   — | j         €J ‚| j                              ¦   «          |                      ¦   «          |                      ¦   «          |                      ¦   «          | j                              ¦   «          dS )z*Report errors, statistics, and benchmarks.N)r   r7   rR   rV   rN   r>   r   s    r    rP   zApplication.report°   st   € àŒ~Ð)Ð)Ð)ØŒ×ÒÑÔÐØ×ÒÑÔÐØ×ÒÑ Ô Ð Ø×ÒÑ Ô Ð ØŒ×ÒÑÔÐÐÐr"   c                ó€   — |                       |¦  «         |                      ¦   «          |                      ¦   «          d S )N)rb   r@   rP   r4   s     r    Ú_runzApplication._run¹   s5   € Ø�Š˜ÑÔÐØ�ŠÑÔÐØ�Š‰Œˆˆˆr"   c                óH  — 	 |                       |¦  «         | j        €J ‚| j        j        rt          | j        ¦  «         dS dS # t
          $ rU}t          d¦  «         t                               d¦  «         t                               |¦  «         d| _	        Y d}~dS d}~wt          j        $ rJ}t          d¦  «         t          |¦  «         t                               |¦  «         d| _	        Y d}~dS d}~wt          j        $ r d| _	        t          d¦  «         Y dS w xY w)zûRun our application.

        This method will also handle KeyboardInterrupt exceptions for the
        entirety of the flake8 application. If it sees a KeyboardInterrupt it
        will forcibly clean up the :class:`~flake8.checker.Manager`.
        Nz... stoppedz#Caught keyboard interrupt from userTz6There was a critical error during execution of Flake8:z"... stopped while processing files)re   r   Úcountr:   r   ÚKeyboardInterruptr<   ÚcriticalÚ	exceptionr   r   ÚExecutionErrorÚ	EarlyQuit)r   r/   Úexcs      r    r8   zApplication.run¾   sV  € ð	)Ø�IŠI�d‰OŒOˆOð ”<Ð+Ð+Ð+ØŒ|Ô!ð )Ý�dÔ'Ñ(Ô(Ð(Ð(Ð(ð)ð )øõ !ð 	-ð 	-ð 	-Ý�-Ñ Ô Ð Ý�LŠLÐ>Ñ?Ô?Ð?Ý�MŠM˜#ÑÔÐØ(,ˆDÔ%Ð%Ð%Ð%Ð%Ð%Ð%øøøøÝÔ(ð 	-ð 	-ð 	-ÝÐJÑKÔKÐKÝ�#‰JŒJˆJÝ�MŠM˜#ÑÔÐØ(,ˆDÔ%Ð%Ð%Ð%Ð%Ð%Ð%øøøøÝÔ#ð 	8ð 	8ð 	8Ø(,ˆDÔ%ÝÐ6Ñ7Ô7Ð7Ð7Ð7Ð7ð	8øøøs*   ‚A Á
D!ÁA
BÂD!Â0?C5Ã5(D!Ä D!N)r   r   )r   r#   )r/   r0   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r!   r'   r+   r.   r5   r@   rN   rR   rV   rb   rP   re   r8   © r"   r    r   r      s"  € € € € € Ø0Ð0ð*ð *ð *ð *ð<.ð .ð .ð .ðMð Mð Mð Mð
ð 
ð 
ð 
ð
ð 
ð 
ð 
ð$ð $ð $ð $ð(3ð 3ð 3ð 3ð*
ð 
ð 
ð 
ð 9ð 9ð 9ð 9ð-ð -ð -ð -ð"ð ð ð ðð ð ð ð
)ð )ð )ð )ð )ð )r"   r   )rq   Ú
__future__r   Úargparser_   Úloggingr   Útypingr   r]   r   r   r   r   Úflake8.formatting.baser	   Úflake8.mainr
   Úflake8.options.parse_argsr   Úflake8.pluginsr   r   Ú	getLoggerrn   r<   r   rr   r"   r    ú<module>r|      sN  ðØ 9Ð 9Ø "Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð à €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø !Ð !Ð !Ð !Ð !Ð !Ø #Ð #Ð #Ð #Ð #Ð #ð €gÔ˜Ñ!Ô!€ð~)ð ~)ð ~)ð ~)ð ~)ñ ~)ô ~)ð ~)ð ~)ð ~)r"   