OwlCyberSecurity - MANAGER
Edit File: config.cpython-311.pyc
� ������h������������������������<����U�d�Z�ddlZddlZddlmZ�ddlZddlmZmZ�ddl Z ddl Z ddlZddlZddl mZmZmZ�ddlmZ�ddlmZ�ddlZddlmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$�ddl%m&Z&m'Z'm(Z(m)Z)m*Z*�e rdd l+m,Z,�dd lm-Z-��e"dd� ������������Z.�e"de/e0e1e2e3������������Z4ej5��������dd����������dk�����r ddl6m7Z7�e7Z8nddlm7Z7�e7e/ee4���������f���������Z8dZ9�e j:��������d������������Z;e;�<���������������������e j=�����������������������������������dZ>e'e?d<����ej@��������d������������ZA�G�d��dejB��������������������ZCdede*f���������dede*f���������fd�ZDdede*f���������dede*f���������fd�ZE�G�d��d ee.���������������������ZF�G�d!��d"e8������������ZGd#e&de/fd$�ZH�G�d%��dejI��������eC�&������������ZJdS�)'zbModule containing module parser implementation able to properly read and write configuration files�����N)�wraps)�BufferedReader�IOBase)�defenc� force_text�is_win)�LockFile)�Any�Callable�Generic�IO�List�Dict�Sequence� TYPE_CHECKING�Tuple�TypeVar�Union�cast)�Lit_config_levels�ConfigLevels_Tup�PathLike�assert_never�_T)�Repo)�BytesIO�T_ConfigParser�GitConfigParser)�bound�T_OMD_value����)r!�����������)�OrderedDict)r����SectionConstraintz git.config)�system�user�global� repository� CONFIG_LEVELSz2(?<=includeIf )\"(gitdir|gitdir/i|onbranch):(.+)\"c��������������������D�������e�Zd�ZdZdededeeef���������dd�f��fd�Z��xZ S�)�MetaParserBuilderzZUtility class wrapping base-class methods into decorators that assure read-only properties�name�bases�clsdict�returnc������������������>�����d}||v�rj||���������}|D�]_}d��t����������j��������|t�����������j��������������������D���������������}|D�]1\��}}||v�r� t����������|������������} ||v�rt ����������| ������������} | ||<����2�`t����������t����������|����������������������������������|�|||������������} | S�)z� Equip all base-class methods with a needs_values decorator, and all non-const methods with a set_dirty_and_flush_changes decorator in addition to that.�_mutating_methods_c��������������3����P���K����|�]!}|d��������������������������������d�������������|V����"dS�)r����_N�� startswith)�.0�ts��� �[/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/git/config.py� <genexpr>z,MetaParserBuilder.__new__.<locals>.<genexpr>b���s=����������n�n��YZ�[\�Y]�Yh�Yh�il�Ym�Ym�n�1�n�n�n�n�n�n�����)�inspect� getmembers� isroutine�needs_values�set_dirty_and_flush_changes�superr,����__new__)�clsr-���r.���r/����kmm�mutating_methods�base�methods�method�method_with_values�new_type� __class__s��� �r9���rB���zMetaParserBuilder.__new__Z���s���������#���'�>�>�&�s�|���� 7�� 7��n�n�g�&8��w�?P�&Q�&Q�n�n�n��$+��7��7�L�D�&��w��� �)5�f�)=�)=�&��/�/�/�-H�I[�-\�-\�*��%7�G�D�M�M�7���*�C�0�0�8�8��d�E�7�S�S���r;���) �__name__� __module__�__qualname__�__doc__�strr���r���r ���rB���� __classcell__�rK���s���@r9���r,���r,���W���sh���������������d�d��3���u���t�C��H�~���J]��������������������r;���r,����func.r0���c����������� �������l�������t������������������������dddt����������dt����������dt����������f��fd���������������}|S�)zOReturns method assuring we read values (on demand) before we try to access them�selfr����args�kwargsr0���c������������������D������|����������������������������������������|�g|�R�i�|��S��N)�read)rU���rV���rW���rS���s��� �r9����assure_data_presentz)needs_values.<locals>.assure_data_presentw���s0�������� � �����t�D�*�4�*�*�*�6�*�*�*r;���)r���r ���r���)rS���r[���s���` r9���r?���r?���t���sY���������4�[�[�+�"3��+�C��+�3��+�SU��+��+��+��+��+���[�+� ��r;����non_const_funcc������������������Z�������dddt�����������dt�����������dt����������f��fd�}��j��������|_��������|S�)z�Return method that checks whether given non constant function may be called. If so, the instance will be set dirty. Additionally, we flush the changes right to diskrU���r���rV���rW���r0���c������������������V��������|�g|�R�i�|��}d|�_���������|�������������������������������������|S�)NT)�_dirty�write)rU���rV���rW����rvalr\���s��� �r9���� flush_changesz2set_dirty_and_flush_changes.<locals>.flush_changes����s;��������~�d�4�T�4�4�4�V�4�4������ � �����r;���)r ���r���rL���)r\���rb���s���` r9���r@���r@�������sQ������� �-���c���S���R��������������,�4�M���r;���c���������������������������e�Zd�ZdZdZdZdededdfd�Zdd �Z d ede f��fd�Zded e de de fd�Ze defd���������������Zdd�Zdd�Zdedededdfd�Z��xZS�)r%���a"��Constrains a ConfigParser to only option commands which are constrained to always use the section we have been initialized with. It supports all ConfigParser methods that operate on an option. :note: If used as a context manager, will release the wrapped ConfigParser.��_config� _section_name)� get_value� set_value�get�set�getint�getfloat� getboolean� has_option�remove_section� remove_option�options�config�sectionr0���Nc������������������"�����||�_���������||�_��������d�S�rY���rd���)rU���rr���rs���s��� r9����__init__zSectionConstraint.__init__����s���������$����r;���c������������������8�����|�j���������������������������������������������d�S�rY����re����release�rU���s��� r9����__del__zSectionConstraint.__del__����s������� ��������r;����attrc������������������v������������j���������v�r���fd�S�t����������t����������������������������������������������������������S�)Nc�������������������&��������j����������g|��R�i�|��S�rY���)�_call_config)rV���rW���r{���rU���s��� ��r9����<lambda>z/SectionConstraint.__getattr__.<locals>.<lambda>����s%�������+<�4�+<�T�+S�D�+S�+S�+S�F�+S�+S��r;���)� _valid_attrs_rA���r%����__getattribute__)rU���r{���rK���s���``�r9����__getattr__zSectionConstraint.__getattr__����sD����������4�%�%�%�S�S�S�S�S�S��&��-�-�>�>�t�D�D�Dr;���rH���rV���rW���c������������������J������t����������|�j��������|������������|�j��������g|�R�i�|��S�)zcCall the configuration at the given method which must take a section name as first argument)�getattrre���rf���)rU���rH���rV���rW���s��� r9���r~���zSectionConstraint._call_config����s3�������-�w�t�|�V�,�,�T�-?�Q�$�Q�Q�Q�&�Q�Q�Qr;���c�����������������������|�j���������S�)z*return: Configparser instance we constrain)re���ry���s��� r9���rr���zSectionConstraint.config����s��������|�r;���c������������������4�����|�j��������������������������������������������S�)zZEquivalent to GitConfigParser.release(), which is called on our underlying parser instancerw���ry���s��� r9���rx���zSectionConstraint.release����s�������|�#�#�%�%�%r;����!SectionConstraint[T_ConfigParser]c������������������8�����|�j���������������������������������������������|�S�rY���)re���� __enter__ry���s��� r9���r����zSectionConstraint.__enter__����s���������� � � ��r;����exception_type�exception_value� tracebackc������������������>�����|�j������������������������������|||�������������d�S�rY���)re����__exit__)rU���r����r����r����s��� r9���r����zSectionConstraint.__exit__����s"����������n�o�y�I�I�I�I�Ir;����r0���N)r0���r����)rL���rM���rN���rO���� __slots__r����r���rP���ru���rz���r ���r����r~����propertyrr���rx���r����r����rQ���rR���s���@r9���r%���r%�������sn��������������P��P��-�I��M�%�~��%���%���%��%��%��%��������E���E���E��E��E��E��E��E� R�3��R�s��R�c��R�c��R��R��R��R� ������������X��&��&��&��&��������J�s��J�S��J�S��J�UY��J��J��J��J��J��J��J��Jr;���r%���c������������ ��������b������e�Zd�ZdZdededdf��fd�Zdededdf��fd�Zdede e���������ddf��fd �Z dedef��fd �Zdedef��fd�Zdededdf��fd�Z dded eedf���������deedf���������f��fd� Zdede e���������f��fd�Zde eeef������������������fd�Zde eee e���������f������������������fd�Z��xZS�)�_OMDzOrdered multi-dict.�key�valuer0���Nc������������������\������t����������t����������|����������������������������������||g�������������d�S�rY����rA���r�����__setitem__�rU���r����r����rK���s��� �r9���r����z_OMD.__setitem__����s+������� �d�D���%�%�c�E�7�3�3�3�3�3r;���c�������������������������||�vr,t����������t����������|����������������������������������||g�������������d�S�t����������t����������|����������������������������������|���������������������������������|�������������d�S�rY���)rA���r����r�����__getitem__�appendr����s��� �r9����addz_OMD.add����se��������d�?�?��$����)�)�#��w�7�7�7��4� �d�D���%�%�c�*�*�1�1�%�8�8�8�8�8r;����valuesc������������������Z������t����������t����������|����������������������������������||�������������d�S�rY���r����)rU���r����r����rK���s��� �r9����setallz_OMD.setall����s)������� �d�D���%�%�c�6�2�2�2�2�2r;���c������������������`������t����������t����������|����������������������������������|������������d���������S��N����rA���r����r�����rU���r����rK���s��� �r9���r����z_OMD.__getitem__�����&��������T�4� � �,�,�S�1�1�"�5�5r;���c������������������`������t����������t����������|����������������������������������|������������d���������S�r����r����r����s��� �r9����getlastz_OMD.getlast����r����r;���c�������������������������||�vr,t����������t����������|����������������������������������||g�������������d�S�t����������t����������|����������������������������������|������������}||d<���d�S�r����)rA���r����r����r����)rU���r����r�����priorrK���s��� �r9����setlastz_OMD.setlast����s]��������d�?�?��$����)�)�#��w�7�7�7��F��d�D�!�!�-�-�c�2�2����b� � � r;����defaultc������������������d������t����������t����������|����������������������������������||g������������d���������S�r����)rA���r����ri���)rU���r����r����rK���s��� �r9���ri���z_OMD.get����s*��������T�4� � �$�$�S�7�)�4�4�R�8�8r;���c������������������T������t����������t����������|����������������������������������|������������S�rY���r����r����s��� �r9����getallz_OMD.getall����s!��������T�4� � �,�,�S�1�1�1r;���c������������������ ���������fd���D���������������S�)z"List of (key, last value for key).c������������������$������g�|�]}|�|���������f�� S���r�����r7����krU���s��� �r9���� <listcomp>z_OMD.items.<locals>.<listcomp>����s!�������+�+�+���D��G��+�+�+r;���r����ry���s���`r9����itemsz _OMD.items����s�������+�+�+�+�d�+�+�+�+r;���c������������������ ���������fd���D���������������S�)z&List of (key, list of values for key).c������������������>������g�|�]}|�����������������������|������������f��S�r����)r����r����s��� �r9���r����z"_OMD.items_all.<locals>.<listcomp>����s(�������2�2�2���D�K�K��N�N�#�2�2�2r;���r����ry���s���`r9���� items_allz_OMD.items_all����s�������2�2�2�2�T�2�2�2�2r;���rY���)rL���rM���rN���rO���rP���r���r����r ���r����r���r����r����r����r����r���ri���r����r���r����r����rQ���rR���s���@r9���r����r��������s����������������4�s��4�2��4�$��4��4��4��4��4��4�9�s��9�3��9�4��9��9��9��9��9��9�3�#��3�t�B�x��3�D��3��3��3��3��3��3�6�s��6�s��6��6��6��6��6��6�6�3��6�3��6��6��6��6��6��6��3���s���t�������������9��9�s��9�U�2�t�8�_��9��b�$�h���9��9��9��9��9��9�2�#��2�$�r�(��2��2��2��2��2��2�,�t�E�#�r�'�N�+��,��,��,��,�3�4��c�4��8�m� 4�5��3��3��3��3��3��3��3��3r;���r�����config_levelc����������� �����������t�����������r|�dk����rd}�|�dk����rdS�|�dk����r�t����������j�����������������������������d������������p2t ����������j��������t����������j�����������������������������dd������������d������������}t ����������j��������t ����������j��������t ����������j��������|d d ������������������������������������S�|�dk����r&t ����������j��������t ����������j��������d������������������������S�|�dk����rt����������d �������������t����������|�t����������d|����������������������������d�S�)Nr&���r(���z/etc/gitconfigr'����XDG_CONFIG_HOME�HOME�~z.config�gitrr���z~/.gitconfigr)���zGNo repo to get repository configuration from. Use Repo._get_config_pathzInvalid configuration level: ) r����os�environri����osp�join�normpath� expanduser� ValueErrorr���)r�����config_homes��� r9����get_config_pathr��������s�������� �,�(�*�*����x����� �� � ��j�n�n�%6�7�7�k�3�8�B�J�N�N�SY�[^�D_�D_�aj�;k�;k���|�C�N�3�8�K���+Q�+Q�R�R�S�S�S� �� !� !��|�C�N�>�:�:�;�;�;� �� %� %��b�c�c�c�� ���G�|�G�G�H�H� �� �� �� �� r;���c��������������������,������e�Zd�ZdZeZ�ej��������d������������ZdZ �ej��������e ������������Z �ej��������e dz���dz���������������Z[ dZ � � � � �d6d e ded ee ed f������������������f���������deded e edf���������de d���������ddfd�Zd7d�Zd7d�Zd8d�Zdeddfd�Zd7d�Zdedefd�Zde eee���������f���������deddfd�Zde eef���������fd�Z de!e"eef������������������fd�Z#d7d�Z$deddfd �Z%d!ede!e"eef������������������f��fd"�Z&d!ede!e"ee!e���������f������������������fd#�Z'e(d7d$���������������Z)d%eddfd&�Z*d'eddf��fd(�Z+e,defd)���������������Z- �d9d'ed*ed+e ee.eedf���������de ee.eef���������fd,�Z/ �d9d'ed*ed+e ee.eedf���������de!e ee.eef������������������fd-�Z0d.ede ee.eef���������fd/�Z1d0e eeee.ef���������defd1�Z2e(e3d'ed*ed0e eeee.ef���������dd�fd2�����������������������������Z4e(e3d'ed*ed0e eeee.ef���������dd�fd3�����������������������������Z5d'ed4edd�f��fd5�Z6��xZ7S�):r���a���Implements specifics required to read git style configuration files. This variation behaves much like the git.config command such that the configuration will be read on demand based on the filepath given during initialization. The changes will automatically be written once the instance goes out of scope, but can be triggered manually as well. The configuration file will be locked if you intend to change values preventing other instances to write concurrently. :note: The config is case-sensitive even when queried, hence section and option names must match perfectly. If used as a context manager, will release the locked file.z^\s*[#;]z\s*(?P<option>[^:=\s][^:=]*)z\s*(?P<vi>[:=])\s*z(?P<value>.*)$)�add_sectionro���rp���rj���NT� file_or_filesr���� read_only�merge_includesr�����repo)r���Nr0���c����������������������t�����������j�����������������������������|�t������������������������|��|��|��t ����������|�d������������s|������������������������������������|�_��������|�||�_��������n?|�(|rd��t����������D���������������|�_��������n$t����������d�������������t����������|������������g|�_��������||�_��������d|�_��������d|�_ ��������||�_��������||�_��������d|�_��������|�������������������������������������dS�)a;��Initialize a configuration reader to read the given file_or_files and to possibly allow changes to it by setting read_only False :param file_or_files: A single file path or file objects or multiple of these :param read_only: If True, the ConfigParser may only read the data , but not change it. If False, only a single file path or file object may be given. We will write back the changes when they happen, or when the ConfigParser is released. This will not happen if other configuration files have been included :param merge_includes: if True, we will read files mentioned in [include] sections and merge their contents into ours. This makes it impossible to write back an individual configuration file. Thus, if you want to modify a single configuration file, turn this off to leave the original dataset unaltered when reading it. :param repo: Reference to repository to use if [includeIf] sections are found in configuration files. )� dict_type�_proxiesNc������������������^�����g�|�]*}|d�k�����t����������t����������t����������|��������������������������+S�)r)���)r����r���r���)r7����fs��� r9���r����z,GitConfigParser.__init__.<locals>.<listcomp>`��s>�������+��+��+�HI�^_�co�^o�^o���->��(B�(B�C�C�^o�^o�^or;���z7No configuration level or configuration files specifiedF)�cp�RawConfigParserru���r�����hasattr�_dictr�����_file_or_filesr*���r����r����� _read_onlyr_����_is_initialized�_merge_includes�_repo�_lock� _acquire_lock)rU���r����r����r����r����r����s��� r9���ru���zGitConfigParser.__init__8��s�����4� ��#�#�D�D�#�9�9�9��'�������t�Z�(�(�� )� �J�J�L�L�D�M��$�dq�D����#���`�+��+�MZ�+��+��+�D�'�'��%�%^�_�_�_�'6�|�'D�'D�&E��#�#������$���-����� �.2�� ��������r;���c������������������l����|�j���������s�|�j��������s�t����������|�j��������t����������t ����������j��������f������������r|�j��������}nBt����������|�j��������t����������t����������t����������f������������rt����������d�������������|�j��������j��������}|����������������������|������������|�_��������|�j��������� �����������������������������������d�S�d�S�)NzVWrite-ConfigParsers can operate on a single file only, multiple files have been passed)r����r����� isinstancer����rP���r����r����tuple�listr���r����r-����t_lock�_obtain_lock)rU���r����s��� r9���r����zGitConfigParser._acquire_lockp��s���������� &��:�� 8��d�1�C���3E�F�F��=�$(�$7�M�M��� 3�e�T�8�5L�M�M��=�$�p�������%)�$7�$<�M��"�[�[��7�7�� �� �J�#�#�%�%�%�%�%�! &�� &r;���c������������������.�����|��������������������������������������dS�)z3Write pending changes if required and release locksN�rx���ry���s��� r9���rz���zGitConfigParser.__del__���s������� �������r;���c������������������.�����|��������������������������������������|�S�rY���)r����ry���s��� r9���r����zGitConfigParser.__enter__���s�������������r;���rV���c������������������.�����|��������������������������������������d�S�rY���r����)rU���rV���s��� r9���r����zGitConfigParser.__exit__���s�������������r;���c����������������������|�j���������s |�j��������r|�j�������������������������������������������sdS� � �|�������������������������������������n7#�t����������$�r�t �������������������������������dd��������������Y�nt����������$�r�Y�nw�xY�w|�j���������|�j��������������������������������������������dS�dS�#�|�j���������|�j��������������������������������������������w�w�xY�w)z�Flush changes and release the configuration write lock. This instance must not be used anymore afterwards. In Python 3, it's required to explicitly release locks and flush changes, as __del__ is not called deterministically anymore.Nz/Exception during destruction of GitConfigParserT)�exc_info) r����r����� _has_lockr`����IOError�log�error�ReferenceError� _release_lockry���s��� r9���rx���zGitConfigParser.release���s���������>�� �d�j�� ���1E�1E�1G�1G�� ��F� +� �� � �������� \�� \�� \�� � �K�VZ� �[�[�[�[�[�!�� �� �� ���� ������z�%�� �(�(�*�*�*�*�*��&�%��t�z�%�� �(�(�*�*�*�*��&���s5����A���B��&A5�'B��) A5�2B��4A5�5B��#B?� optionstrc�����������������������|S�)z0Do not transform options in any way when writingr����)rU���r����s��� r9����optionxformzGitConfigParser.optionxform���s�������r;����fp�fpnamec������������������@����d}d}d}d}d}dt�����������dt�����������fd�} �|��������������������������������������������������������t����������������������} | s�nL|dz���}| �����������������������������������d k����s|�j�����������������������������| ������������r�i| ���������������������dd������������d��������������������������������������������d k����r| d���������dv�r��|�j �����������������������������| �����������������������������������������������} |s�| r�| � ��������������������d�����������������������������������������������}||�j��������v�r|�j��������|���������}nD|t����������j ��������k����r|�j��������}n,|����������������������d |ff������������}||�j��������|<���d|�j��������|<���d}�n|�t����������j��������||| �������������|�s�|�j�����������������������������| ������������} | �r&| � ��������������������ddd������������\��}}} |dv�rmd| v�ri| ��������������������������������������������������������d������������sB| ���������������������d������������}|dk����r'| |dz ����������������������������������������������r | d|����������} | �����������������������������������} | dk����rd } |����������������������|�����������������������������������������������}t1����������| ������������dk����r-| d���������dk����r!| d���������dk����rd}�|| dd����������������������} |���������������������|| �������������n�|�j�����������������������������| ������������s9|st����������j��������|������������}|���������������������|t;����������| ���������������������������| �����������������������������������} | ���������������������d������������rd}| dd����������} |���������������������|������������} |� ��������������������|| �|| ������������z������������������||r|�dS�)a���A direct copy of the py2.4 version of the super class's _read method to assure it uses ordered dicts. Had to change one line to make it work. Future versions have this fixed, but in fact its quite embarrassing for the guys not to have done it right in the first place ! Removed big comments to make it more compact. Made sure it ignores initial whitespace as git uses tabsNr���F�vr0���c�����������������������|�d���������dk����r |�d�d����������}�|�����������������������t�������������������������������������������d������������S�)Nr�����\�unicode_escape)�encoder����decode)r����s��� r9���� string_decodez,GitConfigParser._read.<locals>.string_decode���s?��������u��}�}��c�r�c�F����8�8�F�#�#�*�*�+;�<�<�<r;���T�������rem�rR�headerrL����option�vir����)�=�:�;�"r����z"")!rP����readliner����r����strip� re_comment�match�split�lower�SECTCRE�group� _sectionsr�����DEFAULTSECT� _defaultsr����r�����MissingSectionHeaderError�OPTCREr6����find�isspacer�����rstrip�lenr�����OPTVALUEONLY�ParsingErrorr�����repr�endswithr����r����)rU���r����r�����cursect�optname�lineno� is_multi_line�er�����line�mo�sectnamer���optval�poss��� r9����_readzGitConfigParser._read���s�������������� ��� =�S�� =�S�� =�� =�� =�� =�A G��;�;�=�=�'�'��/�/�D��� ���a�Z�F��z�z�|�|�r�!�!�T�_�%:�%:�4�%@�%@�!���z�z�$��"�"�1�%�+�+�-�-��6�6�4��7�d�?�?�����#�#�D�J�J�L�L�1�1�B� ��2 G�R��2 G� "���� 2� 2� 8� 8� :� :���t�~�-�-�"�n�X�6�G�G����/�/�"�n�G�G�"�j�j�:�x�*@�)B�C�C�G�/6�D�N�8�,�.2�D�M�(�+�������2�6�6�4�H�H�H�"��" G��[�&�&�t�,�,�����*,�(�(�8�T�7�*K�*K�'�G�R���Z�'�'�C�6�M�M�&�,�,�.�.�B[�B[�\_�B`�B`�M�$�k�k�#�.�.���"�9�9���a���)@�)@�)B�)B�9�%+�D�S�D�\�F�#�\�\�^�^�F���~�~�!#��"�.�.�w�~�~�/?�/?�@�@�G��6�{�{�Q���6�!�9��+;�+;��r� �c�@Q�@Q�(,� �!.��v�a�b�b�z�!:�!:����K�K���0�0�0�0�� �,�2�2�4�8�8��5� ��8� "��� 7� 7�A������d���4�4�4���{�{�}�}���=�=��%�%��%�$)�M�����9�D� ����1�1�������-�-��2E�2E�)E�F�F�F�CA G�L� �� ��G� �� r;���c������������������R�����|�j���������o t����������|������������������������������������������������S�rY���)r����r���_included_pathsry���s��� r9���� _has_includeszGitConfigParser._has_includes��s$�������#�C��D�,@�,@�,B�,B�(C�(C�Cr;���c�����������������������g�}|�������������������������������������D��]�}|dk����r||����������������������|������������z ��}t�������������������������������|������������}|�|�j����������E|���������������������d������������}|���������������������d������������������������������������������������|dv�r�t����������j����������������������t�����������fd�dD���������������������������sd�z������ ��������������������d ������������r�d z ���|� ��������������������d������������rt����������j��������dd ����������������|�j��������j ��������rDt����������j��������t!����������|�j��������j ���������������������������������r||����������������������|������������z ��}��Q|dk����rQ �|�j��������j��������j��������}n#�t&����������$�r�Y���ww�xY�wt����������j��������|�������������r||����������������������|������������z ��}���|S�)zkReturn List all paths that must be included to configuration as Tuples of (option, value). �includeNr����r#���)�gitdirzgitdir/ic��������������3����B����K����|�]}�����������������������|������������V����d�S�rY���r5���)r7����sr����s��� �r9���r:���z2GitConfigParser._included_paths.<locals>.<genexpr>%��s1�����������D�D�1�5�+�+�A�.�.�D�D�D�D�D�Dr;���)z./�/z**/r1��z**z/iz[a-zA-Z]c�����������������������d����������������������|�����������������������������������������������������������������������|�����������������������������������������������������������������������������������S�)Nz[{}{}])�formatr��r���upper)�ms��� r9���r���z1GitConfigParser._included_paths.<locals>.<lambda>.��s8������(�/�/�!�'�'�)�)�/�/�2C�2C�Q�W�W�Y�Y�_�_�EV�EV�"W�"W��r;����onbranch)�sectionsr�����CONDITIONAL_INCLUDE_REGEXP�searchr����r��r ��r����r�����anyr���re�sub�git_dir�fnmatch�fnmatchcaserP���� active_branchr-���� TypeError)rU����pathsrs���r���keyword�branch_namer����s��� @r9���r*��zGitConfigParser._included_paths��s�����������}�}����& 1��& 1�G��)�#�#�����G�,�,�,��.�5�5�g�>�>�E��}�� � 2���k�k�!�n�n�G��K�K��N�N�(�(�*�*�E��0�0�0���u�-�-���D�D�D�D��D�D�D�D�D��*�!�E�M�E��>�>�#�&�&��"��T�M�E���#�#�D�)�)����F�#�W�W�����E� ��:�%��5��*�3�t�z�/A�+B�+B�E�J�J��5�����G�!4�!4�4����J�&�&��"&�*�":�"?�K�K�� ��������H�������&�{�E�:�:��1��T�Z�Z��0�0�0�E���s����0F� F�Fc������������������b����|�j���������rdS�d|�_���������dg}t����������|�j��������t����������t����������j��������f������������r |�j��������g}nDt����������|�j��������t����������t����������t����������f������������s |�j��������g}nt����������|�j��������������������}t����������|������������}d}|�r|� ��������������������d������������}d}t����������|d������������r<t����������t����������t�������������������|������������}|����������������������||j���������������������nlt����������t ����������|������������} �t#����������|d������������5�}d}|����������������������||j���������������������ddd�������������n#�1�swxY�w�Y���n#�t$����������$�r�Y���w�xY�w|�������������������������������������r|������������������������������������D��]\��}}|���������������������d������������rt-����������j��������|������������}t-����������j��������|������������s]|s�Ft����������t ����������|������������}t-����������j��������|������������s J�d ���������������t-����������j��������t-����������j��������|������������|������������}t-����������j��������|������������}||v�st ����������j��������|t����������j��������������������s��|���������������������|�������������|���������������������d|�������������|d z ��}�� |��|dk����r d|�_ ��������dS�dS�)z�Reads the data stored in the files we have been initialized with. It will ignore files that cannot be read, possibly leaving an empty configuration :return: Nothing :raise IOError: if a file cannot be handledNTr����r���F�seek�rbr����z9Need absolute paths to be sure our cycle checks will workr����)!r����r����r����rP���r����r���r����r����r���rj����popr����r���r ����bytesr(��r-����openr����r+��r*��r6���r����r�����isabsr�����dirnamer�����access�R_OKr�����insertr����) rU���� files_to_read�seen�num_read_include_files� file_path�file_okr����r4����include_paths ��� r9���rZ���zGitConfigParser.readA��s��������� ��4�#���46�4� ��d�)�C���+=�>�>�� 6�!�0�1�M�M��D�/�%��x�1H�I�I�� 6�!�0�1�M�M� ��!4�5�5�M���=�!�!��!"����& 0�%�)�)�!�,�,�I��G��y�&�)�)�� � ��E��I�6�6� �� � �9�i�n�5�5�5�5��!��9�5�5� ���i��.�.��0�"�"&��� � �2�r�w�/�/�/�0��0��0��0��0��0��0��0��0��0��0�����0��0��0��0������������H����� ��!�!�#�#�� 0�'+�';�';�'=�'=��0��0�O�A�|�#�.�.�s�3�3��D�'*�~�l�'C�'C���9�\�2�2��V�&��%�$�$(��9�$=�$=� �"�y��3�3�p�p�5p�p�p�3�'*�x���I�0F�0F��'U�'U��#&�<��#=�#=�L�#�t�+�+�2�9�\�2�7�3S�3S�+� ��H�H�\�*�*�*�!�(�(��L�9�9�9�*�a�/�*�*�M���& 0�Z�"�Q�&�&�#(�D� � � ��'�&s6����E��$E�E��E�E��E�E�� E'�&E'c���������������������������dt�����������dt����������ddf���fd�}��j��������r�|t����������j����������j�����������������������j�������������������������������������������D�]\��}}�|||��������������dS�)z_Write an .ini-format representation of the configuration state in git compatible formatr-����section_dictr0���Nc������������������j����������������������������d|�z�����������������������t�����������������������������������|�����������������������������������D�]l\��}}|dk����r�|D�]]}�����������������������d|�d����������������������|���������������������������������dd�������������d����������������������t������������������������������������^�md�S�)Nz[%s] rL���� z = � z )r`���r����r���r�����_value_to_string�replace)r-���rW��r����r����r����r����rU���s��� ��r9���� write_sectionz-GitConfigParser._write.<locals>.write_section���s���������H�H�h��o�-�-�f�5�5�6�6�6��".�!7�!7�!9�!9�� u�� u� ��f��*�$�$����u��u�A��H�H�H�s�s�s�D�4I�4I�!�4L�4L�4T�4T�UY�[a�4b�4b�4b�4b�c�k�k�lr�s�s�t�t�t�t�u� u�� ur;���)rP���r����r��r����r��r��r����)rU���r����r]��r-���r����s���`` r9����_writezGitConfigParser._write���s��������� u��� u�4�� u�D�� u�� u�� u�� u�� u�� u�� u���>�� :��M�"�.�$�.�9�9�9�� �>�/�/�1�1�� '�� '�K�D�%��M�$��&�&�&�&� '�� 'r;����section_namec������������������h������d��t����������t����������|����������������������������������|������������D���������������S�)zK:return: list((option, value), ...) pairs of all items in the given sectionc������������������(�����g�|�]\��}}|d�k�����||f��S�)rL���r����)r7���r����r����s��� r9���r����z)GitConfigParser.items.<locals>.<listcomp>���s,������g�g�g�4�1�a�WX�\f�Wf�Wf��A��Wf�Wf�Wfr;���)rA���r���r����)rU���r_��rK���s��� �r9���r����zGitConfigParser.items���s/�������g�g�5��$�#?�#?�#E�#E�l�#S�#S�g�g�g�gr;���c����������������������t����������|�j��������������������}|�j��������|��������������������������������������������D�]E\��}}|dk����r�||v�r|���������������������|������������|k����r�*|D�]}|���������������������||���������������F|�����������������������������������S�)zQ:return: list((option, [values...]), ...) pairs of all items in the given sectionrL���)r����r��r��r����r����r����)rU���r_���rvr�����vsr����s��� r9���r����zGitConfigParser.items_all���s������� �$�.� !� !���^�L�1�;�;�=�=�� �� �E�A�r��J�����B�w�w�2�9�9�Q�<�<�2�-�-���� �� �����q�!����� ���|�|�~�~�r;���c������������������R����|�����������������������d�������������|�j��������sdS�t����������|�j��������t����������t ����������f������������r$t ����������dt����������|�j��������������������z���������������|������������������������������������rt����������� ��������������������d�������������dS�|�j��������}t����������|t����������t����������j ��������t����������f������������}|r |�j���������|�j��������������������������������������������t#����������|d������������sUt%����������t����������|������������}t'����������|d������������5�}|����������������������|�������������ddd�������������dS�#�1�swxY�w�Y���dS�t%����������d|������������}|���������������������d�������������t#����������|d ������������r|������������������������������������|����������������������|�������������dS�) z�Write changes to our file, if there are changes at all :raise IOError: if this is a read-only writer instance or if we could not obtain a file lockr`���NzRCannot write back if there is not exactly a single file to write to, have %i fileszsSkipping write-back of configuration file as include files were merged in.Set merge_includes=False to prevent this.rF���wbr���r����truncate)�_assure_writabler_���r����r����r����r�����AssertionErrorr��r+��r�����debugrP���r����r���r���r����r����r����r���rJ��r^��rF��rg��)rU���r�����is_file_lock�fp_opens��� r9���r`���zGitConfigParser.write���s������� ���g�&�&�&��{�� ��4��d�)�D�%�=�9�9�� � �d��d�)�*�*�+����� �������� ��I�I�>� �� �� ���4��� ���"�"�s�B�K��&@�A�A���� &�D�J�2��J�#�#�%�%�%��r�6�"�"�� ��h��#�#�B��b�$���� %�7����G�$�$�$� %�� %�� %�� %�� %�� %�� %�� %�� %�� %�� %�� %����� %�� %�� %�� %�� %�� %���i��$�$�B��G�G�A�J�J�J��r�:�&�&�� ���� � � ��K�K��O�O�O�O�Os����D<�<E��E��method_namec������������������>�����|�j���������rt����������d|��d|���������������d�S�)Nz#Cannot execute non-constant method �.)r����r����)rU���rm��s��� r9���rh��z GitConfigParser._assure_writable���s4�������>�� \��'����k�k�Z�[�[�[� \�� \r;���rs���c������������������T������t����������t����������|����������������������������������|������������S�)z(Assures added options will stay in order)rA���r���r����)rU���rs���rK���s��� �r9���r����zGitConfigParser.add_section���s!��������_�d�+�+�7�7��@�@�@r;���c�����������������������|�j���������S�)z@:return: True if this instance may change the configuration file)r����ry���s��� r9���r����zGitConfigParser.read_only���s���������r;���r��r����c����������������������� �|�����������������������||������������}n#�t����������$�r�|�|cY�S���w�xY�w|����������������������|������������S�)a���Get an option's value. If multiple values are specified for this option in the section, the last one specified is returned. :param default: If not None, the given default value will be returned in case the option did not exist :return: a properly typed value, either int, float or string :raise TypeError: in case the value could not be understood Otherwise the exceptions known to the ConfigParser will be raised.)ri���� Exception�_string_to_value)rU���rs���r��r�����valuestrs��� r9���rg���zGitConfigParser.get_value���s_������& ��x�x���0�0�H�H���� �� �� ��"������ ���� ��$�$�X�.�.�.s������+�+c������������������������� ������������������������������������������j��������|������������������������������|������������}n#�t����������$�r �|�|gcY�S���w�xY�w��fd�|D���������������S�)a���Get an option's values. If multiple values are specified for this option in the section, all are returned. :param default: If not None, a list containing the given default value will be returned in case the option did not exist :return: a list of properly typed values, either int, float or string :raise TypeError: in case the value could not be understood Otherwise the exceptions known to the ConfigParser will be raised.Nc������������������:������g�|�]}�����������������������|��������������S�r����)rt��)r7���ru��rU���s��� �r9���r����z.GitConfigParser.get_values.<locals>.<listcomp>&��s'�������D�D�D�H��%�%�h�/�/�D�D�Dr;���)r7��r��r����rs��)rU���rs���r��r�����lsts���` r9���� get_valueszGitConfigParser.get_values��s��������$ ��M�M�O�O�O��.��)�0�0��8�8�C�C���� �� �� ��"��y� � � �� ���� �E�D�D�D��D�D�D�Ds����48��A� Aru��c������������������2����t�����������t����������f}|D�]<} ��||������������}|t����������|������������k����r�"|c�S�#�t����������t����������f$�r�Y��9w�xY�w|�����������������������������������}|dk����rdS�|dk����rdS�t����������|t����������������������st����������d|�������������|S�)N�falseF�trueTz=Invalid value type: only int, long, float and str are allowed)�int�floatr����rA��r��r����rP���)rU���ru���types�numtype�val�vls��� r9���rt��z GitConfigParser._string_to_value(��s��������e����� �� �G� ��g�h�'�'���%��/�/�)�)��� � � ��� �*�� �� �� ��� ���� ��^�^� � �� ��=�=��5� ��<�<��4��(�C�(�(�� ��O������ � ��s����7�7�A� Ar����c�����������������������t����������|t����������t����������t����������f������������rt ����������|������������S�t����������|������������S�rY���)r����r}��r~���boolrP���r���)rU���r����s��� r9���r[��z GitConfigParser._value_to_stringD��s5�������e�c�5�$�/�0�0�� ��u�:�:���%� � � r;���c�����������������������|�����������������������|������������s|����������������������|�������������|����������������������|||����������������������|�������������������������|�S�)a���Sets the given option in section to the given value. It will create the section if required, and will not throw as opposed to the default ConfigParser 'set' method. :param section: Name of the section in which the option resides or should reside :param option: Name of the options whose value to set :param value: Value to set the option to. It must be a string or convertible to a string :return: this instance)�has_sectionr����rj���r[���rU���rs���r��r����s��� r9���rh���zGitConfigParser.set_valueI��sW�����������(�(�� &����W�%�%�%�����&�$�"7�"7��">�">�?�?�?��r;���c������������������������|�����������������������|������������s|����������������������|�������������|�j��������|������������������������������||����������������������|�������������������������|�S�)aI��Adds a value for the given option in section. It will create the section if required, and will not throw as opposed to the default ConfigParser 'set' method. The value becomes the new value of the option as returned by 'get_value', and appends to the list of values returned by 'get_values`'. :param section: Name of the section in which the option resides or should reside :param option: Name of the option :param value: Value to add to option. It must be a string or convertible to a string :return: this instance)r���r����r��r����r[��r���s��� r9���� add_valuezGitConfigParser.add_value[��s^�����������(�(�� &����W�%�%�%���w��#�#�F�D�,A�,A�%�,H�,H�I�I�I��r;����new_namec�����������������������|�����������������������|������������st����������d|z���������������|�����������������������|������������rt����������d|z���������������t����������t����������|����������������������������������|�������������|�j��������|���������}|����������������������|������������D�]\��}}|���������������������||��������������|����������������������|�������������|�S�)z�rename the given section to new_name :raise ValueError: if section doesn't exit :raise ValueError: if a section with new_name does already exist :return: this instance z!Source section '%s' doesn't existz'Destination section '%s' already exists) r���r����rA���r���r����r��r����r����ro���)rU���rs���r����new_sectionr����rd��rK���s��� �r9����rename_sectionzGitConfigParser.rename_sectionn��s�������������(�(�� L��@�7�J�K�K�K����H�%�%�� S��F��Q�R�R�R� �o�t�$�$�0�0��:�:�:��n�X�.���^�^�G�,�,�� &�� &�E�A�r����q�"�%�%�%�%�� ���G�$�$�$��r;���)NTTNNr����)r0���r���rY���)8rL���rM���rN���rO���r ���r����r;���compiler���optvalueonly_sourcer��r��r2���r���r���r���r���r���ru���r����rz���r����r ���r����rx���rP���r����r���r ���rI��r(��r}��r+��r���r���r*��rZ���r^��r����r����r?���r`���rh��r����r����r����r~��rg���ry��rt��r[��r@���rh���r���r���rQ���rR���s���@r9���r���r�����s���������������G��G�(��F����K�(�(�J��:���2�:�1�2�2�L� �R�Z�+�.C�C�FW�W� X� X�F���S���ae��#�7;�$(� 6��6��T�8�Y���x�QZ�GZ�A[�8\�\�]�6���6��� 6� ��-�t�3�4�6���L�!� 6�� �6��6��6��6�p&��&��&��&�(������� ��������c���d���������+��+��+��+�.�S���S���������a��n�b��i�7�8��a�#��a�$��a��a��a��a�FD�u�T�3�Y�/��D��D��D��D�.��e�C��H�o�!6��.��.��.��.�`E)��E)��E)��E)�P'���'���'��'��'��'�4h�#��h�$�u�S�#�X��*?��h��h��h��h��h��h��c���d�5��d�3�i��3H�.I��������� ��)��)��)���\�)�V\�C��\�D��\��\��\��\�A�3��A�4��A��A��A��A��A��A����4���������X���7;� /��/��/���/���s�E�3��d�2�3� /� � �s�E�3��$� %�/��/��/��/�@�7;� E��E��E���E���s�E�3��d�2�3� E� � �e�C���T�)�*� +�E��E��E��E�8�����s�E�3��7L�1M���������8!�e�C���U�D�,H�&I��!�c��!��!��!��!� �� �����c���%��U�C�QV�X\�@\�:]���bs��������!� ���\�� �� �����c���%��U�C�QV�X\�@\�:]���bs��������!� ���\��"�c���S���=N��������������������r;���)� metaclass)KrO����sys�abc� functoolsr���r<����ior���r����loggingr����r;��r>��� git.compatr���r���r����git.utilr ����os.path�pathr�����configparserr�����typingr ���r���r���r ���r���r���r���r���r���r���r���r���� git.typesr���r���r���r���r���� git.repo.baser���r���r���rP���rI��r}��r~��r���r ����version_info�collectionsr$����OrderedDict_OMD�__all__� getLoggerr����� addHandler�NullHandlerr*����__annotations__r���r8���ABCMetar,���r?���r@���r%���r����r����r����r���r����r;���r9����<module>r������s����������� � � �� � � � �������������������%��%��%��%��%��%��%��%������� � � � �� � � � ��������������������������������������������������������� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��V��U��U��U��U��U��U��U��U��U��U��U��U��U����"�"�"�"�"�"���������)�1B�C�C�C���g�m�S�%��e�T�B�B����B�Q�B��)�#�#�'�'�'�'�'�'�!�O�O�"�"�"�"�"�"�!�#�t�K�'8�"8�9�O��3����g���%�%������"�w�"�$�$��%��%��%��#M� ���L��L��L� �(�R�Z�(]�^�^��������������������: �x��R��(�� �X�c�2�g�->�� �� �� �� � ���b��0A�� �h�s�TV�w�FW�� �� �� �� � ;J��;J��;J��;J��;J���/��;J��;J��;J�|)3��)3��)3��)3��)3�?��)3��)3��)3�X �"3�� ��� �� �� �� �0o ��o ��o ��o ��o �b�(�4E��o ��o ��o ��o ��o ��o r;���