§
    îyIf®  ã                   ó¬   — d Z ddlZddlZddlZddlZddlZddlmZmZ ddlm	Z
 g d¢Z ej        d¦  «        Zdd„Zdd„Zd	„ Zd
„ Zd„ Zd„ Zd„ Zdd„ZdS )z,
API for the command-line I{pyflakes} tool.
é    N)ÚcheckerÚ__version__)Úreporter)ÚcheckÚ	checkPathÚcheckRecursiveÚiterSourceCodeÚmains#   ^#!.*\bpython(3(\.\d+)?|w)?[dmu]?\sc                 ó   — |€t          j        ¦   «         }	 t          j        | |¬¦  «        }nm# t          $ r>}|                     ||j        d         |j        |j        |j	        ¦  «         Y d}~dS d}~wt          $ r |                     |d¦  «         Y dS w xY wt          j        ||¬¦  «        }|j                             d„ ¬¦  «         |j        D ]}|                     |¦  «         Œt#          |j        ¦  «        S )a³  
    Check the Python source given by C{codeString} for flakes.

    @param codeString: The Python source to check.
    @type codeString: C{str}

    @param filename: The name of the file the source came from, used to report
        errors.
    @type filename: C{str}

    @param reporter: A L{Reporter} instance, where errors and warnings will be
        reported.

    @return: The number of warnings emitted.
    @rtype: C{int}
    N)Úfilenamer   é   zproblem decoding sourcec                 ó   — | j         S ©N)Úlineno)Úms    ú@/var/www/piapp/venv/lib/python3.11/site-packages/pyflakes/api.pyú<lambda>zcheck.<locals>.<lambda>0   s   €  !¤(€ ó    )Úkey)ÚmodReporterÚ_makeDefaultReporterÚastÚparseÚSyntaxErrorÚsyntaxErrorÚargsr   ÚoffsetÚtextÚ	ExceptionÚunexpectedErrorr   ÚCheckerÚmessagesÚsortÚflakeÚlen)Ú
codeStringr   r   ÚtreeÚeÚwÚwarnings          r   r   r      s  € ð" ÐÝÔ3Ñ5Ô5ˆðÝŒy˜¨hÐ7Ñ7Ô7ˆˆøÝð ð ð Ø×Ò˜X q¤v¨a¤y°!´(¸A¼HÀaÄfÑMÔMÐMØˆqˆqˆqˆqˆqøøøøÝð ð ð Ø× Ò  Ð+DÑEÔEÐEØˆqˆqðøøøõ 	Œ˜ xÐ0Ñ0Ô0€AØ„J‡O‚OÐ*Ð*€OÑ+Ô+Ð+Ø”:ð  ð  ˆØ�Š�wÑÔÐÐÝˆqŒz‰?Œ?Ðs   —. ®
B¸3A1Á1#BÂBc                 ó<  — |€t          j        ¦   «         }	 t          | d¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   n9# t          $ r,}|                     | |j        d         ¦  «         Y d}~dS d}~ww xY wt          || |¦  «        S )zÒ
    Check the given path, printing out any warnings detected.

    @param reporter: A L{Reporter} instance, where errors and warnings will be
        reported.

    @return: the number of warnings printed
    NÚrbr   )r   r   ÚopenÚreadÚOSErrorr    r   r   )r   r   ÚfÚcodestrr(   s        r   r   r   6   sé   € ð ÐÝÔ3Ñ5Ô5ˆðÝ�(˜DÑ!Ô!ð 	 QØ—f’f‘h”hˆGð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	øøåð ð ð Ø× Ò  ¨1¬6°!¬9Ñ5Ô5Ð5Øˆqˆqˆqˆqˆqøøøøðøøøõ �˜( HÑ-Ô-Ð-s9   —A §A¼A ÁAÁA ÁAÁA Á
B
Á!BÂB
c                 óX  — |                       d¦  «        rdS |                       d¦  «        rdS d}	 t          | d¦  «        5 }|                     |¦  «        }|s	 ddd¦  «         dS 	 ddd¦  «         n# 1 swxY w Y   n# t          $ r Y dS w xY wt                               |¦  «        S )z0Return True if filename points to a Python file.z.pyTú~Fé€   r,   N)Úendswithr-   r.   r/   ÚPYTHON_SHEBANG_REGEXÚmatch)r   Ú	max_bytesr0   r   s       r   ÚisPythonFiler9   J   s*  € à×Ò˜ÑÔð Øˆtð ×Ò˜ÑÔð Øˆuà€IðÝ�(˜DÑ!Ô!ð 	 QØ—6’6˜)Ñ$Ô$ˆDØð Øð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ðð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	øøõ ð ð ð Øˆuˆuðøøøõ  ×%Ò% dÑ+Ô+Ð+s;   ²B ÁA5ÁB Á)B Á5A9Á9B Á<A9Á=B Â
BÂBc              #   ó  K  — | D ]y}t           j                             |¦  «        rTt          j        |¦  «        D ]>\  }}}|D ]5}t           j                             ||¦  «        }t          |¦  «        r|V — Œ6Œ?Œu|V — ŒzdS )zç
    Iterate over all Python source files in C{paths}.

    @param paths: A list of paths.  Directories will be recursed into and
        any .py files found will be yielded.  Any non-directories will be
        yielded as-is.
    N)ÚosÚpathÚisdirÚwalkÚjoinr9   )Úpathsr<   ÚdirpathÚdirnamesÚ	filenamesr   Ú	full_paths          r   r	   r	   `   sª   è è € ð ð ð ˆÝŒ7�=Š=˜ÑÔð 	Ý02´¸±´ð (ð (Ñ,�˜ 9Ø )ð (ð (�HÝ "¤§¢¨W°hÑ ?Ô ?�IÝ# IÑ.Ô.ð (Ø'˜˜˜øð(ð(ð ˆJˆJˆJˆJðð r   c                 óT   — d}t          | ¦  «        D ]}|t          ||¦  «        z  }Œ|S )a;  
    Recursively check all source files in C{paths}.

    @param paths: A list of paths to Python source files and directories
        containing Python source files.
    @param reporter: A L{Reporter} where all of the warnings and errors
        will be reported to.
    @return: The number of warnings found.
    r   )r	   r   )r@   r   ÚwarningsÚ
sourcePaths       r   r   r   s   s;   € ð €HÝ$ UÑ+Ô+ð 4ð 4ˆ
Ø•I˜j¨(Ñ3Ô3Ñ3ˆˆØ€Or   c                 ó°   ‡— ddl }	 t          || ¦  «        }n# t          $ r Y dS w xY wˆfd„}	 |                      ||¦  «         dS # t          $ r Y dS w xY w)z¥Handles a signal with sys.exit.

    Some of these signals (SIGPIPE, for example) don't exist or are invalid on
    Windows. So, ignore errors that might arise.
    r   Nc                 ó0   •— t          j        ‰¦  «         d S r   )ÚsysÚexit)Úsigr0   Úmessages     €r   Úhandlerz_exitOnSignal.<locals>.handler“   s   ø€ ÝŒ�ÑÔÐÐÐr   )ÚsignalÚgetattrÚAttributeErrorÚ
ValueError)ÚsigNamerM   rO   Ú	sigNumberrN   s    `   r   Ú_exitOnSignalrU   ƒ   s¤   ø€ ð €M€M€MðÝ˜F GÑ,Ô,ˆ	ˆ	øÝð ð ð ð 	ˆˆð	øøøðð ð ð ð ðØ�Š�i Ñ)Ô)Ð)Ð)Ð)øÝð ð ð ð 	ˆˆðøøøs   ‡ ˜
&¥&¯A Á
AÁAc                  ód   — t           ›dt          j        ¦   «         ›dt          j        ¦   «         ›�S )zQ
    Retrieve and format package version along with python version & OS used
    z Python z on )r   ÚplatformÚpython_versionÚsystem© r   r   Ú_get_versionr[   ž   s5   € õ
 ˆ[ˆ[�(Ô1Ñ3Ô3Ð3Ð3µX´_Ñ5FÔ5FÐ5FðHð Ir   c                 óô  — ddl }t          dd¦  «         t          dd¦  «         |                     | d¬¦  «        }|                     d	d
dt	          ¦   «         ¬¦  «         |                     ddd¬¦  «         |                     |¬¦  «        j        }t          j        ¦   «         }|rt          ||¦  «        }n-t          t          j                             ¦   «         d|¦  «        }t          |dk    ¦  «        ‚)z&Entry point for the script "pyflakes".r   NÚSIGINTz... stoppedÚSIGPIPEr   z$Check Python source files for errors)ÚprogÚdescriptionz-Vz	--versionÚversion)Úactionra   r<   Ú*z7Path(s) of Python file(s) to check. STDIN if not given.)ÚnargsÚhelp)r   z<stdin>)ÚargparserU   ÚArgumentParserÚadd_argumentr[   Ú
parse_argsr<   r   r   r   r   rJ   Ústdinr.   Ú
SystemExit)r_   r   rf   Úparserr   rF   s         r   r
   r
   ¦   s  € à€O€O€Oõ �(˜MÑ*Ô*Ð*Ý�)˜QÑÔÐà×$Ò$¨$Ø1Wð %ñ Yô Y€Fà
×Ò˜˜k°)Å\Á^Ä^ÐÑTÔTÐTØ
×Ò˜ cØVð ñ Xô Xð Xà×Ò $ÐÑ'Ô'Ô,€DÝÔ/Ñ1Ô1€HØð @Ý! $¨Ñ1Ô1ˆˆå�œŸšÑ)Ô)¨9°hÑ?Ô?ˆÝ
�X ’\Ñ
"Ô
"Ð"r   r   )NN)Ú__doc__r   r;   rW   ÚrerJ   Úpyflakesr   r   r   r   Ú__all__Úcompiler6   r   r   r9   r	   r   rU   r[   r
   rZ   r   r   ú<module>rr      s  ððð ð €
€
€
Ø 	€	€	€	Ø €€€Ø 	€	€	€	Ø 
€
€
€
à )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,à
LÐ
LÐ
L€à!�r”zÐ"IÑJÔJÐ ð!ð !ð !ð !ðH.ð .ð .ð .ð(,ð ,ð ,ð,ð ð ð&ð ð ð ð ð ð6Ið Ið Ið#ð #ð #ð #ð #ð #r   