ó
    Ö›‘h#  ã                   óH   • S r S
S jrS rS rSS jr\rS rS rS rSS jr	g	)z'
Miscellany of text-munging functions.
c                 ó®  • Sn/ n[        U 5      [        L aœ  SnU R                  5        H…  u  pE[        XQS-   5      n[	        U5      (       a:  [        U5      (       a  US[        S5      *  nUR                  U SU SU 35        M]  UR                  U SU SU[        U5      S	-   S  35        M‡     O [        U 5      [        L d  [        U 5      [        L aQ  [        U 5      [        L a  S
nOSnU  H3  n[        XaS-   5      nUR                  UR                  5       S-   5        M5     O+[        U4S j[        U 5      R                  S5      5      USS& U(       d  UR                  U5        U(       a-  XS   -   US   [        U5      S-   S -   US'   US   US   -   US'   SR                  U5      n[	        U5      (       a  [        U5      (       d  US-   nU$ )aP  
Expansive string formatting for sequence types.

C{list.__str__} and C{dict.__str__} use C{repr()} to display their
elements.  This function also turns these sequence types
into strings, but uses C{str()} on their elements instead.

Sequence elements are also displayed on separate lines, and nested
sequences have nested indentation.
Ú z{}z   NÚ
Ú z:
z: é   z()z[]Ú,c                 ó
   • X-   $ ©N© )ÚsÚis     ÚWC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/python/text.pyÚ<lambda>ÚstringyString.<locals>.<lambda>/   s   € ¨QªUó    é    é   éÿÿÿÿ)ÚtypeÚdictÚitemsÚstringyStringÚisMultilineÚendsInNewlineÚlenÚappendÚtupleÚlistÚrstripÚmapÚstrÚsplitÚjoin)ÚobjectÚindentationÚbracesÚslÚkeyÚvalueÚelementr   s           r   r   r      s¼  € ð €FØ	€BäˆFƒ|”tÒØˆØ Ÿ,™,ž.‰JˆCÜ! %°uÑ)<Ó=ˆEÜ˜5×!Ñ!Ü  ×'Ñ'Ø! ,¤S¨£Y JÐ/�EØ—	‘	˜[˜M¨¨3¨%¨s°5°'Ð:Ö;ð —	‘	˜[˜M¨¨3¨%¨r°%¼¸KÓ8HÈ1Ñ8LÐ8NÐ2OÐ1PÐQÖRò )ô 
ˆf‹œÒ	¤$ v£,´$Ò"6Ü�‹<œ5Ò Ø‰FàˆFãˆGÜ# G¸3Ñ->Ó?ˆGØ�I‰I�g—n‘nÓ&¨Ñ,Ö-ò ô  Ó2´C¸³K×4EÑ4EÀdÓ4KÓLˆ‰1ˆæØ
�	‰	�+ÔæØ Q™iÑ'¨"¨Q©%´°KÓ0@À1Ñ0DÐ0FÐ*GÑGˆˆ1‰Ø�B‘˜& ™*Ñ$ˆˆ2‰à�	‰	�"‹€Aä�1‡~�~œm¨A×.Ñ.Ø�‰Hˆà€Hr   c                 ó*   • U R                  S5      S:g  $ )z5
Returns C{True} if this string has a newline in it.
r   r   )Úfind©r   s    r   r   r   @   s   € ð �6‰6�$‹<˜2ÑÐr   c                 ó&   • U [        S5      * S S:H  $ )z3
Returns C{True} if this string ends in a newline.
r   N)r   r,   s    r   r   r   G   s   € ð Œc�$‹iˆZˆ\ˆ?˜dÑ"Ð"r   c                 ó
  • / nU R                  S5      S:¼  a:  U R                  S5      nU H!  nUR                  [        XA5      S/-   5        M#     U$ U R                  5       nSnSnU(       a–  U[	        XW   5      -   nUS-   nXa:”  a9  US:X  a  OUS-
  nUSU XWS pXUR                  SR                  U5      5        SnSnO:[	        U5      U:”  d&  UR                  SR                  U5      5        USS2	 OUS-   nU(       a  M–  U$ )z÷
Given a string and a column width, return a list of lines.

Caveat: I'm use a stupid greedy word-wrapping
algorythm.  I won't put two spaces at the end
of a sentence.  I don't do full justification.
And no, I've never even *heard* of hypenation.
z

r   r   r   Nr   )r+   r!   ÚextendÚ
greedyWrapr   r   r"   )	ÚinStringÚwidthÚoutLinesÚ
paragraphsÚparaÚinWordsÚcolumnÚptr_lineÚls	            r   r0   r0   N   s  € ð €Hð ‡}�}�VÓ Ó!Ø—^‘^ FÓ+ˆ
ÛˆDØ�O‰OœJ tÓ3°r°dÑ:Ö;ñ àˆØ�n‰nÓ€Gà€FØ€HÞ
Øœ#˜gÑ/Ó0Ñ0ˆØ˜a‘<ˆà‹>Ø˜1‹}àð $ a™<�Ø# A hÐ/°¸Ð1C�Ø�O‰O˜CŸH™H Q›KÔ(àˆHØ‰FÜ�g“, Ó)à�O‰O˜CŸH™H WÓ-Ô.Øš‘
ð ˜a‘ZˆF÷- ˆ'ð2 €Or   c                 óz   • / nU  H2  nU(       d  UR                  5       (       d  M!  UR                  U5        M4     U$ r	   )Ústripr   )ÚlinesÚretÚlines      r   ÚremoveLeadingBlanksr?   ƒ   s1   € Ø
€CÛˆÞ�$—*‘*—,“,Ø�J‰J�tÖñ ð €Jr   c                 ó´   • [        U R                  S5      5      nUR                  5         [        U5      nUR                  5         SR                  U5      S-   $ )Nr   )r?   r!   Úreverser"   )r   r<   s     r   ÚremoveLeadingTrailingBlanksrB   ‹   sD   € Ü §¡¨£Ó.€EØ	‡M�M„OÜ Ó&€EØ	‡M�M„OØ�9‰9�UÓ˜dÑ"Ð"r   c                 ó`  • / nSnSnU R                  5        H“  nUc  U(       a  US   S;   a  US   nUSS n/ nUc  UR                  U5        M8  U(       aC  US   U:X  a:  USS nUR                  U5        UR                  SR                  U5      5        SnM‚  UR                  U5        M•     U$ )a!  
Like a string split, but don't break substrings inside quotes.

>>> splitQuoted('the "hairy monkey" likes pie')
['the', 'hairy monkey', 'likes', 'pie']

Another one of those "someone must have a better solution for
this" things.  This implementation is a VERY DUMB hack done too
quickly.
Nr   )Ú"Ú'r   r   r   )r!   r   r"   )r   ÚoutÚquotÚphraseÚwords        r   ÚsplitQuotedrJ   “   s²   € ð €CØ€DØ€FØ—‘–	ˆØ‰>Þ˜˜a™ JÓ.Ø˜A‘w�Ø˜A˜B�x�Ø�à‰>Ø�J‰J�tÖæ˜˜b™ TÓ)Ø˜C˜R�y�Ø—‘˜dÔ#Ø—
‘
˜3Ÿ8™8 FÓ+Ô,Ø’à—‘˜dÖ#ñ! ð$ €Jr   c                 ó~  • [        U 5      " 5       n[        [        U 5      S5      nU(       d  U R                  5       n  UR	                  U[        U 5      -
  5      nU(       d  UR                  5       n[        U5      nUS:X  a  g[        U5      U-   U-
  nUS::  a  X5-   nOX7S U-   nUR                  U 5      S:w  a  gM�  )zO
Find whether string C{p} occurs in a read()able object C{f}.

@rtype: C{bool}
i   r   FNr   T)r   Úmaxr   ÚlowerÚreadr+   )ÚpÚfÚcaseSensitiveÚbufÚbuf_lenÚrÚ
bytes_readr9   s           r   ÚstrFilerV   ¶   s®   € ô ˆqŒ'‹)€CÜ”#�a“&˜*Ó%€GÞØ�G‰G‹IˆØ
Ø�F‰F�7œS ›VÑ#Ó$ˆÞØ—‘“	ˆAÜ˜“Vˆ
Ø˜‹?ØÜ�‹H�zÑ! GÑ+ˆØ�‹6Ø‘'‰Cà�b�'˜A‘+ˆCØ�8‰8�A‹;˜"ÓØñ r   N)r   )éP   )T)
Ú__doc__r   r   r   r0   ÚwordWrapr?   rB   rJ   rV   r
   r   r   Ú<module>rZ      s<   ðñô
2òjò#ô/ðd €òò#ò õFr   