MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //usr/local/ssl/local/ssl/lib/python2.4/Tools/scripts/reindent.pyc
mò
‚=5Dc@s¤dZdZdkZdkZdkZdadadadd„Z	d„Z
d„Zd„Zdd	„Z
d
fd„ƒYZd„Zed
joeƒndS(sËreindent [-d][-r][-v] [ path ... ]

-d (--dryrun)  Dry run.  Analyze, but don't make any changes to, files.
-r (--recurse) Recurse.  Search for all .py files in subdirectories too.
-v (--verbose) Verbose.  Print informative msgs; else no output.
-h (--help)    Help.     Print this usage information and exit.

Change Python (.py) files to use 4-space indents and no hard tab characters.
Also trim excess spaces and tabs from ends of lines, and remove empty lines
at the end of files.  Also ensure the last line ends with a newline.

If no paths are given on the command line, reindent operates as a filter,
reading a single source file from standard input and writing the transformed
source to standard output.  In this case, the -d, -r and -v flags are
ignored.

You can pass one or more file and/or directory paths.  When a directory
path, all .py files within the directory will be examined, and, if the -r
option is given, likewise recursively for subdirectories.

If output is not to standard output, reindent overwrites files in place,
renaming the originals with a .bak extension.  If it finds nothing to
change, the file is left alone.  If reindent does change a file, the changed
file is a fixed-point for future runs (i.e., running reindent on the
resulting .py file won't change it again).

The hard part of reindenting is figuring out what to do with comment
lines.  So long as the input files get a clean bill of health from
tabnanny.py, reindent should do a good job.
t1NicCs/|dj	oti|IJntitIJdS(N(tmsgtNonetsyststderrt__doc__(R((t,/usr/lib/python2.4/Tools/scripts/reindent.pytusage.s
cGsKd}x.|D]&}tii|t|ƒƒd}q
WtiidƒdS(Ntt s
(tseptargstargRRtwritetstr(RRR
((Rterrprint3s
cCs?dk}y2|itiddddddgƒ\}}Wn&|ij
o}t|ƒdSnXx|D]y\}}|djot
d7a
qk|djotd7aqk|djotd7aqk|djotƒdSqkqkW|p1t
tiƒ}|iƒ|itiƒdSnx|D]}t|ƒq'WdS(Nitdrvhtdryruntrecursetverbosethelps-ds--dryruns-rs	--recurses-vs	--verboses-hs--help(s-ds--dryrun(s-rs	--recurse(s-vs	--verbose(s-hs--help(tgetoptRtargvtoptsRterrorRRtotaRRRt
ReindentertstdintrtrunR
tstdoutRtcheck(RRRRRRRR((Rtmain:s6	
	




cCs!tii|ƒo·tii|ƒo£to
dG|GHnti|ƒ}xu|D]m}tii	||ƒ}to'tii|ƒotii|ƒp|iƒi
dƒot|ƒqQqQWdSntodG|GdGnyt|ƒ}Wn3tj
o'}td|t|ƒfƒdSnXt|ƒ}|iƒ|iƒoÃtodGHto	dGHqjntp˜|d}tii|ƒoti|ƒnti||ƒtod	G|Gd
G|GHnt|dƒ}|i|ƒ|iƒto
dG|GHq	qnto	d
GHndS(Nslisting directorys.pytcheckings...s%s: I/O Error: %sschanged.s+But this is a dry run, so leaving it alone.s.baktrenamedttotws	wrote news
unchanged.(tostpathtisdirtfiletislinkRtlistdirtnamestnametjointfullnameRtlowertendswithR topentftIOErrorRRRRRtcloseRRtbaktexiststremovetrenameR
(R)R-R3R6RR,RR/((RR UsL'
D	





s
 	cCsHt|ƒ}x1|djo#||d|jo|d8}qW|| S(sReturn line stripped of trailing spaces, tabs, newlines.

    Note that line.rstrip() instead also strips sundry control characters,
    but at least one known Emacs user expects to keep junk like that, not
    mentioning Barry by name or anything <wink>.
    iiN(tlentlinetitJUNK(R;R=R<((Rt_rstrips"RcBsStZd„Zd„Zd„Zd„Zeieiei	ei
eid„ZRS(NcCsd|_d|_|iƒ|_g}|iD]}|t|ƒi	ƒdq/~|_
|i
iddƒd|_
g|_dS(Niis
(tselft	find_stmttlevelR3t	readlinestrawt_[1]R;R>t
expandtabstlinestinsertRtindextstats(R?R3RDR;((Rt__init__s		7	cCs/ti|i|iƒ|i}x'|o|ddjo|iƒq"W|i}|it|ƒdfƒh}g}|_
|dd}
|i|d|
!ƒx|t
t|ƒdƒD]d}
||
\}}||
dd}	t||ƒ}|d}|djo8|o'|i|dƒ}|djosxpt|
dt|ƒdƒD]M}||\}}|djo*|t||ƒjo|d}nPqJqJWn|djomxjt|
dddƒD]N}||\}}|djo+|t||dƒt||ƒ}PqÃqÃWn|djo
|}q:q>d}n|djpt‚|||<||}|djp
|djo|i|||	!ƒq·x€|||	!D]q}|djo7|djo|i|ƒq|id||ƒq¦tt|ƒ|ƒ}
|i||
ƒq¦Wq·W|i|i
jS(Niÿÿÿÿs
iiiR	(ttokenizeR?tgetlinet
tokeneaterRFtpopRItappendR:t	have2wanttafterR<textendtrangetthisstmtt	thisleveltnextstmtt	getlspacethavetwanttgettxrangetjtjlinetjleveltAssertionErrortdiffR;tminR8RC(R?RXRYR`RIRTRPRQR;RVR<R\RFR8R^RUR]((RR¥sh		







&






cCs|i|iƒdS(N(R3t
writelinesR?RQ(R?R3((RR
êscCsF|it|iƒjo
d}n |i|i}|id7_|S(NRi(R?RHR:RFR;(R?R;((RRLîs

c
Csý|\}}||jo
d|_nÔ||jod|_|id7_n«||jod|_|id8_n‚||	jo(|io|i
i|dfƒqùnM||
jon<|io1d|_|o|i
i||ifƒqùndS(Niiÿÿÿÿi(tslinetscolttypetNEWLINER?R@tINDENTRAtDEDENTtCOMMENTRIROtNLR;(
R?Rettokent.6tendR;RgRhRfRiRjRcRd((RRM÷s"


	
	



	(
t__name__t
__module__RJRR
RLRKRgRhRfRiRjRM(((RRŽs
		E			cCsGdt|ƒ}}x-||jo||djo|d7}qW|S(NiR	i(R:R;R<tn(R;R<Rp((RRWs
t__main__(Rt__version__RKR&RRRRRRRR!R R>RRWRn(R!RWRR>RKRRRrR&R R((Rt?"s 						,