AlkantarClanX12

Your IP : 3.146.206.246


Current Path : /usr/lib64/python3.8/__pycache__/
Upload File :
Current File : //usr/lib64/python3.8/__pycache__/formatter.cpython-38.opt-2.pyc

U

e5d';�@s�ddlZddlZejdedd�dZGdd�d�ZGdd�d�ZGd	d
�d
�ZGdd�de�ZGd
d�de�Z	ddd�Z
edkr�e
�dS)�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZd'dd�Zdd�Zdd�Zdd	�Zd(d
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd)d#d$�Zd*d%d&�ZdS)+�
NullFormatterNcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs$


rc@s�eZdZdd�Zdd�Zdd�Zdd�Zd-d
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd.d)d*�Zd/d+d,�Zd	S)0�AbstractFormattercCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rDr�send_line_breakrErC�send_paragraphr@rBrAr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrF)rDrBrrGrErCr@rArr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr;)	rDrrG�
send_hor_ruler@rErBrArCrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr;)
rErDrrGrBrH�
isinstance�str�send_label_data�format_counterr@rArCrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrM�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrNrr0�)�divmod�chr�ord)r	�caserrRr$�sr
r
rrP�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rS�m�v�l�d)rNrr�
�	r0��rN�I)rU�upper)	r	rXrZonesZfivesrR�indexr$rYr
r
rrQ�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitr@rArCrDrBrEr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrgrf�
r)	rArrkrDr@rBrCrE�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rg)rArDrBrCrEr@rrkrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr<�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrf)r<r!rror r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rgrf)
rArDrBr@rrkr=�AS_ISrp�new_font)
r	�font�sizerZ�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrq)r=rrs�r	rtr
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r[r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rf)r>rpr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrfcSsg|]}|r|�qSr
r
ryr
r
rr{
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r>rr|r})r	r~r'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSrn)
rArDrBr@rrkr?rp�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r?rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)r@rDrBrCrEr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9rrrrrrMrPrQrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr:@s*
	
	
	
r:c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rcCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rro4rzNullWriter.new_alignmentcCsdSrr
rxr
r
rrs5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr|6rzNullWriter.new_margincCsdSrr
r*r
r
rr7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrH9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrG:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrI;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrL<rzNullWriter.send_label_datacCsdSrr
rr
r
rrk=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrm>rzNullWriter.send_literal_dataN)r7r8r9rr�rorsr|rr�rHrGrIrLrkrmr
r
r
rr*src@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�AbstractWritercCstd|f�dS)Nznew_alignment(%r)��printr r
r
rroIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�rxr
r
rrsLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr|OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rrRszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrHXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrG[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrI^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrLaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrkdsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrmgsz AbstractWriter.send_literal_dataN)r7r8r9rorsr|rr�rHrGrIrLrkrmr
r
r
rr�Asr�c@sFeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)�
DumbWriterN�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrlr�r��writer�r�r
r
r
rrH~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrG�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrl�-r)r�r�r�r�r�rr
r
rrI�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrlrr0)r�r��rfindr��
expandtabsr}r�)r	rrZr
r
rrm�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrlrgr0rf)r�rhr�r�r�r�rjr})r	rr�r�r�r�Zwordr
r
rrk�s$zDumbWriter.send_flowing_data)Nr�)
r7r8r9rr�rHrGrIrmrkr
r
r
rr�ks	

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rlr)	r�r:�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)r��warnings�warn�DeprecationWarningrrrr:rr�r�r�r7r
r
r
r�<module>s�"k*C