OwlCyberSecurity - MANAGER
Edit File: _adapters.cpython-312.pyc
� ����e��g�����������������������������d�dl�Zd�dlZd�dlZd�dlZddlmZ��G�d��dej������������������j�������������������������Z �G�d��dej������������������j�������������������������Zy)�����N����)� FoldedCasec�������������������������e�Zd�Zd��Zy)� RawPolicyc������������������������|�j�������������������j������������������t��������j������������������|dd����������j ��������������������������j���������������������������������}|��d|��|�j����������������������S�)N� c������������������������y)NT��)�lines��� �K/opt/hc_python/lib/python3.12/site-packages/importlib_metadata/_adapters.py�<lambda>z RawPolicy.fold.<locals>.<lambda>���s������$�����)�prefix� predicatez: )�linesep�join�textwrap�indent�lstrip� splitlines)�self�name�value�foldeds��� r����foldzRawPolicy.fold ���sP���������"�"��O�O�E�'�=N�O� �V�X� �Z�\� �� ���r�&��$�,�,��0�0r���N)�__name__� __module__�__qualname__r���r ���r���r���r���r��� ���s������1r���r���c���������������������������e�Zd�ZdZ�e�eeg�d���������������Z �dej������������������j������������������f��fd�Zd��Z��fd�Z ��fd�Zd��Z��fd �Zed ����������Z��xZS�)�Messagea��� Specialized Message subclass to handle metadata naturally. Reads values that may have newlines in them and converts the payload to the Description. >>> msg_text = textwrap.dedent(''' ... Name: Foo ... Version: 3.0 ... License: blah ... de-blah ... <BLANKLINE> ... First line of description. ... Second line of description. ... <BLANKLINE> ... Fourth line! ... ''').lstrip().replace('<BLANKLINE>', '') >>> msg = Message(email.message_from_string(msg_text)) >>> msg['Description'] 'First line of description.\nSecond line of description.\n\nFourth line!\n' Message should render even if values contain newlines. >>> print(msg) Name: Foo Version: 3.0 License: blah de-blah Description: First line of description. Second line of description. <BLANKLINE> Fourth line! <BLANKLINE> <BLANKLINE> ) � ClassifierzObsoletes-Dist�PlatformzProject-URLz Provides-DistzProvides-Extraz Requires-DistzRequires-ExternalzSupported-Platform�Dynamic�origc������������������l������t����������|����|��������}t��������|�������j������������������t��������|���������������|S��N)�super�__new__�vars�update)�clsr$����res� __class__s��� �r���r(���zMessage.__new__M���s,��������g�o�c�"���S� ����d��$�� r���c������������������.�����|�j��������������������������|�_��������y�r&���)�_repair_headers�_headers)r����args�kwargss��� r����__init__zMessage.__init__R���s�������,�,�.�� r���c������������������ ������t����������|������������S�r&���)r'����__iter__�r���r-���s��� �r���r5���zMessage.__iter__V���s��������w��!�!r���c������������������@������t����������|����|�������}|�t��������|��������|S�)a"�� Override parent behavior to typical dict behavior. ``email.message.Message`` will emit None values for missing keys. Typical mappings, including this ``Message``, will raise a key error for missing keys. Ref python/importlib_metadata#371. )r'����__getitem__�KeyError)r����itemr,���r-���s��� �r���r8���zMessage.__getitem__Y���s(���������g�!�$�'���;��4�.� �� r���c������������������������d��}t��������|��������d���D���cg�c]��\��}}|�||�������f���}}}|�j������������������r2|j������������������d|�j��������������������������f��������|�j ������������������d��������|S�c�c}}w�)Nc������������������L�����d}|�rd|z���|�vr|�S�t��������j������������������||�z����������S�)zCorrect for RFC822 indentationr���� )r����dedent)r���r���s��� r����redentz'Message._repair_headers.<locals>.redenti���s-�������F��D�6�M��6����?�?�6�E�>�2�2r���r0����Description��)r)����_payload�append�get_payload�set_payload)r���r?����keyr����headerss��� r���r/���zMessage._repair_headersh���so������ 3��;?�t�*�Z�:P�Q�:P�J�C��C����'�:P��Q��=�=��N�N�M�4�+;�+;�+=�>�?����R� ���� �Rs����A,c������������������4������t����������|����t������������������������S�)N)�policy)r'���� as_stringr���r6���s��� �r���rJ���zMessage.as_stringv���s��������w� � �� �4�4r���c����������� �������T���������fd�}t��������t��������|t��������t�������������������������������S�)z[ Convert PackageMetadata to a JSON-compatible format per PEP 0566. c�������������������������|��j�������������������v�r�j������������������|��������n�|����}|�dk(��rt��������j������������������d|�������}|�j ��������������������������j������������������dd�������}||fS�)N�Keywordsz\s+�-�_)�multiple_use_keys�get_all�re�split�lower�replace)rF���r����tkr���s��� �r���� transformzMessage.json.<locals>.transform����s_�������),��0F�0F�)F�D�L�L��%�D�QT�I�E��j� ������/������$�$�S�#�.�B��u�9�r���)�dict�mapr���)r���rW���s���` r����jsonzMessage.jsony���s#������� ���C� �3�z�4�#8�9�:�:r���)r���r���r����__doc__�setrY���r���rP����email�messager ���r(���r3���r5���r8���r/���rJ����propertyrZ���� __classcell__)r-���s���@r���r ���r ������sn�������"�H���� � ���"��5�=�=�0�0��� /�"� ��5��� ;��� ;r���r ���)� email.messager]����email.policyrR���r����_textr���rI����EmailPolicyr���r^���r ���r ���r���r����<module>re������sB���������� �����1����(�(��1�t;�e�m�m�#�#��t;r���