OwlCyberSecurity - MANAGER
Edit File: manager.cpython-311.pyc
� ������h>����������������������������U�d�Z�ddlZddlZddlZddlZddlmZ�ddlmZ�ddlmZ�ddlm Z �ddlm Z �ddlmZ�dd lmZ�dd lm Z �ddlmZ�ddlmZ�dd lmZ�ddlmZ��ej��������e������������Z�ej��������dd������������Zeeeeeej��������ed�Zeeeee���������ef���������f���������ed<����G�d��dej ��������������������Z!ddd�dedede"de"deee e���������f���������f d�Z#�G�d��d������������Z$�G�d��d ������������Z%dS�)!z,Option handling and Option management logic.�����N)�Any)�Callable)�Dict)�List)�Mapping)�Optional)�Sequence)�Tuple)�Type)�Union)�utils)�Plugins�_ARG�NO)�int�long�string�float�complex�choice�str�_optparse_callable_mapc������������ ����������������e�Zd�ZdZddd�dededef���������dee���������d eee ef������������������d eddf��fd�Z �dd ej��������dej ��������deeee ���������e f������������������dee ���������ddf d�Z��xZS�)�_CallbackActionz)Shim for optparse-style callback actions.��N)� callback_args�callback_kwargs�args�callback.r���r����kwargs�returnc�����������������h������||�_���������||�_��������|pi�|�_���������t������������������������j��������|i�|���d�S��N)� _callback�_callback_args�_callback_kwargs�super�__init__)�selfr���r���r���r���r ���� __class__s��� ��g/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/flake8/options/manager.pyr(���z_CallbackAction.__init__*���sC��������"���+��� /� 5�2��������$�)�&�)�)�)�)�)������parser� namespace�values� option_stringc�����������������������|sd�}n7t����������|t����������������������r"t����������|������������dk����rt����������|������������}�|�j��������|�|||g|�j���������R�i�|�j�����������d�S�)N����)� isinstance�list�len�tupler$���r%���r&���)r)���r-���r.���r/���r0���s��� r+����__call__z_CallbackAction.__call__7���s���������� #��F�F� ��� %� %�� #�#�f�+�+��/�/��6�]�]�F�������� � �� � �� �� ���#� �� �� �� �� r,���r#���)�__name__� __module__�__qualname__�__doc__r���r���r ���r���r���r���r(����argparse�ArgumentParser� Namespacer���r7���� __classcell__)r*���s���@r+���r���r���'���s��������������3�3��(*�48�*��*��*��*���3��8�$�*�� ��}� *� �"�$�s�C�x�.�1�*��� *�� �*��*��*��*��*��*�$�(,� �� ��'� ���%� ����x��}�c�1�2�3� � � ��}� �� � �� �� �� �� �� �� �� r,���r���F��comma_separated_list�normalize_paths�valuer���rA���rB���r!���c�����������������������|�}|r)t����������|t����������������������rt����������j��������|�������������}|r:t����������|t����������������������rt����������j��������|g|�R���}nt����������j��������|g|�R���}|S�r#���)r3���r���r ����parse_comma_separated_list�normalize_pathrB���)rC���rA���rB���r����rets��� r+����_flake8_normalizerH���L���s��������"'�C���6� �3�� 4� 4��6��.�u�5�5����4��c�3���� 4��&�s�2�T�2�2�2�C�C��'��3�d�3�3�3�C��Jr,���c������������'������������e�Zd�ZdZej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������ej��������dddfdeeef���������deeef���������deeee j �����������������ef���������deeef���������deeedef���������ef���������d eeef���������d ee eef���������deeef���������deee���������ef���������d eeef���������deeef���������deedef���������ef���������deee���������ef���������deeeef���������ef���������deeef���������dedededdf&d�Zedeeef���������fd���������������Zdefd�Zdededefd�Zdeee���������eeef���������f���������fd�ZdS�)�Optionz@Our wrapper around an argparse argument parsers to add features.F�short_option_name�long_option_name�action�default�type.�dest�nargs�const�choices�help�metavarr���r���r����required�parse_from_configrA���rB���r!���Nc����������������������|t�����������j��������u�r1|t�����������j��������ur#|���������������������d������������rt�����������j��������|}}| t�����������j��������ur5d| v�r1t�������������������������������d|�������������| ���������������������dd������������} |dk����r2t�������������������������������d|�������������t����������}|t�����������j��������u�rd}t����������|t����������������������r(t�������������������������������d|�������������t����������|���������}|s|rt����������j��������t����������||� ������������}||�_ ��������||�_��������d ��||fD���������������|�_��������||�_��������||�_��������||�_��������||�_��������||�_��������||�_��������| |�_��������||�_��������| |�_��������||�_��������| |�_��������||�_��������||�_��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������|�j��������d� |�_��������||�_��������||�_��������||�_ ��������d|�_!��������|r@|t�����������j��������u�rtE����������d �������������|dd�������������������������������dd������������|�_!��������d|�_#��������dS�)a� ��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`). Deprecated: you can also pass through type strings such as ``'int'`` which are handled by :mod:`optparse`. :param action: Any action allowed by :mod:`argparse`. Deprecated: this also understands the ``action='callback'`` action from :mod:`optparse`. :param callback: Callback used if the action is ``"callback"``. Deprecated: please use ``action=`` instead. :param callback_args: Additional positional arguments to the callback callable. Deprecated: please use ``action=`` instead (probably with ``functools.partial``). :param callback_kwargs: Keyword arguments to the callback callable. Deprecated: please use ``action=`` instead (probably with ``functools.partial``). 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--z%defaultzuoption %s: please update `help=` text to use %%(default)s instead of %%default -- this will be an error in the futurez%(default)sr���z|option %s: please update from optparse `action='callback'` to argparse action classes -- this will be an error in the futurer���zyoption %s: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the futurer@���c������������������.�����g�|�]}|t�����������j��������u�|��S�r����r���r���)�.0�xs��� r+���� <listcomp>z#Option.__init__.<locals>.<listcomp>����s/������� �� �� �������� ���r,���) rM���rN���rO���rP���rQ���rR���rS���r���r���r���rT���rU���rV���NzRWhen specifying parse_from_config=True, a long_option_name must also be specified.�����-�_)$r���r���� startswith�LOG�warning�replacer���r3���r���r���� functools�partialrH���rK���rL����option_argsrM���rN���rO���rP���rQ���rR���rS���r���r���r���rT���rU���rV���� option_kwargsrW���rA���rB����config_name� ValueError�_opt)r)���rK���rL���rM���rN���rO���rP���rQ���rR���rS���rT���rU���r���r���r���rV���rW���rA���rB���s��� r+���r(���zOption.__init__b���s������n� ���'�'�!���0�0�!�,�,�T�2�2��1��37�'�;L�/����t�w���:��#5�#5��K�K�N� � �� �� � ��<�<� �M�:�:�D���Z����K�K���!� �� �� ��%�F��t�w�������d�C� � �� 0��K�K���!� �� �� ��*�$�/�D�� �� �?�� ��$�!�%9� /������D��"3��� 0��� �� �'�)9�:� �� �� ��� ��������� ��� ��� ��� ���� �� �*���.����� ���� �� ��k��|��I��I��Z��Z��|�� �!�/�#�3��I��|�� �; ��; ���"�"3���$8��!�.���*.����� F��4�7�*�*� �A������� 0����3�;�;�C��E�E�D���� � � r,���c������������������H�����d��|�j��������������������������������������������D���������������S�)z(Return any actually-specified arguments.c������������������6�����i�|�]\��}}|t�����������j��������u�||��S�r���rZ���)r[����k�vs��� r+���� <dictcomp>z1Option.filtered_option_kwargs.<locals>.<dictcomp>��s1������� �� �� ��Q��1�D�G�;K�;K�A�q�;K�;K�;Kr,���)rh����items�r)���s��� r+����filtered_option_kwargszOption.filtered_option_kwargs��s2������ �� �!�/�5�5�7�7� �� �� �� r,���c������������������������g�}|�j���������D�]}|���������������������|��������������|�j�������������������������������������������D�]\��}}|���������������������|��d|���������������� dd���������������������|��������������d�S�)N�=zOption(z, �))rg����appendrs���rq����join)r)����parts�argrn���ro���s��� r+����__repr__zOption.__repr__!��s����������#�� �� �C��L�L�������/�5�5�7�7�� '�� '�D�A�q��L�L�A������&�&�&�&�,����5�)�)�,�,�,�,r,���rC����normalize_argsc������������������������|�j���������r)t����������|t����������������������rt����������j��������|������������}|�j��������r:t����������|t����������������������rt����������j��������|g|�R���}nt����������j��������|g|�R���}|S�)z6Normalize the value based on the option configuration.)rA���r3���r���r ���rE���rB���r4���rF���)r)���rC���r|���s��� r+���� normalizezOption.normalize)��s��������$�� <��E�3�)?�)?�� <��4�U�;�;�E���� E��%��&�&�� E��-�e�E�n�E�E�E����,�U�D�^�D�D�D���r,���c�����������������������|�j���������|�j��������fS�)z?Convert a Flake8 Option to argparse ``add_argument`` arguments.)rg���rs���rr���s��� r+����to_argparsezOption.to_argparse6��s���������!<�<�<r,���)r8���r9���r:���r;���r���r���r���r���r���r<����Actionr���r���r���r ���r����boolr(����propertyr���rs���r{���r~���r ���r���r����r���r,���r+���rJ���rJ���_���s��������������J�J��/3�g�-1�W�:>�'�$(�G�59�W�!%��'+�w�"&�'�.2�g�!%��$(�G�48�G�48�G�:>�'�&*�g�"'�%*� %�/v��v� ��d��+�v�� ��T� �*�v� ��c�4���0�$�6�7�v���s�D�y�!� v���C��#�s�(�+�T�1�2�v���C��I��v���S�#�t�^�$�v���S�$�Y��v���x��}�d�*�+�v���C��I��v���s�D�y�!�v�����c��*�D�0�1�v� ��X�c�]�D�0�1�!v�"��w�s�C�x�0�$�6�7�#v�&���d� �#�'v�*� �+v�,�#�-v�.��/v�0� �1v��v��v��v�p�� ��S�#�X��� �� �� ���X� �-�#��-��-��-��-��s���S���S���������=�U�4��9�d�3��8�n�#<�=��=��=��=��=��=��=r,���rJ���c��������������������������e�Zd�ZdZdededeej�����������������ddfd�Zde ddfd �Z d ededdfd�Zd e e���������ddfd�Zd e e���������ddfd�Z � �dd ee e������������������deej�����������������dej��������fd�ZdS�)� OptionManagerz=Manage Options and OptionParser while adding post-processing.�version�plugin_versions�parentsr!���Nc���������� �������2����t����������j��������dd|d|����������������|�_��������|�j�����������������������������dd|��d|��dt ����������j�������������������������� �������������|�j�����������������������������d dd� �������������i�|�_��������g�|�_��������g�|�_��������g�|�_ ��������d|�_ ��������dS�)a���Initialize an instance of an OptionManager. :param prog: Name of the actual program (e.g., flake8). :param version: Version string for the program. :param usage: Basic usage string used by the OptionParser. :param parents: A list of ArgumentParser objects whose arguments should also be included. �flake8z %(prog)s [options] file file ...zInstalled plugins: )�prog�usager�����epilogz --versionr����z (z) )rM���r����� filenames�*�filename)rQ���rU���N)r<���r=���r-����add_argumentr ����get_python_version�config_options_dict�options�extended_default_ignore�extended_default_select�_current_group)r)���r����r����r����s��� r+���r(���zOptionManager.__init__>��s�������&��-��4��:��:�:� �� �� ���� �� � �����0��0�o��0��0��+�-�-�0��0� � !�� �� �� �� �� � ��C�� �L�L�L�68�� �%'���24��$�24��$�AE����r,����pluginsc������������������:�������i��dt�����������ddf���fd�}|�����������������������������������D�]j}t����������|j��������dd������������}|r �||j��������j����������������������|���������������|j��������j��������j��������dk����r�����������������������|j ��������g��������������kd��_ ��������dS�)z(Register the plugin options (if needed).�namer!���Nc������������������������ ��|�����������_���������d�S�#�t����������$�r*��j�����������������������������|�������������}|x�_����������|�<���Y�d�S�w�xY�wr#���)r�����KeyErrorr-����add_argument_group)r�����group�groupsr)���s��� ��r+���� _set_groupz2OptionManager.register_plugins.<locals>._set_groupm��sa������� ;�&,�T�l��#�#�#���� ;�� ;�� ;���6�6�t�<�<��5:�:��#�f�T�l�l�l�l� ;���s���� ��0A�A�add_optionszflake8.extension)r����all_plugins�getattr�obj�plugin�package�entry_pointr�����extend_default_select� entry_namer����)r)���r����r�����loadedr����r����s���` @r+����register_pluginszOptionManager.register_pluginsi��s���������57�� ;�S�� ;�T�� ;�� ;�� ;�� ;�� ;�� ;�� ;���)�)�+�+�� @�� @�F�!�&�*�m�T�B�B�K��� "�� �6�=�0�1�1�1���D�!�!�!��}�(�.�2D�D�D��*�*�F�,=�+>�?�?�?���#����r,���r���r ���c����������������������t����������|i�|��}|�����������������������������������\��}}|�j����������|�j��������j��������|i�|���n�|�j��������j��������|i�|���|�j�����������������������������|�������������|j��������r3|j��������}|�J��||�j ��������|<���||�j ��������|� ��������������������dd������������<���t�������������������������������d|�������������dS�)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_���zRegistered option "%s".) rJ���r����r����r����r-���r����rw���rW���ri���r����rd���rb����debug)r)���r���r ����optionrg���rh���r����s��� r+���� add_optionzOptionManager.add_option���s����������(��(�(��%+�%7�%7�%9�%9�"��]���*�,�D��,�k�K�]�K�K�K�K�$�D�K�$�k�C�]�C�C�C�����F�#�#�#��#�� F��%�D��#�#�#�-3�D�$�T�*�?E�D�$�T�\�\�#�s�%;�%;�<�� � �+�V�4�4�4�4�4r,����error_codesc������������������p�����t��������������������������������d|�������������|�j�����������������������������|�������������dS�)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)rb���r����r�����extend�r)���r����s��� r+����extend_default_ignorez#OptionManager.extend_default_ignore����6������� � � �9�;�G�G�G��$�+�+�K�8�8�8�8�8r,���c������������������p�����t��������������������������������d|�������������|�j�����������������������������|�������������dS�)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)rb���r����r����r����r����s��� r+���r����z#OptionManager.extend_default_select���r����r,���r/���c������������������x�����|r�|�j���������j��������di�t����������|���������������|�j������������������������������|������������S�)z6Proxy to calling the OptionParser's parse_args method.r���)r-����set_defaults�vars� parse_args)r)���r���r/���s��� r+���r����zOptionManager.parse_args���sC��������� 5�$�D�K�$�4�4�t�F�|�|�4�4�4��{�%�%�d�+�+�+r,���)NN)r8���r9���r:���r;���r���r���r<���r=���r(���r���r����r���r����r ���r����r����r���r>���r����r���r,���r+���r����r����;��sO�������������G�G�(F���(F��� (F� ��h�-�.�(F�� � (F��(F��(F��(F�V#���#�D��#��#��#��#�.5���5�s��5�t��5��5��5��5�29��#���9�4��9��9��9��9�9��#���9�4��9��9��9��9��)-�/3�,��,��x��}�%�,����+�,�,�� � � ,��,��,��,��,��,r,���r����)&r;���r<����enumre����logging�typingr���r���r���r���r���r���r ���r ���r���r���r����r ����flake8.plugins.finderr���� getLoggerr8���rb����Enumr���r���r���r���r���r���r����__annotations__r����r���r����rH���rJ���r����r���r,���r+����<module>r�������s}�����2��2��2�������������������������������������������������������������������������������������������������������������������������������������������������������������)��)��)��)��)��)��g���!�!����t�y���������� ���g�� =�� =����S�%��S� �4��"8�8�9�� �� �� �" ��" ��" ��" ��" �h�o��" ��" ��" �P�"'�!� �������������� � ��3��S� �>���������&Y=��Y=��Y=��Y=��Y=��Y=��Y=��Y=�xz,��z,��z,��z,��z,��z,��z,��z,��z,��z,r,���