+
    Dfj#                     J    R t R
R ltR tR tRR lt]tR tR tR tRR lt	R	# )z'
Miscellany of text-munging functions.
c                *   Rp. p\        V 4      \        J d   RpV P                  4        F  w  rE\        WQR,           4      p\	        V4      '       d<   \        V4      '       d   VR\        R4      )  pVP                  V RV RV 24       Kc  VP                  V RV RV\        V4      ^,           R  24       K  	  M\        V 4      \        J g   \        V 4      \        J d[   \        V 4      \        J d   R	pMR
pV  F;  p\        WaR,           4      pVP                  VP                  4       R,           4       K=  	  M+\        V3R l\        V 4      P                  R4      4      VR&   V'       g   VP                  V4       V'       dN   W^ ,          ,           V^ ,          \        V4      ^,           R ,           V^ &   VR,          VR,          ,           VR&   RP                  V4      p\	        V4      '       d   \        V4      '       g
   VR,           pV# )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                     W,           # N )sis   &&5/usr/lib/python3/dist-packages/twisted/python/text.py<lambda>stringyString.<locals>.<lambda>/   s    QU    NNN)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 ,,.JC!%u)<=E5!! ''!,SYJ/E		[M3%s5':; 		[M3%r%K8H18L8N2O1PQR ) 
f	$v,$"6<5 FFG#G3->?GIIgnn&,-  2CK4E4Ed4KL1
		+Qi'"Q%K0@10D0F*GG1B&*$2		"A1~~mA..HHr   c                *    V P                  R4      R8g  # )z5
Returns C{True} if this string has a newline in it.
r   r   )findr
   s   &r   r   r   @   s     66$<2r   c                &    V \        R4      ) R R8H  # )z3
Returns C{True} if this string ends in a newline.
r   N)r   r*   s   &r   r   r   G   s     c$iZ\?d""r   c                6   . pV P                  R4      ^ 8  d?   V P                  R4      pV F%  pVP                  \        WA4      R.,           4       K'  	  V# V P                  4       p^ p^ pV'       d   V\	        WW,          4      ,           pV^,           pWa8  d@   V^8X  d   M	V^,
          pV^ V WWR rXVP                  RP                  V4      4       ^ p^ pKn  \	        V4      V8  g&   VP                  RP                  V4      4       VR K  V^,           pK  V# )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   Nr   r   )r)   r   extend
greedyWrapr   r   r    )	inStringwidthoutLines
paragraphsparainWordscolumnptr_linels	   &&       r   r.   r.   N   s
    H }}V!^^F+
DOOJt3rd:; nnGFH
#g/00a<>1} $a<#Ah/1COOCHHQK(HFg,)OOCHHW-.
 aZF Or   c                 ~    . pV  F4  pV'       g   VP                  4       '       g   K#  VP                  V4       K6  	  V# r   )stripr   )linesretlines   &  r   removeLeadingBlanksr=      s1    
C$**,,JJt  Jr   c                     \        V P                  R 4      4      pVP                  4        \        V4      pVP                  4        R P                  V4      R ,           # )r   )r=   r   reverser    )r
   r:   s   & r   removeLeadingTrailingBlanksr@      sD    .E	MMO&E	MMO99Ud""r   c                   . pRpRpV P                  4        F  pVf+   V'       d#   V^ ,          R9   d   V^ ,          pVR,          p. pVf   VP                  V4       KH  V'       dI   VR,          V8X  d;   VRR pVP                  V4       VP                  RP                  V4      4       RpK  VP                  V4       K  	  V# )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.
N:   NNr   )"'r   )r   r   r    )r
   outquotphrasewords   &    r   splitQuotedrI      s     CDF	>aJ.AwBx>JJtbT)CRyd#

388F+,d#! $ Jr   c                   \        V 4      ! 4       p\        \        V 4      R4      pV'       g   V P                  4       p  VP	                  V\        V 4      ,
          4      pV'       g   VP                  4       p\        V4      pV^ 8X  d   R# \        V4      V,           V,
          pV^ 8:  d
   W5,           pMW7R V,           pVP                  V 4      R8w  g   K  R# )zO
Find whether string C{p} occurs in a read()able object C{f}.

@rtype: C{bool}
FNTi   r   )r   maxr   lowerreadr)   )pfcaseSensitivebufbuf_lenr
bytes_readr7   s   &&&     r   strFilerU      s     q')C#a&*%GGGI
FF7SV#$	AV
?Hz!G+6'Cb'A+C88A;"r   N)r   )P   )T)
__doc__r   r   r   r.   wordWrapr=   r@   rI   rU   r	   r   r   <module>rY      s<   
2j#/d # Fr   