ó
    ÞÅŸg®  ã                   ó´   • S r SSKrSSKrSSKrSSKrSSKrSSKJrJr  SSKJ	r
  / SQr\R                  " S5      rSS jrSS jrS	 rS
 rS rS rS rSS jrg)z,
API for the command-line I{pyflakes} tool.
é    N)ÚcheckerÚ__version__)Úreporter)ÚcheckÚ	checkPathÚcheckRecursiveÚiterSourceCodeÚmains#   ^#!.*\bpython(3(\.\d+)?|w)?[dmu]?\sc                 ó  • Uc  [         R                  " 5       n [        R                  " XS9n[        R                  " X1S9nUR                  R                  S S9  UR                   H  nUR!                  U5        M     [#        UR                  5      $ ! [         aI  nUR                  XR                  S   UR                  UR                  UR                  5         SnAgSnAf[         a    UR                  US5         gf = f)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                 ó   • U R                   $ ©N)Úlineno)Úms    ÚM/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/pyflakes/api.pyÚ<lambda>Ú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Ò3Ó5ˆðÜ�yŠy˜Ñ7ˆô 	�Š˜Ñ0€AØ‡J�J‡O�OÑ*€OÑ+Ø—:”:ˆØ�‰�wÖñ äˆq�z‰z‹?Ðøô ó Ø×Ñ˜X§v¡v¨a¡y°!·(±(¸A¿H¹HÀaÇfÁfÔMÜûÜó Ø× Ñ  Ð+DÔEÙðús   šB Â
DÂ?C#Ã#DÄDc                 ó"  • Uc  [         R                  " 5       n [        U S5       nUR                  5       nSSS5        [        WX5      $ ! , (       d  f       N= f! [         a(  nUR                  XR                  S   5         SnAgSnAff = f)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   sy   € ð ÑÜ×3Ò3Ó5ˆðÜ�(˜DÔ! QØ—f‘f“hˆG÷ "ô
 �˜(Ó-Ð-÷ "Õ!ûäó Ø× Ñ  ¯6©6°!©9Ô5Üûðús3   šA ¦A·A Á
AÁA ÁA Á
BÁ&B	Â	Bc                 ó@  • U R                  S5      (       a  gU R                  S5      (       a  gSn [        U S5       nUR                  U5      nU(       d
   SSS5        g SSS5        [        R                  W5      $ ! , (       d  f       N#= f! [         a     gf = f)z0Return True if filename points to a Python file.z.pyTÚ~Fé€   r-   N)Úendswithr.   r/   r0   ÚPYTHON_SHEBANG_REGEXÚmatch)r   Ú	max_bytesr1   r   s       r   ÚisPythonFiler:   J   s•   € à×Ñ˜×ÑØð ×Ñ˜×ÑØà€IðÜ�(˜DÔ! QØ—6‘6˜)Ó$ˆDÞØ÷ "Ð!à÷ "ô  ×%Ñ% dÓ+Ð+÷ "Õ!ûô ó Ùðús4   ²B ¾A?ÁB Á"B Á?
BÂ	B ÂB Â
BÂBc              #   ó.  #   • U  H‹  n[         R                  R                  U5      (       a`  [         R                  " U5       HD  u  p#nU H8  n[         R                  R	                  X%5      n[        U5      (       d  M4  Uv •  M:     MF     M‡  Uv •  M�     g7f)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Újoinr:   )Úpathsr=   ÚdirpathÚdirnamesÚ	filenamesr   Ú	full_paths          r   r	   r	   `   sn   é € ó ˆÜ�7‰7�=‰=˜×ÑÜ02·²¸¶Ñ,� 9Û )�HÜ "§¡§¡¨WÓ ?�IÜ# I×.Ó.Ø'œó !*ó 1>ð ŒJò ùs   ‚A8BÁ>Bc                 óJ   • Sn[        U 5       H  nU[        X15      -  nM     U$ )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   )rA   r   ÚwarningsÚ
sourcePaths       r   r   r   s   s,   € ð €HÜ$ UÖ+ˆ
Ø”I˜jÓ3Ñ3Šñ ,à€Or   c                 ó–   ^• SSK n [        X 5      nU4S jn UR                  X45        g! [         a     gf = f! [         a     gf = f)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                 ó2   >• [         R                  " T5        g r   )ÚsysÚexit)Úsigr1   Úmessages     €r   ÚhandlerÚ_exitOnSignal.<locals>.handler“   s   ø€ Ü�Š�Õr   )ÚsignalÚgetattrÚAttributeErrorÚ
ValueError)ÚsigNamerN   rQ   Ú	sigNumberrO   s    `   r   Ú_exitOnSignalrW   ƒ   sX   ø€ ó ðÜ˜FÓ,ˆ	õðØ�‰�iÕ)øô ó ñ 	ð	ûô ó ñ 	ðús   ‡+ ™; «
8·8»
AÁAc                  óp   • [         < S[        R                  " 5       < S[        R                  " 5       < 3$ )zI
Retrieve and format package version along with python version & OS used
z Python z on )r   ÚplatformÚpython_versionÚsystem© r   r   Ú_get_versionr]   ž   s'   € ÷
 œ(×1Ò1Ö3´X·_²_Õ5FðHð Ir   c                 ó   • SSK n[        SS5        [        SS5        UR                  U SS9nUR                  S	S
S[	        5       S9  UR                  SSSS9  UR                  US9R                  n[        R                  " 5       nU(       a  [        X5      nO)[        [        R                  R                  5       SU5      n[        US:„  5      e)z&Entry point for the script "pyflakes".r   NÚSIGINTz... stoppedÚSIGPIPEr   z$Check Python source files for errors)ÚprogÚdescriptionz-Vz	--versionÚversion)Úactionrc   r=   Ú*z7Path(s) of Python file(s) to check. STDIN if not given.)ÚnargsÚhelp)r   z<stdin>)ÚargparserW   ÚArgumentParserÚadd_argumentr]   Ú
parse_argsr=   r   r   r   r   rK   Ústdinr/   Ú
SystemExit)ra   r   rh   Úparserr   rG   s         r   r
   r
   ¦   sÆ   € ãô �(˜MÔ*Ü�)˜QÔà×$Ñ$¨$Ø1Wð %ð Y€Fà
×Ñ˜˜k°)Ä\Ã^ÐÑTØ
×Ñ˜ cØVð ñ Xà×Ñ $ÐÐ'×,Ñ,€DÜ×/Ò/Ó1€HÞÜ! $Ó1‰äœŸ™Ÿ™Ó)¨9°hÓ?ˆÜ
�X ‘\Ó
"Ð"r   r   )NN)Ú__doc__r   r<   rY   ÚrerK   Úpyflakesr   r   r   r   Ú__all__Úcompiler7   r   r   r:   r	   r   rW   r]   r
   r\   r   r   Ú<module>rt      s`   ðñó Û 	Û Û 	Û 
ç )Ý ,â
L€à—z’zÐ"IÓJÐ ô!ôH.ò(,ò,ò&ò ò6Iõ#r   