
    h                         S SK rS SKrS SKrS SKrSSKJr   " S S\R                  R                  5      r	 " S S\R                  R                  5      rg)    N   )
FoldedCasec                       \ rS rSrS rSrg)	RawPolicy	   c                     U R                   R                  [        R                  " USS S9R	                  5       R                  5       5      nU SU U R                    3$ )N        c                     g)NT )lines    T/var/www/auris/envauris/lib/python3.13/site-packages/importlib_metadata/_adapters.py<lambda> RawPolicy.fold.<locals>.<lambda>   s    $    )prefix	predicatez: )linesepjointextwrapindentlstrip
splitlines)selfnamevaluefoldeds       r   foldRawPolicy.fold
   sP    ""OOE'=NOVXZ\

 r&$,,00r   r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__r   r   r   r   r   	   s    1r   r   c                      ^  \ rS rSrSr\" \" \/ SQ5      5      r S\	R                  R                  4U 4S jjrS rU 4S jrU 4S jrS	 rU 4S
 jr\S 5       rSrU =r$ )Message   a`  
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>
)

ClassifierzObsoletes-DistPlatformzProject-URLzProvides-DistzProvides-ExtrazRequires-DistzRequires-ExternalzSupported-PlatformDynamicorigc                 l   > [         TU ]  U 5      n[        U5      R                  [        U5      5        U$ N)super__new__varsupdate)clsr*   res	__class__s      r   r.   Message.__new__M   s,    goc"S	d$
r   c                 .    U R                  5       U l        g r,   )_repair_headers_headers)r   argskwargss      r   __init__Message.__init__R   s    ,,.r   c                     > [         TU ]  5       $ r,   )r-   __iter__r   r3   s    r   r=   Message.__iter__V   s    w!!r   c                 B   > [         TU ]  U5      nUc  [        U5      eU$ )z
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   itemr2   r3   s      r   rA   Message.__getitem__Y   s(     g!$';4. 
r   c                     S n[        U 5      S    VVs/ s H  u  p#X!" U5      4PM     nnnU R                  (       a2  UR                  SU R                  5       45        U R	                  S5        U$ s  snnf )Nc                 Z    SnU (       a	  SU-   U ;  a  U $ [         R                  " X-   5      $ )zCorrect for RFC822 indentationr	   
)r   dedent)r   r   s     r   redent'Message._repair_headers.<locals>.redenti   s+    FD6M6??6>22r   r7   Description )r/   _payloadappendget_payloadset_payload)r   rI   keyr   headerss        r   r6   Message._repair_headersh   sm    	3 ;?t*Z:PQ:PJCC':PQ==NNM4+;+;+=>?R 	 Rs   A2c                 .   > [         TU ]  [        5       S9$ )N)policy)r-   	as_stringr   r>   s    r   rV   Message.as_stringv   s    w 	 44r   c           	      V   ^  U 4S jn[        [        U[        [        T 5      5      5      $ )zC
Convert PackageMetadata to a JSON-compatible format
per PEP 0566.
c                    > U TR                   ;   a  TR                  U 5      OTU    nU S:X  a  [        R                  " SU5      nU R	                  5       R                  SS5      nX!4$ )NKeywordsz\s+-_)multiple_use_keysget_allresplitlowerreplace)rQ   r   tkr   s      r   	transformMessage.json.<locals>.transform   s]    ),0F0F)FDLL%DQTIEj /$$S#.B9r   )dictmapr   )r   rd   s   ` r   jsonMessage.jsony   s#    	 C	3z4#89::r   )r7   )r   r    r!   r"   __doc__setrg   r   r]   emailmessager%   r.   r:   r=   rA   r6   rV   propertyrh   r#   __classcell__)r3   s   @r   r%   r%      sn    "H 	
"5==00 
/"5 ; ;r   r%   )email.messagerl   email.policyr_   r   _textr   rU   EmailPolicyr   rm   r%   r   r   r   <module>rt      sB      	  1(( 1t;emm## t;r   