AlkantarClanX12

Your IP : 3.133.138.129


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/formatter.cpython-37.opt-2.pyc

B

YI~d';�@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�./opt/alt/python37/lib64/python3.7/formatter.py�__init__)szNullFormatter.__init__cCsdS)Nr)r�	blanklinerrr	�
end_paragraph-�zNullFormatter.end_paragraphcCsdS)Nr)rrrr	�add_line_break.r
zNullFormatter.add_line_breakcOsdS)Nr)r�args�kwrrr	�add_hor_rule/r
zNullFormatter.add_hor_rulecCsdS)Nr)r�format�counterrrrr	�add_label_data0r
zNullFormatter.add_label_datacCsdS)Nr)r�datarrr	�add_flowing_data1r
zNullFormatter.add_flowing_datacCsdS)Nr)rrrrr	�add_literal_data2r
zNullFormatter.add_literal_datacCsdS)Nr)rrrr	�flush_softspace3r
zNullFormatter.flush_softspacecCsdS)Nr)r�alignrrr	�push_alignment4r
zNullFormatter.push_alignmentcCsdS)Nr)rrrr	�
pop_alignment5r
zNullFormatter.pop_alignmentcCsdS)Nr)r�xrrr	�	push_font6r
zNullFormatter.push_fontcCsdS)Nr)rrrr	�pop_font7r
zNullFormatter.pop_fontcCsdS)Nr)r�marginrrr	�push_margin8r
zNullFormatter.push_margincCsdS)Nr)rrrr	�
pop_margin9r
zNullFormatter.pop_margincCsdS)Nr)r�spacingrrr	�set_spacing:r
zNullFormatter.set_spacingcGsdS)Nr)r�stylesrrr	�
push_style;r
zNullFormatter.push_style�cCsdS)Nr)r�nrrr	�	pop_style<r
zNullFormatter.pop_stylecCsdS)Nr)r�flagrrr	�assert_line_data=r
zNullFormatter.assert_line_data)N)N)r&)r&)�__name__�
__module__�__qualname__r
rrrrrrrrrrrr r!r#r%r(r*rrrr	rs$


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)Nr&r)
rr�align_stack�
font_stack�margin_stackr"�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_label)rrrrr	r
NszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS)Nrr&)	r7r�send_line_breakr8r6�send_paragraphr3r5r4)rrrrr	r]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dS)Nrr&)r7r5rr9r8r6r3r4)rrrr	rhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dS)Nr&r)	r7rr9�
send_hor_ruler3r8r5r4r6)rrrrrr	ros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dS)Nr&r)
r8r7rr9r5r:�
isinstance�str�send_label_data�format_counterr3r4r6)rrrrrrr	rvs

z AbstractFormatter.add_label_datacCsxd}xn|D]f}|dkr$|d|}q
|dkrF|dkrp||�||�}q
|dkrh|dkrp||�||�}q
||}q
W|S)N��1z%dZaArZiI)�
format_letter�format_roman)rrr�label�crrr	r?�s
z AbstractFormatter.format_countercCs@d}x6|dkr:t|dd�\}}tt|�|�}||}qW|S)Nr@rr&�)�divmod�chr�ord)r�caserrDr�srrr	rB�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}x�|d	kr�t|d
�\}}|dkrX||||d|}nT|d
krv|||||}n6|dkr�||}|d}nd}||||}||}|d}q W|dkr�|��S|S)N�irrE�m�v�l�d)r@rr�
�	r&��r@�I)rG�upper)	rrJrZonesZfivesrD�indexrrKrrr	rC�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr&���� r)�isspace�join�splitr3r4r6r7r5r8r�send_flowing_data)rrZprespaceZ	postspacerrr	r�s$

z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)NrYrX�
r)	r4rr]r7r3r5r6r8�send_literal_data)rrrrr	r�sz"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS)Nrr&rY)r4r7r5r6r8r3rr])rrrr	r�sz!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dS)N)rr�
new_alignmentr/�append)rrrrr	r�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS)NrX)r/rrr`)rrrrr	r�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr&rYrX)
r4r7r5r3rr]r0�AS_ISra�new_font)
r�font�sizerL�b�ttZcsizeZci�cbZcttrrr	r�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dS)NrX)r0rrc)rrdrrr	r�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSrr)�.0rMrrr	�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rX)r1rar�
new_margin�len)rr�fstackrrr	r s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrXcSsg|]}|r|�qSrr)rirMrrr	rj
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r1rrkrl)rrmrrrr	r!
s
zAbstractFormatter.pop_margincCs||_|j�|�dS)N)r"r�new_spacing)rr"rrr	r#szAbstractFormatter.set_spacingcGsZ|jr*d|_|_|_d|_|j�d�x|D]}|j�|�q0W|j�t	|j��dS)Nrr&rY)
r4r7r5r3rr]r2ra�
new_styles�tuple)rr$Zstylerrr	r%s
zAbstractFormatter.push_styler&cCs$|j|d�=|j�t|j��dS)N)r2rrorp)rr'rrr	r(!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS)Nr)r3r7r5r6r8)rr)rrr	r*%sz"AbstractFormatter.assert_line_data)N)r&)r&)r+r,r-r
rrrrr?rBrCrrrrrrrr r!r#r%r(r*rrrr	r.@s*
	
	
	
r.c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rcCsdS)Nr)rrrr	r
2r
zNullWriter.__init__cCsdS)Nr)rrrr	�flush3r
zNullWriter.flushcCsdS)Nr)rrrrr	r`4r
zNullWriter.new_alignmentcCsdS)Nr)rrdrrr	rc5r
zNullWriter.new_fontcCsdS)Nr)rr�levelrrr	rk6r
zNullWriter.new_margincCsdS)Nr)rr"rrr	rn7r
zNullWriter.new_spacingcCsdS)Nr)rr$rrr	ro8r
zNullWriter.new_stylescCsdS)Nr)rrrrr	r:9r
zNullWriter.send_paragraphcCsdS)Nr)rrrr	r9:r
zNullWriter.send_line_breakcOsdS)Nr)rrrrrr	r;;r
zNullWriter.send_hor_rulecCsdS)Nr)rrrrr	r><r
zNullWriter.send_label_datacCsdS)Nr)rrrrr	r]=r
zNullWriter.send_flowing_datacCsdS)Nr)rrrrr	r_>r
zNullWriter.send_literal_dataN)r+r,r-r
rqr`rcrkrnror:r9r;r>r]r_rrrr	r*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))�print)rrrrr	r`IszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r))rt)rrdrrr	rcLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d))rt)rrrrrrr	rkOszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r))rt)rr"rrr	rnRszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r))rt)rr$rrr	roUszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r))rt)rrrrr	r:XszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break())rt)rrrr	r9[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule())rt)rrrrrr	r;^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r))rt)rrrrr	r>aszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r))rt)rrrrr	r]dsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r))rt)rrrrr	r_gsz AbstractWriter.send_literal_dataN)r+r,r-r`rcrkrnror:r9r;r>r]r_rrrr	rsAsrsc@sFeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)�
DumbWriterN�HcCs(|ptj|_||_t�|�|��dS)N)�sys�stdout�file�maxcolrr
�reset)rryrzrrr	r
ts
zDumbWriter.__init__cCsd|_d|_dS)Nr)�col�atbreak)rrrr	r{zszDumbWriter.resetcCs |j�d|�d|_d|_dS)Nr^r)ry�writer|r})rrrrr	r:~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dS)Nr^r)ryr~r|r})rrrr	r9�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nr^�-r)ryr~rzr|r})rrrrrr	r;�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nr^rr&)ryr~�rfindr|�
expandtabsrlr})rrrLrrr	r_�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}xZ|��D]N}|rn|t|�|kr^|d�d}n|d�|d}||�|t|�}d}q8W||_|d��|_dS)Nrr^rYr&rX)r}rZr|rzryr~r\rl)rrr}r|rzr~Zwordrrr	r]�s$zDumbWriter.send_flowing_data)Nrv)
r+r,r-r
r{r:r9r;r_r]rrrr	ruks	

rucCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z0x*|D]"}|dkrd|�d�qL|�|�qLWWd|tjk	r�|��X|�d�dS)Nr&r^r)	rur.�openrw�argv�stdinrr�close)ry�w�f�fp�linerrr	�test�s



r��__main__)N)rw�warnings�warn�DeprecationWarningrbrr.rrsrur�r+rrrr	�<module>s"k*C