b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/formatter.pyo
Size18.85 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:27
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s¥dZddkZdZddd��YZddd��YZddd��YZd efd
��YZd efd ��YZdd
�Z e
djo e �ndS(sGeneric output formatting.

Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.

Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.
iÿÿÿÿNt
NullFormattercBs¼eZdZdd�Zd�Zd�Zd�Zdd�Zd�Z d�Z
d�Z d �Z d
�Z
d �Zd �Zd
�Zd�Zd�Zd�Zdd�Zdd�ZRS(s=A formatter which does nothing.

If the writer parameter is omitted, a NullWriter instance is created.
No methods of the writer are called by NullFormatter instances.

Implementations should inherit from this class if implementing a writer
interface but don't need to inherit any implementation.

cCs'|djo
t�}n||_dS(N(tNonet
NullWritertwriter(tselfR((s!/usr/lib64/python2.6/formatter.pyt__init__&s

cCsdS(N((Rt blankline((s!/usr/lib64/python2.6/formatter.pyt
end_paragraph*scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pytadd_line_break+scOsdS(N((Rtargstkw((s!/usr/lib64/python2.6/formatter.pyt add_hor_rule,scCsdS(N((RtformattcounterR((s!/usr/lib64/python2.6/formatter.pytadd_label_data-scCsdS(N((Rtdata((s!/usr/lib64/python2.6/formatter.pytadd_flowing_data.scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pytadd_literal_data/scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pytflush_softspace0scCsdS(N((Rtalign((s!/usr/lib64/python2.6/formatter.pytpush_alignment1scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pyt
pop_alignment2scCsdS(N((Rtx((s!/usr/lib64/python2.6/formatter.pyt push_font3scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pytpop_font4scCsdS(N((Rtmargin((s!/usr/lib64/python2.6/formatter.pyt push_margin5scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pyt
pop_margin6scCsdS(N((Rtspacing((s!/usr/lib64/python2.6/formatter.pyt set_spacing7scGsdS(N((Rtstyles((s!/usr/lib64/python2.6/formatter.pyt
push_style8sicCsdS(N((Rtn((s!/usr/lib64/python2.6/formatter.pyt pop_style9scCsdS(N((Rtflag((s!/usr/lib64/python2.6/formatter.pytassert_line_data:sN(t__name__t
__module__t__doc__RRRRR RRRRRRRRRRRRR!R#(((s!/usr/lib64/python2.6/formatter.pyRs&                  tAbstractFormattercBsÔeZdZd�Zd�Zd�Zd�Zdd�Zd�Z d�Z
d�Z d �Z d
�Z
d �Zd �Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zdd�ZRS(sêThe standard formatter.

This implementation has demonstrated wide applicability to many writers,
and may be used directly in most circumstances. It has been used to
implement a full-featured World Wide Web browser.

cCsy||_d|_g|_g|_g|_d|_g|_d|_d|_ d|_
d|_ d|_ d|_
dS(Nii(RRRt align_stackt
font_stackt margin_stackRt style_stacktnospacet softspacetpara_endtparskipt
hard_breakt
have_label(RR((s!/usr/lib64/python2.6/formatter.pyRKs            cCs�|ip|ii�d|_n|i|jo8|i o-|ii||i�||_d|_nd|_|_|_d|_dS(Nii( R0Rtsend_line_breakR1R/tsend_paragraphR,R.R-(RR((s!/usr/lib64/python2.6/formatter.pyRZs


 
cCsR|ip|ip!|ii�d|_|_nd|_|_d|_dS(Nii(R0R.RR2R1R/R,R-(R((s!/usr/lib64/python2.6/formatter.pyRes

cOs`|ip|ii�n|ii||�d|_|_d|_|_|_|_dS(Nii( R0RR2t
send_hor_ruleR,R1R.R-R/(RR R
((s!/usr/lib64/python2.6/formatter.pyR ls

cCsÄ|ip |i o|ii�n|ip"|ii|odpd�nt|t�o |ii|i ||��n|ii|�d|_
|_|_|_d|_ |_ dS(Nii(
R1R0RR2R.R3t
isinstancetstrtsend_label_datatformat_counterR,R-R/(RR R
R((s!/usr/lib64/python2.6/formatter.pyRss
" cCs´d}x§|D]�}|djo|d|}q
|djo+|djo||i||�}q¬q
|djo+|djo||i||�}q¬q
||}q
W|S(Ntt1s%dtaAitiI(t
format_lettert format_roman(RR R
tlabeltc((s!/usr/lib64/python2.6/formatter.pyR8s




cCsXd}xK|djo=t|dd�\}}tt|�|�}||}q W|S(NR9iii(tdivmodtchrtord(RtcaseR
R?Rts((s!/usr/lib64/python2.6/formatter.pyR=�s
c Csddddg}dddg}d\}}xÊ|d jo¼t|d
�\}}|d jo||||d |}no|d
jo|||||}nH|djo||}|d}nd}||||}||}|d }q0W|djo |i�S|S(NtiRR@tmtvtltdR9ii
i iiitI(R9i(RAtupper( RRDR
tonestfivesR?tindexRRE((s!/usr/lib64/python2.6/formatter.pyR>�s( 






 cCsó|pdS|d i�}|di�}di|i��}|io
| odS|p
|ioH|p%|ipd|_d|_ndS|ipd|}q±nd|_|_|_|_|_||_|i i
|�dS(Niiÿÿÿÿt i( tisspacetjointsplitR,R-R/R0R.R1Rtsend_flowing_data(RRtprespacet postspace((s!/usr/lib64/python2.6/formatter.pyR±s$
 

% cCsv|pdS|io|iid�n|ddj|_d|_|_|_|_|_|ii|�dS(NRPiÿÿÿÿs
i( R-RRTR0R,R.R/R1tsend_literal_data(RR((s!/usr/lib64/python2.6/formatter.pyRÅs
%cCsP|ioBd|_|_|_|_|_d|_|iid�ndS(NiiRP(R-R0R.R/R1R,RRT(R((s!/usr/lib64/python2.6/formatter.pyRÎs
% cCs[|o=||ijo-|ii|�||_|ii|�n|ii|i�dS(N(RRt
new_alignmentR(tappend(RR((s!/usr/lib64/python2.6/formatter.pyRÕs
 cCsg|io|id=n|io(|id|_}|ii|�nd|_|iid�dS(Niÿÿÿÿ(R(RRRXR(RR((s!/usr/lib64/python2.6/formatter.pyRÝs

 c
Cs |\}}}}|io4d|_|_|_d|_|iid�n|ioy|id\}}}} |tjo
|}n|tjo
|}n|tjo
|}n|tjo
| }qÓn||||f}|ii|�|ii |�dS(NiiRPiÿÿÿÿ(
R-R0R.R,RRTR)tAS_ISRYtnew_font(
RtfonttsizeRFtbttttcsizetcitcbtctt((s!/usr/lib64/python2.6/formatter.pyRçs$
 







cCsM|io|id=n|io|id}nd}|ii|�dS(Niÿÿÿÿ(R)RRR[(RR\((s!/usr/lib64/python2.6/formatter.pyR÷s 

cCs\|ii|�td|i�}| o|o|d}n|ii|t|��dS(Niÿÿÿÿ(R*RYtfilterRRt
new_margintlen(RRtfstack((s!/usr/lib64/python2.6/formatter.pyRs
cCsb|io|id=ntd|i�}|o|d}nd}|ii|t|��dS(Niÿÿÿÿ(R*RdRRReRf(RRgR((s!/usr/lib64/python2.6/formatter.pyRs
cCs||_|ii|�dS(N(RRt new_spacing(RR((s!/usr/lib64/python2.6/formatter.pyRs cGs||io4d|_|_|_d|_|iid�nx|D]}|ii|�qEW|iit |i��dS(NiiRP(
R-R0R.R,RRTR+RYt
new_stylesttuple(RRtstyle((s!/usr/lib64/python2.6/formatter.pyRs
 icCs(|i| 3|iit|i��dS(N(R+RRiRj(RR ((s!/usr/lib64/python2.6/formatter.pyR!s cCs,| |_|_d|_|_|_dS(Ni(R,R0R.R/R1(RR"((s!/usr/lib64/python2.6/formatter.pyR#"sN(R$R%R&RRRR RRR8R=R>RRRRRRRRRRRR!R#(((s!/usr/lib64/python2.6/formatter.pyR'=s,        
 
 RcBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Z d
�Z d �Z
d �Zd
�ZRS(sMinimal writer interface to use in testing & inheritance.

A writer which only provides the interface definition; no actions are
taken on any methods. This should be the base class for all writers
which do not need to inherit any implementation methods.

cCsdS(N((R((s!/usr/lib64/python2.6/formatter.pyR/scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pytflush0scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyRX1scCsdS(N((RR\((s!/usr/lib64/python2.6/formatter.pyR[2scCsdS(N((RRtlevel((s!/usr/lib64/python2.6/formatter.pyRe3scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyRh4scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyRi5scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyR36scCsdS(N((R((s!/usr/lib64/python2.6/formatter.pyR27scOsdS(N((RR R
((s!/usr/lib64/python2.6/formatter.pyR48scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyR79scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyRT:scCsdS(N((RR((s!/usr/lib64/python2.6/formatter.pyRW;s(R$R%R&RRlRXR[ReRhRiR3R2R4R7RTRW(((s!/usr/lib64/python2.6/formatter.pyR's            tAbstractWritercBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Z d
�Z d �Z
RS( s°A writer which can be used in debugging formatters, but not much else.

Each method simply announces itself by printing its name and
arguments on standard output.

cCsd|fGHdS(Nsnew_alignment(%r)((RR((s!/usr/lib64/python2.6/formatter.pyRXFscCsd|fGHdS(Ns new_font(%r)((RR\((s!/usr/lib64/python2.6/formatter.pyR[IscCsd||fGHdS(Nsnew_margin(%r, %d)((RRRm((s!/usr/lib64/python2.6/formatter.pyReLscCsd|fGHdS(Nsnew_spacing(%r)((RR((s!/usr/lib64/python2.6/formatter.pyRhOscCsd|fGHdS(Nsnew_styles(%r)((RR((s!/usr/lib64/python2.6/formatter.pyRiRscCsd|fGHdS(Nssend_paragraph(%r)((RR((s!/usr/lib64/python2.6/formatter.pyR3UscCs dGHdS(Nssend_line_break()((R((s!/usr/lib64/python2.6/formatter.pyR2XscOs dGHdS(Nssend_hor_rule()((RR R
((s!/usr/lib64/python2.6/formatter.pyR4[scCsd|fGHdS(Nssend_label_data(%r)((RR((s!/usr/lib64/python2.6/formatter.pyR7^scCsd|fGHdS(Nssend_flowing_data(%r)((RR((s!/usr/lib64/python2.6/formatter.pyRTascCsd|fGHdS(Nssend_literal_data(%r)((RR((s!/usr/lib64/python2.6/formatter.pyRWds(R$R%R&RXR[ReRhRiR3R2R4R7RTRW(((s!/usr/lib64/python2.6/formatter.pyRn>s          t
DumbWritercBsSeZdZd dd�Zd�Zd�Zd�Zd�Zd�Z d�Z
RS(
s;Simple writer class which writes output on the file object passed in
as the file parameter or, if file is omitted, on standard output. The
output is simply word-wrapped to the number of columns specified by
the maxcol parameter. This class is suitable for reflowing a sequence
of paragraphs.

iHcCs7|pti|_||_ti|�|i�dS(N(tsyststdouttfiletmaxcolRRtreset(RRrRs((s!/usr/lib64/python2.6/formatter.pyRqs 
cCsd|_d|_dS(Ni(tcoltatbreak(R((s!/usr/lib64/python2.6/formatter.pyRtws cCs*|iid|�d|_d|_dS(Ns
i(RrtwriteRuRv(RR((s!/usr/lib64/python2.6/formatter.pyR3{s cCs&|iid�d|_d|_dS(Ns
i(RrRwRuRv(R((s!/usr/lib64/python2.6/formatter.pyR2�s cOsM|iid�|iid|i�|iid�d|_d|_dS(Ns
t-i(RrRwRsRuRv(RR R
((s!/usr/lib64/python2.6/formatter.pyR4�s
 cCsv|ii|�|id�}|djod|_||d}n|i�}|it|�|_d|_dS(Ns
ii(RrRwtrfindRut
expandtabsRfRv(RRRF((s!/usr/lib64/python2.6/formatter.pyRW�s
  cCså|pdS|ip|di�}|i}|i}|ii}x~|i�D]p}|oC|t|�|jo|d�d}q¡|d�|d}n||�|t|�}d}qQW||_|di�|_dS(Nis
RPiiÿÿÿÿ(RvRQRuRsRrRwRSRf(RRRvRuRsRwtword((s!/usr/lib64/python2.6/formatter.pyRT�s&   





 N( R$R%R&RRRtR3R2R4RWRT(((s!/usr/lib64/python2.6/formatter.pyRohs    
cCs­t�}t|�}|dj ot|�}n/tidottid�}n
ti}x9|D]1}|djo|id�qg|i|�qgW|id�dS(Nis
i( RoR'RtopenRptargvtstdinRR(Rrtwtftfptline((s!/usr/lib64/python2.6/formatter.pyttest«s  
 
t__main__(((( R&RpRRZRR'RRnRoR�R$(((s!/usr/lib64/python2.6/formatter.pyt<module>s "ê*C