Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/click/__pycache__/formatting.cpython-311.pyc



]j%
UddlZddlmZddlmZddlmZddlm	Z	dZ
ejee
d<dejejeefd	ejed
ffdZdejejeefded	ejejed
ffd
Z				ddededededed	efdZGddZdejed	ejeeffdZdS)N)contextmanager)gettext)term_len)	split_optFORCED_WIDTHrowsreturn.ci}|D]K}t|D]9\}}t||dt|||<:Lt	dt|DS)Nrc3 K|]	\}}|V
dS)N).0xys   p/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/click/formatting.py	<genexpr>z measure_table.<locals>.<genexpr>s&66tq!666666)	enumeratemaxgetrtuplesorteditems)r	widthsrowidxcols     r
measure_tablers!FAA!#	A	AHCfjja00(3--@@F3KK	A66vfllnn55666666r	col_countc#HK|D]}|d|t|z
zzVdS)N))len)r	rrs   r	iter_rowsr#sE33EYS122222233rNr!Ftextwidthinitial_indentsubsequent_indentpreserve_paragraphsc
ddlm}|}||||d}|s||Sggd
d

fd}|D]]}|s
|d

5t|}	|}|	t|z

|^|g}
D]\
}}|d
z5|r)|
|	|n(|
||dddn#1swxYwYd	
|
S)aA helper function that intelligently wraps text.  By default, it
    assumes that it operates on a single paragraph of text but if the
    `preserve_paragraphs` parameter is provided it will intelligently
    handle paragraphs (defined by two empty lines).

    If paragraphs are handled, a paragraph can be prefixed with an empty
    line containing the ``\b`` character (``\x08``) to indicate that
    no rewrapping should happen in that block.

    :param text: the text that should be rewrapped.
    :param width: the maximum width for the text.
    :param initial_indent: the initial indent that should be placed on the
                           first line as a string.
    :param subsequent_indent: the indent string that should be placed on
                              each consecutive line.
    :param preserve_paragraphs: if this flag is set then the wrapping will
                                intelligently handle paragraphs.
    r)TextWrapperF)r'r(replace_whitespaceNr
c	sdSddkr6pdddddfn-pdddfdd=dS)NrT
rF )stripappendjoin)bufindentpsr
_flush_parzwrap_text.<locals>._flush_parFs	Fq6<<>>T!!
HHfk43qrr7););<====
HHfk5#((3--8999FFFrr0z

r
N)	_textwrapr+
expandtabsfill
splitlinesrlstripr2extra_indentindent_onlyr3)r%r&r'r(r)r+wrapperr7lineorig_lenrvrawr4r5r6s            @@@r	wrap_textrEs2'&&&&&??Dk
%+ 	G"||D!!!)+AC
F!!			JLLLFF~#D>>{{}}!HTNN2JJtJLLL	B..T

!
!#,
/
/	.	.
.		'--d334444		',,t,,---		.	.	.	.	.	.	.	.	.	.	.	.	.	.	.;;r??s0AEE	E	c	eZdZdZ			d dedejedejeddfdZd	eddfd
Z	d!dZ
d!dZ	d"dededejeddfdZdeddfdZ
d!dZdeddfdZ		d#dejejeefdededdfdZededejdfdZedejdfdZdefdZdS)$
HelpFormatteraThis class helps with formatting text-based help pages.  It's
    usually just needed for very special internal cases, but it's also
    exposed so that developers can write their own fancy outputs.

    At present, it always writes into memory.

    :param indent_increment: the additional increment for each level.
    :param width: the width for the text.  This defaults to the terminal
                  width clamped to a maximum of 78.
    Nindent_incrementr&	max_widthr
cddl}||_|d}|At}|8tt	|j|dz
d}||_d|_g|_	dS)NrPrH2)
shutilrIrrminget_terminal_sizecolumnsr&current_indentbuffer)selfrIr&rJrNs     r__init__zHelpFormatter.__init__rsx	


 0I= E}C 8 8 : : BINNQRRTVWW
#%rstringc:|j|dS)z1Writes a unicode string into the internal buffer.N)rSr2)rTrVs  rwritezHelpFormatter.writes6"""""rc0|xj|jz
c_dS)zIncreases the indentation.NrRrIrTs rr5zHelpFormatter.indentt44rc0|xj|jzc_dS)zDecreases the indentation.NrZr[s rdedentzHelpFormatter.dedentr\rr!progargsprefixc$|tdd}|d|j|d}|j|jz
}|t|dzkr9dt|z}|t||||nx|||ddt
|jt|dzz}|t|||||ddS)	zWrites a usage line into the buffer.

        :param prog: the program name.
        :param args: whitespace separated list of arguments.
        :param prefix: The prefix for the first line. Defaults to
            ``"Usage: "``.
        NzUsage:r0>)r'r(r/)_rRr&rrXrEr)rTr_r`rausage_prefix
text_widthr5s       rwrite_usagezHelpFormatter.write_usagesE>(&&&F @4#6@@@@@@Z$"55
(<0025668L111FJJ#/&,	




JJ|$$$JJtC 3Xf5E5EFFJKFJJ*Vv


	

4rheadingcL|dd|j|ddS)z!Writes a heading into the buffer.r!rcz:
N)rXrR)rTrjs  r
write_headingzHelpFormatter.write_headings6

b=4.======>>>>>rcB|jr|ddSdS)z#Writes a paragraph into the buffer.r/N)rSrXr[s rwrite_paragraphzHelpFormatter.write_paragraphs.;	JJt		rr%c	d|jz}|t||j||d|ddS)zaWrites re-indented text into the buffer.  This rewraps and
        preserves paragraphs.
        r0T)r'r(r)r/N)rRrXrEr&)rTr%r5s   r
write_textzHelpFormatter.write_textsdt**


%"($(


	
	
	
	

4rr	col_maxcol_spacingct|}t|}t|dkrtdt	|d||z}t|t|D]_\}}|dd|j||s|d@t|||z
kr)|d|t|z
zn5|d|d||jzzt|j
|z
dz
d}t||d	
}	|	}
|
rS||
dd|
ddD](}|dd||jz|d)J|dadS)
anWrites a definition list into the buffer.  This is how options
        and commands are usually formatted.

        :param rows: a list of two item tuples for the terms and values.
        :param col_max: the maximum width of the first column.
        :param col_spacing: the number of spaces between the first and
                            second column.
        rHz(Expected two columns for definition listrr!rcr/r0
T)r)rN)
listrr"	TypeErrorrOr#rXrRrrr&rEr<)rTr	rrrsr	first_colfirstsecondrhwrapped_textlinesrAs            rwrite_dlzHelpFormatter.write_dlsDzzt$$v;;!FGGGq	7++k9	&tS[[99	!	!ME6JJ"<t2<<<U<<===


4   )k"999

3)huoo"=>????

4   

3)d.A"ABCCCTZ)3a7<<J$VZTRRRL ++--E
!

eAh???+++!!""ISSDJJ"Qy43F'FQQQQQQRRRRS

4    +	!	!rnamec#K||||	dV|dS#|wxYw)zHelpful context manager that writes a paragraph, a heading,
        and the indents.

        :param name: the section name that is written as heading.
        N)rnrlr5r^)rTr~s  rsectionzHelpFormatter.sectionsl	
4   


	EEEKKMMMMMDKKMMMMsAA1c#K|	dV|dS#|wxYw)z1A context manager that increases the indentation.N)r5r^r[s rindentationzHelpFormatter.indentation
sF	



	EEEKKMMMMMDKKMMMMs	2Ac6d|jS)zReturns the buffer contents.r!)r3rSr[s rgetvaluezHelpFormatter.getvalueswwt{###r)rHNNr8)r!N)rqrH)__name__
__module____qualname____doc__inttOptionalrUstrrXr5r^rirlrnrpSequenceTupler}rIteratorrrrr
rrrGrGfs5		!"!%%)	&&&z#&:c?	&

&&&&&#C#D####55555555
DH&&&"&12C&	
&&&&P?S?T????
st&	*!*!jc*+*!*!	*!

*!*!*!*!XCAJt$4^QZ-^$#$$$$$$rrGoptionscg}d}|D]C}t|d}|dkrd}|t||fD|ddd|D|fS)	aGiven a list of option strings this joins them in the most appropriate
    way and returns them in the form ``(formatted_string,
    any_prefix_is_slash)`` where the second item in the tuple is a flag that
    indicates if any of the option prefixes was a slash.
    Fr/Tc|dS)Nrr
)rs r<lambda>zjoin_options.<locals>.<lambda>,s
!A$r)keyz, c3&K|]}|dV
dS)rNr
)rrs  rrzjoin_options.<locals>.<genexpr>-s&&&aQqT&&&&&&r)rr2r"sortr3)rrCany_prefix_is_slashoptras     rjoin_optionsrs
B&&3"S=="&
		3v;;$%%%%GGG99&&2&&&&&(;;;r)r$r!r!F)typingr
contextlibrrrf_compatrparserrrrr__annotations__Iterablerrrrr#boolrErGrrr
rr<module>rs%%%%%%      !%ajo$$$7
1738#457!'#s(:K77773
*QWS#X&
'3473ZS!"3333 %FF

FFF	F
F	
FFFFRr$r$r$r$r$r$r$r$j<!*S/<agc4i.@<<<<<<r
Back to Directory File Manager