ó
    áÅŸg-  ã                  ó  • S r SSKJr  SSKrSSKrSSKrSSKrSSKJr  SSKJ	r	  SSKJ
r
  SSKJr  SSKJr  \R                  " \5      r\R$                  " S	S
5      rSSS.         SS jjr " S S5      r " S S5      rg)z,Option handling and Option management logic.é    )ÚannotationsN)ÚAny)ÚCallable)ÚSequence)Úutils)ÚPluginsÚ_ARGÚNOF©Úcomma_separated_listÚnormalize_pathsc               ó  • U nU(       a+  [        U[        5      (       a  [        R                  " U 5      nU(       aE  [        U[        5      (       a  [        R                  " U/UQ76 nU$ [        R
                  " U/UQ76 nU$ ©N)Ú
isinstanceÚstrr   Úparse_comma_separated_listÚnormalize_pathr   )Úvaluer   r   ÚargsÚrets        ÚW/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/flake8/options/manager.pyÚ_flake8_normalizer      sp   € ð !€CÞ¤
¨3´× 4Ñ 4Ü×.Ò.¨uÓ5ˆæÜ�cœ3×ÑÜ×&Ò& sÐ2¨TÒ2ˆCð €Jô ×'Ò'¨Ð3¨dÒ3ˆCà€Jó    c                  ó¤  • \ rS rSrSr\R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  SSS4                               SS jjr\SS j5       r	SS jr
SS jrSS jrS	rg
)ÚOptioné)   z@Our wrapper around an argparse argument parsers to add features.Fc                óŒ  • U[         R                  L a:  U[         R                  La'  UR                  S5      (       a  [         R                  Up!U(       d  U(       a  [        R                  " [
        UUS9nXl        X l        X4 Vs/ sH  nU[         R                  Ld  M  UPM     snU l        X0l	        X@l
        XPl        X`l        Xpl        X€l        X�l        X l        X°l        XÀl        U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                   U R"                  U R$                  S.
U l        XÐl        Xàl        Xðl        SU l        U(       a8  U[         R                  L a  [1        S5      eUSS R3                  SS5      U l        SU l        gs  snf )	az  Initialize an Option instance.

The following are all passed directly through to argparse.

:param short_option_name:
    The short name of the option (e.g., ``-x``). This will be the
    first argument passed to ``ArgumentParser.add_argument``
:param long_option_name:
    The long name of the option (e.g., ``--xtra-long-option``). This
    will be the second argument passed to
    ``ArgumentParser.add_argument``
:param default:
    Default value of the option.
:param dest:
    Attribute name to store parsed option value as.
:param nargs:
    Number of arguments to parse for this option.
:param const:
    Constant value to store on a common destination. Usually used in
    conjunction with ``action="store_const"``.
:param choices:
    Possible values for the option.
:param help:
    Help text displayed in the usage information.
:param metavar:
    Name to use instead of the long option name for help text.
:param required:
    Whether this option is required or not.

The following options may be passed directly through to :mod:`argparse`
but may need some massaging.

:param type:
    A callable to normalize the type (as is the case in
    :mod:`argparse`).
:param action:
    Any action allowed by :mod:`argparse`.

The following parameters are for Flake8's option handling alone.

:param parse_from_config:
    Whether or not this option should be parsed out of config files.
:param comma_separated_list:
    Whether the option is a comma separated list when parsing from a
    config file.
:param normalize_paths:
    Whether the option is expecting a path or list of paths and should
    attempt to normalize the paths to absolute paths.
z--r   )
ÚactionÚdefaultÚtypeÚdestÚnargsÚconstÚchoicesÚhelpÚmetavarÚrequiredNzRWhen specifying parse_from_config=True, a long_option_name must also be specified.é   Ú-Ú_)r	   r
   Ú
startswithÚ	functoolsÚpartialr   Úshort_option_nameÚlong_option_nameÚoption_argsr   r   r    r!   r"   r#   r$   r%   r&   r'   Úoption_kwargsÚparse_from_configr   r   Úconfig_nameÚ
ValueErrorÚreplaceÚ_opt)Úselfr.   r/   r   r   r    r!   r"   r#   r$   r%   r&   r'   r2   r   r   Úxs                    r   Ú__init__ÚOption.__init__,   s‡  € ðL ¤§¡Ò'Ø!¬¯©Ò0Ø!×,Ñ,¨T×2Ñ2ä26·'±'Ð;LÐ/ö  ¦?Ü×$Ò$Ü!Ø%9Ø /ñˆDð "3ÔØ 0Ôð (Ñ:ó
á:�ØœŸ™Ð÷ Ù:ñ
ˆÔð
 ŒØŒØŒ	ØŒ	ØŒ
ØŒ
ØŒØŒ	ØŒØ Œà—k‘kØ—|‘|Ø—I‘IØ—I‘IØ—Z‘ZØ—Z‘ZØ—|‘|Ø—I‘IØ—|‘|ØŸ™ñ5
ˆÔð "3ÔØ$8Ô!Ø.Ôà'+ˆÔÞØ¤4§7¡7Ò*Ü ðAóð ð  0°°Ð3×;Ñ;¸CÀÓEˆDÔàˆ�	ùòU
s   ÂGÂ!Gc                ó”   • U R                   R                  5        VVs0 sH  u  pU[        R                  Ld  M  X_M     snn$ s  snnf )z(Return any actually-specified arguments.)r1   Úitemsr	   r
   )r7   ÚkÚvs      r   Úfiltered_option_kwargsÚOption.filtered_option_kwargs®   sF   € ð "×/Ñ/×5Ñ5Ô7ô
Ù7‘T�Q¸1ÄDÇGÁGÐ;K‹DˆAŠDÑ7ò
ð 	
ùó 
s
   žAºAc                óì   • / nU R                    H  nUR                  U5        M     U R                  R                  5        H  u  p4UR                  U SU< 35        M     SSR	                  U5       S3$ )NÚ=zOption(z, Ú))r0   Úappendr?   r<   Újoin)r7   ÚpartsÚargr=   r>   s        r   Ú__repr__ÚOption.__repr__µ   sm   € ØˆØ×#Ô#ˆCØ�L‰L˜Öñ $à×/Ñ/×5Ñ5Ö7‰DˆAØ�L‰L˜A˜3˜a ™u˜Ö&ñ 8à˜Ÿ™ 5Ó)Ð*¨!Ð,Ð,r   c                ó*  • U R                   (       a+  [        U[        5      (       a  [        R                  " U5      nU R
                  (       aE  [        U[        5      (       a  [        R
                  " U/UQ76 nU$ [        R                  " U/UQ76 nU$ )z6Normalize the value based on the option configuration.)r   r   r   r   r   r   Úlistr   )r7   r   Únormalize_argss      r   Ú	normalizeÚOption.normalize½   su   € à×$×$¬°E¼3×)?Ñ)?Ü×4Ò4°UÓ;ˆEà××Ü˜%¤×&Ñ&Ü×-Ò-¨eÐE°nÒE�ð ˆô ×,Ò,¨UÐD°^ÒD�àˆr   c                ó2   • U R                   U R                  4$ )z?Convert a Flake8 Option to argparse ``add_argument`` arguments.)r0   r?   )r7   s    r   Úto_argparseÚOption.to_argparseÊ   s   € à×Ñ ×!<Ñ!<Ð<Ð<r   )r6   r   r$   r   r3   r#   r   r!   r%   r/   r&   r"   r   r0   r1   r2   r'   r.   r    N) r.   ú
str | _ARGr/   rR   r   z"str | type[argparse.Action] | _ARGr   ú
Any | _ARGr    zCallable[..., Any] | _ARGr!   rR   r"   zint | str | _ARGr#   rS   r$   zSequence[Any] | _ARGr%   rR   r&   rR   r'   zbool | _ARGr2   Úboolr   rT   r   rT   ÚreturnÚNone)rU   zdict[str, Any])rU   r   )r   r   rL   r   rU   r   )rU   z tuple[list[str], dict[str, Any]])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   r
   r9   Úpropertyr?   rH   rM   rP   Ú__static_attributes__© r   r   r   r   )   s<  † ÙJð )-¯©Ø'+§w¡wà59·W±WØ"Ÿg™gØ*.¯'©'ØŸ7™7Ø"&§'¡'Ø ŸG™GØ(,¯©ØŸ7™7Ø"Ÿg™gØ $§¡à"'Ø%*Ø %ð%@à%ð@ð %ð@ð
 3ð@ð ð@ð (ð@ð ð@ð  ð@ð ð@ð &ð@ð ð@ð ð@ð ð@ð   ð!@ð" #ð#@ð$ ð%@ð& 
õ'@ðD ó
ó ð
ô-ô÷=r   r   c                  óz   • \ rS rSrSr          SS jrSS jrSS jrSS jrSS jr	  S     SS	 jjr
S
rg)ÚOptionManageréÏ   z=Manage Options and OptionParser while adding post-processing.c          
     ó6  • X@l         [        R                  " SSUSU 3S9U l        U R                  R	                  SSU SU S[
        R                  " 5        3S	9  U R                  R	                  S
SSS9  0 U l        / U l        / U l	        / U l
        SU l        g)z+Initialize an instance of an OptionManager.Úflake8z %(prog)s [options] file file ...zInstalled plugins: )ÚprogÚusageÚparentsÚepilogz	--versionÚversionz (z) )r   rh   Ú	filenamesÚ*Úfilename)r"   r&   N)Úformatter_namesÚargparseÚArgumentParserÚparserÚadd_argumentr   Úget_python_versionÚconfig_options_dictÚoptionsÚextended_default_ignoreÚextended_default_selectÚ_current_group)r7   rh   Úplugin_versionsrf   rl   s        r   r9   ÚOptionManager.__init__Ò   s³   € ð  /ÔÜ×-Ò-ØØ4ØØ(¨Ð(9Ð:ñ	
ˆŒð 	�‰× Ñ ØØà�)˜2˜oÐ.¨bÜ×+Ò+Ó-Ð.ð0ð	 	!ñ 	
ð 	�‰× Ñ  °CÀÐ ÑLà68ˆÔ Ø%'ˆŒØ24ˆÔ$Ø24ˆÔ$à>BˆÕr   c                ób  ^ ^• 0 mSUU 4S jjnUR                  5        H‡  n[        UR                  SS5      nU(       a$  U" UR                  R                  5        U" T 5        UR                  R
                  R                  S:X  d  Mk  T R                  UR                  /5        M‰     ST l	        g)z(Register the plugin options (if needed).c                óŠ   >•  TU    Tl         g ! [         a*    TR                  R                  U 5      nU=Tl         TU '    g f = fr   )rv   ÚKeyErrorro   Úadd_argument_group)ÚnameÚgroupÚgroupsr7   s     €€r   Ú
_set_groupÚ2OptionManager.register_plugins.<locals>._set_groupø   sH   ø€ ð;Ø&,¨T¡l�Õ#øÜó ;ØŸ™×6Ñ6°tÓ<�Ø5:Ð:�Ô# f¨T£lð;ús   ƒ
 Ž1AÁAÚadd_optionsNzflake8.extension)r}   r   rU   rV   )
Úall_pluginsÚgetattrÚobjÚpluginÚpackageÚentry_pointr~   Úextend_default_selectÚ
entry_namerv   )r7   Úpluginsr€   Úloadedr‚   r   s   `    @r   Úregister_pluginsÚOptionManager.register_pluginsô   s�   ù€ à57ˆ÷	;ð 	;ð ×)Ñ)Ö+ˆFÜ! &§*¡*¨m¸TÓBˆKÞÙ˜6Ÿ=™=×0Ñ0Ô1Ù˜DÔ!à�}‰}×(Ñ(×.Ñ.Ð2DÕDØ×*Ñ*¨F×,=Ñ,=Ð+>Ö?ñ ,ð #ˆÕr   c                óÈ  • [        U0 UD6nUR                  5       u  pEU R                  b  U R                  R                  " U0 UD6  OU R                  R                  " U0 UD6  U R
                  R                  U5        UR                  (       a=  UR                  nUc   eX0R                  U'   X0R                  UR                  SS5      '   [        R                  SU5        g)a  Create and register a new option.

See parameters for :class:`~flake8.options.manager.Option` for
acceptable arguments to this method.

.. note::

    ``short_option_name`` and ``long_option_name`` may be specified
    positionally as they are with argparse normally.
Nr*   r)   zRegistered option "%s".)r   rP   rv   rp   ro   rs   rD   r2   r3   rr   r5   ÚLOGÚdebug)r7   r   ÚkwargsÚoptionr0   r1   r}   s          r   Ú
add_optionÚOptionManager.add_option  sÈ   € ô ˜Ð( Ñ(ˆØ%+×%7Ñ%7Ó%9Ñ"ˆØ×ÑÑ*Ø×Ñ×,Ò,¨kÐK¸]ÓKà�K‰K×$Ò$ kÐC°]ÒCØ�‰×Ñ˜FÔ#Ø×#×#Ø×%Ñ%ˆDØÑ#Ð#Ð#Ø-3×$Ñ$ TÑ*Ø?E×$Ñ$ T§\¡\°#°sÓ%;Ñ<Ü�	‰	Ð+¨VÕ4r   c                óf   • [         R                  SU5        U R                  R                  U5        g)zºExtend the default ignore list with the error codes provided.

:param error_codes:
    List of strings that are the error/warning codes with which to
    extend the default ignore list.
z%Extending default ignore list with %rN)r�   r‘   rt   Úextend©r7   Úerror_codess     r   Úextend_default_ignoreÚ#OptionManager.extend_default_ignore$  ó'   € ô 	�	‰	Ð9¸;ÔGØ×$Ñ$×+Ñ+¨KÕ8r   c                óf   • [         R                  SU5        U R                  R                  U5        g)zºExtend the default select list with the error codes provided.

:param error_codes:
    List of strings that are the error/warning codes with which
    to extend the default select list.
z%Extending default select list with %rN)r�   r‘   ru   r—   r˜   s     r   r‰   Ú#OptionManager.extend_default_select.  rœ   r   Nc                ó�   • U(       a%  U R                   R                  " S0 [        U5      D6  U R                   R                  U5      $ )z6Proxy to calling the OptionParser's parse_args method.r^   )ro   Úset_defaultsÚvarsÚ
parse_args)r7   r   Úvaluess      r   r¢   ÚOptionManager.parse_args8  s5   € ö Ø�K‰K×$Ò$Ñ4¤t¨F£|Ò4Ø�{‰{×%Ñ% dÓ+Ð+r   )rv   rr   rt   ru   rl   rs   ro   )
rh   r   rw   r   rf   zlist[argparse.ArgumentParser]rl   z	list[str]rU   rV   )r‹   r   rU   rV   )r   r   r’   r   rU   rV   )r™   zSequence[str]rU   rV   )NN)r   zSequence[str] | Noner£   zargparse.Namespace | NonerU   zargparse.Namespace)rW   rX   rY   rZ   r[   r9   r�   r”   rš   r‰   r¢   r]   r^   r   r   r`   r`   Ï   s…   † ÙGðCð ðCð ð	Cð
 /ðCð #ðCð 
ôCôD#ô.5ô29ô9ð &*Ø,0ð,à"ð,ð *ð,ð 
÷	,ð ,r   r`   )
r   r   r   r   r   rT   r   rT   rU   zstr | list[str])r[   Ú
__future__r   rm   Úenumr,   ÚloggingÚtypingr   r   r   rc   r   Úflake8.plugins.finderr   Ú	getLoggerrW   r�   ÚEnumr	   r   r   r`   r^   r   r   Ú<module>r¬      sœ   ðÙ 2Ý "ã Û Û Û Ý Ý Ý å Ý )à×Ò˜Ó!€ð ‡y‚y�˜Ó€ð "'Ø!ñ	Øðàðð ðð ð	ð
 õ÷&c=ñ c=÷Lq,ò q,r   