[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.22.240.163: ~ $
�
x��fc@s�dZddlZddlZddlZddlZdad�Zd�ZdZd�Z	d�Z
d	�Zd
�Zddd��YZ
d
�Zd�Zedkr�eje��ndS(s(fixdiv - tool to fix division operators.

To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'.
This runs the script `yourscript.py' while writing warning messages
about all uses of the classic division operator to the file
`warnings'.  The warnings look like this:

  <file>:<line>: DeprecationWarning: classic <type> division

The warnings are written to stderr, so you must use `2>' for the I/O
redirect.  I know of no way to redirect stderr on Windows in a DOS
box, so you will have to modify the script to set sys.stderr to some
kind of log file if you want to do this on Windows.

The warnings are not limited to the script; modules imported by the
script may also trigger warnings.  In fact a useful technique is to
write a test script specifically intended to exercise all code in a
particular module or set of modules.

Then run `python fixdiv.py warnings'.  This first reads the warnings,
looking for classic division warnings, and sorts them by file name and
line number.  Then, for each file that received at least one warning,
it parses the file and tries to match the warnings up to the division
operators found in the source code.  If it is successful, it writes
its findings to stdout, preceded by a line of dashes and a line of the
form:

  Index: <file>

If the only findings found are suggestions to change a / operator into
a // operator, the output is acceptable input for the Unix 'patch'
program.

Here are the possible messages on stdout (N stands for a line number):

- A plain-diff-style change ('NcN', a line marked by '<', a line
  containing '---', and a line marked by '>'):

  A / operator was found that should be changed to //.  This is the
  recommendation when only int and/or long arguments were seen.

- 'True division / operator at line N' and a line marked by '=':

  A / operator was found that can remain unchanged.  This is the
  recommendation when only float and/or complex arguments were seen.

- 'Ambiguous / operator (..., ...) at line N', line marked by '?':

  A / operator was found for which int or long as well as float or
  complex arguments were seen.  This is highly unlikely; if it occurs,
  you may have to restructure the code to keep the classic semantics,
  or maybe you don't care about the classic semantics.

- 'No conclusive evidence on line N', line marked by '*':

  A / operator was found for which no warnings were seen.  This could
  be code that was never executed, or code that was only executed
  with user-defined objects as arguments.  You will have to
  investigate further.  Note that // can be overloaded separately from
  /, using __floordiv__.  True division can also be separately
  overloaded, using __truediv__.  Classic division should be the same
  as either of those.  (XXX should I add a warning for division on
  user-defined objects, to disambiguate this case from code that was
  never executed?)

- 'Phantom ... warnings for line N', line marked by '*':

  A warning was seen for a line not containing a / operator.  The most
  likely cause is a warning about code executed by 'exec' or eval()
  (see note below), or an indirect invocation of the / operator, for
  example via the div() function in the operator module.  It could
  also be caused by a change to the file between the time the test
  script was run to collect warnings and the time fixdiv was run.

- 'More than one / operator in line N'; or
  'More than one / operator per statement in lines N-N':

  The scanner found more than one / operator on a single line, or in a
  statement split across multiple lines.  Because the warnings
  framework doesn't (and can't) show the offset within the line, and
  the code generator doesn't always give the correct line number for
  operations in a multi-line statement, we can't be sure whether all
  operators in the statement were executed.  To be on the safe side,
  by default a warning is issued about this case.  In practice, these
  cases are usually safe, and the -m option suppresses these warning.

- 'Can't find the / operator in line N', line marked by '*':

  This really shouldn't happen.  It means that the tokenize module
  reported a '/' operator but the line it returns didn't contain a '/'
  character at the indicated position.

- 'Bad warning for line N: XYZ', line marked by '*':

  This really shouldn't happen.  It means that a 'classic XYZ
  division' warning was read with XYZ being something other than
  'int', 'long', 'float', or 'complex'.

Notes:

- The augmented assignment operator /= is handled the same way as the
  / operator.

- This tool never looks at the // operator; no warnings are ever
  generated for use of this operator.

- This tool never looks at the / operator when a future division
  statement is in effect; no warnings are generated in this case, and
  because the tool only looks at files for which at least one classic
  division warning was seen, it will never look at files containing a
  future division statement.

- Warnings may be issued for code not read from a file, but executed
  using an exec statement or the eval() function.  These may have
  <string> in the filename position, in which case the fixdiv script
  will attempt and fail to open a file named '<string>' and issue a
  warning about this failure; or these may be reported as 'Phantom'
  warnings (see above).  You're on your own to deal with these.  You
  could make all recommended changes and add a future division
  statement to all affected files, and then re-run the test script; it
  should not issue any warnings.  If there are any, and you have a
  hard time tracking down where they are generated, you can use the
  -Werror option to force an error instead of a first warning,
  generating a traceback.

- The tool should be run from the same directory as that from which
  the original script was run, otherwise it won't be able to open
  files given by relative pathnames.
i����Nic
CsJy#tjtjdd�\}}Wn!tjk
rF}t|�dSXx>|D]6\}}|dkrotGHdS|dkrNdaqNqNW|s�td�dS|dr�tjjdtjd�nt	|d�}|dkr�dS|j�}|sd	G|dGHdS|j�d}x-|D]%}t
|||�}	|p?|	}qW|S(
Nithmis-hs-ms&at least one file argument is requireds!%s: extra file arguments ignored
is&No classic division warnings read from(tgetopttsystargvterrortusaget__doc__tmulti_oktstderrtwritetreadwarningstNonetkeystsorttprocess(
toptstargstmsgtotatwarningstfilestexittfilenametx((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pytmain�s:#






cCs[tjjdtjd|f�tjjdtjd�tjjdtjd�dS(Ns%s: %s
isUsage: %s [-m] warnings
s"Try `%s -h' for more information.
(RRR	R(R((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR�s!sL^(.+?):(\d+): DeprecationWarning: classic (int|long|float|complex) division$cCs!tjt�}yt|�}Wn(tk
rI}tjjd|�dSXi}x�|j�}|siPn|j	|�}|s�|j
d�dkrStjjd|�qSqSn|j�\}}}	|j|�}
|
dkr�g||<}
n|
jt|�t|	�f�qS|j�|S(Nscan't open: %s
tdivisionisWarning: ignored input (tretcompiletPATTERNtopentIOErrorRRR	treadlinetmatchtfindtgroupstgetRtappendtinttinterntclose(twarningsfiletprogtfRRtlinetmRtlinenotwhattlist((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR
�s."
cCs?ddGH|st�yt|�}Wn(tk
rO}tjjd|�dSXdG|GHt|�}|j�d}tj	|j
�}x�t|�\}}}	}
|dkr�Pn||ko�dk	ns�t�g}xE|t
|�kr"||d|kr"|j||�|d7}q�W|r9t||�ng}xE|t
|�kr�||d|kr�|j||�|d7}qBW|	r�|r�q�|	r�|r�t|	d�q�|r�|	r�t||�q�t
|	�dkr�ts�g}
d}x?|	D]7\\}}}||kr!q�n|
j|�|}q�W|
sDt�t
|
�dkrfdG|
dGHq�d	Gd
|
d|
dfGHq�ng}g}g}xY|D]Q\}}|dkr�|j|�q�|dkr�|j|�q�|j|�q�Wd}x0|	D](\\}}}||kr&qn|}t|�}|||d!dkrgd|GHdG|GHqn|r�d|G|GHdG|GHq|r�|r�d||fGHdG|GHdGHdG|| d||GHq|r�|r�d|GHdG|GHq|r|rddj|�dj|�|fGHdG|GHqqWq�|j�dS(Nt-iFscan't open: %s
isIndex:isNo conclusive evidences$*** More than one / operator in lines**** More than one / operator per statementsin lines %d-%di����R&tlongtfloattcomplext/s)*** Can't find the / operator in line %d:t*s*** Bad warning for line %d:s%dc%dt<s---t>s$True division / operator at line %d:t=s-*** Ambiguous / operator (%s, %s) at line %d:t|t?(sintslong(sfloatscomplex(tAssertionErrorRRRRR	tFileContextR
ttokenizetgenerate_tokensR tscanlineRtlenR%treportphantomwarningstreportRtchoptjoinR((RR0tfpRR+tindextgtstartlinenot	endlinenotslashestlineinfotorphansRtrowstlastrowtrowtcolR,tintlongtfloatcomplextbadR.R/((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR�s�		
"))



		

	
	!c	Cs�g}d}d}xF|D]>\}}||krJ|g}|j|�n|j|�qWxM|D]E}|d}dj|d�}d||fGH|j|dd�qbWdS(NiR5is$*** Phantom %s warnings for line %d:tmarkR6(RR%RERC(	RR+tblocksROt	lastblockRPR/tblocktwhats((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRB$s	

cCsZd}xM|D]E\\}}}||kr
d||fGHdGt|�GH|}q
q
WdS(Ns*** %s on line %d:R6(RRD(RKtmessageRORPRQR,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRC3sR=cBsJeZddd�Zd�Zd�Zd�Zd�Zd	dd�ZRS(
iicCs:||_d|_d|_d|_g|_g|_dS(Niii(RFtwindowR.teoflookaheadt	lookaheadtbuffer(tselfRFR[R.((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyt__init__<s					cCs_xXt|j�|jkrZ|jrZ|jj�}|sGd|_Pn|jj|�qWdS(Ni(RAR]R[R\RFR R%(R_R,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pytfillCs%	cCsL|j�|jsdS|jjd�}|jj|�|jd7_|S(Ntii(RaR]tpopR^R%R.(R_R,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR Js
	cCs|jt3dS(N(R^R[(R_((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyttruncateRscCs�|j�|jt|j�}|jt|j�}||koP|jknrd|j||S|j|ko~|knr�|j||jSt�dS(N(RaR.RAR^R]tKeyError(R_RGtbufstarttlookend((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyt__getitem__Ts
R6cCsn|dkr|}nxRt||d�D]=}y||}Wntk
rVd}nX|Gt|�GHq)WdS(Nis<missing line>(RtrangeReRD(R_tfirsttlastRUtiR,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRC]s	

N(	t__name__t
__module__R`RaR RdRhRRC(((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR=;s					c	Cs�g}d}d}xq|D]i\}}}}}|d}|dkrM|}n|dkro|j||f�n|tjkrPqqW|||fS(NiR5s/=(R5s/=(RR%R>tNEWLINE(	RHRKRIRJttypettokentstarttendR,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR@gs
	cCs|jd�r|d S|SdS(Ns
i����(tendswith(R,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRDust__main__((RRRRR>RRRRR
RRBRCR=R@RDRmR(((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyt<module>�s"	 			W		,		

Filemanager

Name Type Size Permission Actions
.analyze_dxp.pyo.40009 File 4.64 KB 0644
.byext.pyo.40009 File 4.42 KB 0644
.byteyears.pyo.40009 File 1.37 KB 0644
.checkappend.pyo.40009 File 4.77 KB 0644
.checkpyc.pyo.40009 File 1.93 KB 0644
.classfix.pyo.40009 File 4.09 KB 0644
.copytime.pyo.40009 File 937 B 0644
.crlf.pyo.40009 File 855 B 0644
.cvsfiles.pyo.40009 File 2.11 KB 0644
.db2pickle.pyo.40009 File 3.42 KB 0644
.diff.pyo.40009 File 2.29 KB 0644
.dutree.pyo.40009 File 2.18 KB 0644
.eptags.pyo.40009 File 1.83 KB 0644
.find_recursionlimit.pyo.40009 File 5.54 KB 0644
.finddiv.pyo.40009 File 3.22 KB 0644
.findlinksto.pyo.40009 File 1.39 KB 0644
.findnocoding.pyo.40009 File 3.03 KB 0644
.fixcid.pyo.40009 File 7.67 KB 0644
.fixheader.pyo.40009 File 1.44 KB 0644
.fixnotice.pyo.40009 File 3.42 KB 0644
.fixps.pyo.40009 File 969 B 0644
.ftpmirror.pyo.40009 File 10.81 KB 0644
.google.pyo.40009 File 792 B 0644
.gprof2html.pyo.40009 File 2.22 KB 0644
.h2py.pyo.40009 File 4.3 KB 0644
.hotshotmain.pyo.40009 File 1.82 KB 0644
.ifdef.pyo.40009 File 2.21 KB 0644
.lfcr.pyo.40009 File 880 B 0644
.linktree.pyo.40009 File 1.98 KB 0644
.lll.pyo.40009 File 947 B 0644
.logmerge.pyo.40009 File 4.96 KB 0644
.mailerdaemon.pyo.40009 File 7.19 KB 0644
.md5sum.pyo.40009 File 2.85 KB 0644
.methfix.pyo.40009 File 4.03 KB 0644
.mkreal.pyo.40009 File 1.93 KB 0644
.ndiff.pyo.40009 File 3.77 KB 0644
.nm2def.pyo.40009 File 2.89 KB 0644
.objgraph.pyo.40009 File 4.82 KB 0644
.parseentities.pyo.40009 File 2.03 KB 0644
.patchcheck.pyo.40009 File 7.24 KB 0644
.pathfix.pyo.40009 File 3.75 KB 0644
.pdeps.pyo.40009 File 3.14 KB 0644
.pickle2db.pyo.40009 File 3.73 KB 0644
.pindent.pyo.40009 File 11.3 KB 0644
.ptags.pyo.40009 File 1.37 KB 0644
.pysource.pyo.40009 File 3.92 KB 0644
.redemo.pyo.40009 File 5.16 KB 0644
.reindent-rst.pyo.40009 File 481 B 0644
.rgrep.pyo.40009 File 1.84 KB 0644
.serve.pyo.40009 File 1.56 KB 0644
.setup.pyo.40009 File 548 B 0644
.suff.pyo.40009 File 904 B 0644
.texcheck.pyo.40009 File 8.18 KB 0644
.texi2html.pyo.40009 File 81.37 KB 0644
.treesync.pyo.40009 File 5.85 KB 0644
.untabify.pyo.40009 File 1.55 KB 0644
.which.pyo.40009 File 1.59 KB 0644
.win_add2path.pyo.40009 File 2.02 KB 0644
.xxci.pyo.40009 File 3.93 KB 0644
analyze_dxp.py File 4.11 KB 0755
analyze_dxp.pyc File 4.64 KB 0644
analyze_dxp.pyo File 4.64 KB 0644
byext.py File 3.85 KB 0755
byext.pyc File 4.42 KB 0644
byext.pyo File 4.42 KB 0644
byteyears.py File 1.6 KB 0755
byteyears.pyc File 1.37 KB 0644
byteyears.pyo File 1.37 KB 0644
checkappend.py File 4.55 KB 0755
checkappend.pyc File 4.77 KB 0644
checkappend.pyo File 4.77 KB 0644
checkpyc.py File 1.96 KB 0755
checkpyc.pyc File 1.93 KB 0644
checkpyc.pyo File 1.93 KB 0644
classfix.py File 5.81 KB 0755
classfix.pyc File 4.09 KB 0644
classfix.pyo File 4.09 KB 0644
cleanfuture.py File 8.38 KB 0755
cleanfuture.pyc File 7.22 KB 0644
cleanfuture.pyo File 7.19 KB 0644
combinerefs.py File 4.28 KB 0755
combinerefs.pyc File 4.16 KB 0644
combinerefs.pyo File 4.12 KB 0644
copytime.py File 664 B 0755
copytime.pyc File 937 B 0644
copytime.pyo File 937 B 0644
crlf.py File 611 B 0755
crlf.pyc File 855 B 0644
crlf.pyo File 855 B 0644
cvsfiles.py File 1.75 KB 0755
cvsfiles.pyc File 2.11 KB 0644
cvsfiles.pyo File 2.11 KB 0644
db2pickle.py File 3.49 KB 0755
db2pickle.pyc File 3.42 KB 0644
db2pickle.pyo File 3.42 KB 0644
diff.py File 1.98 KB 0755
diff.pyc File 2.29 KB 0644
diff.pyo File 2.29 KB 0644
dutree.py File 1.58 KB 0755
dutree.pyc File 2.18 KB 0644
dutree.pyo File 2.18 KB 0644
eptags.py File 1.45 KB 0755
eptags.pyc File 1.83 KB 0644
eptags.pyo File 1.83 KB 0644
find_recursionlimit.py File 3.39 KB 0755
find_recursionlimit.pyc File 5.54 KB 0644
find_recursionlimit.pyo File 5.54 KB 0644
finddiv.py File 2.46 KB 0755
finddiv.pyc File 3.22 KB 0644
finddiv.pyo File 3.22 KB 0644
findlinksto.py File 1.04 KB 0755
findlinksto.pyc File 1.39 KB 0644
findlinksto.pyo File 1.39 KB 0644
findnocoding.py File 2.64 KB 0755
findnocoding.pyc File 3.03 KB 0644
findnocoding.pyo File 3.03 KB 0644
fixcid.py File 9.75 KB 0755
fixcid.pyc File 7.67 KB 0644
fixcid.pyo File 7.67 KB 0644
fixdiv.py File 13.57 KB 0755
fixdiv.pyc File 13.7 KB 0644
fixdiv.pyo File 13.62 KB 0644
fixheader.py File 1.16 KB 0755
fixheader.pyc File 1.44 KB 0644
fixheader.pyo File 1.44 KB 0644
fixnotice.py File 2.98 KB 0755
fixnotice.pyc File 3.42 KB 0644
fixnotice.pyo File 3.42 KB 0644
fixps.py File 894 B 0755
fixps.pyc File 969 B 0644
fixps.pyo File 969 B 0644
ftpmirror.py File 12.55 KB 0755
ftpmirror.pyc File 10.81 KB 0644
ftpmirror.pyo File 10.81 KB 0644
google.py File 520 B 0755
google.pyc File 792 B 0644
google.pyo File 792 B 0644
gprof2html.py File 2.12 KB 0755
gprof2html.pyc File 2.22 KB 0644
gprof2html.pyo File 2.22 KB 0644
h2py.py File 5.82 KB 0755
h2py.pyc File 4.3 KB 0644
h2py.pyo File 4.3 KB 0644
hotshotmain.py File 1.45 KB 0755
hotshotmain.pyc File 1.82 KB 0644
hotshotmain.pyo File 1.82 KB 0644
ifdef.py File 3.63 KB 0755
ifdef.pyc File 2.21 KB 0644
ifdef.pyo File 2.21 KB 0644
lfcr.py File 619 B 0755
lfcr.pyc File 880 B 0644
lfcr.pyo File 880 B 0644
linktree.py File 2.37 KB 0755
linktree.pyc File 1.98 KB 0644
linktree.pyo File 1.98 KB 0644
lll.py File 747 B 0755
lll.pyc File 947 B 0644
lll.pyo File 947 B 0644
logmerge.py File 5.45 KB 0755
logmerge.pyc File 4.96 KB 0644
logmerge.pyo File 4.96 KB 0644
mailerdaemon.py File 7.76 KB 0755
mailerdaemon.pyc File 7.19 KB 0644
mailerdaemon.pyo File 7.19 KB 0644
md5sum.py File 2.33 KB 0755
md5sum.pyc File 2.85 KB 0644
md5sum.pyo File 2.85 KB 0644
methfix.py File 5.33 KB 0755
methfix.pyc File 4.03 KB 0644
methfix.pyo File 4.03 KB 0644
mkreal.py File 1.59 KB 0755
mkreal.pyc File 1.93 KB 0644
mkreal.pyo File 1.93 KB 0644
ndiff.py File 3.72 KB 0755
ndiff.pyc File 3.77 KB 0644
ndiff.pyo File 3.77 KB 0644
nm2def.py File 2.39 KB 0755
nm2def.pyc File 2.89 KB 0644
nm2def.pyo File 2.89 KB 0644
objgraph.py File 5.88 KB 0755
objgraph.pyc File 4.82 KB 0644
objgraph.pyo File 4.82 KB 0644
parseentities.py File 1.68 KB 0755
parseentities.pyc File 2.03 KB 0644
parseentities.pyo File 2.03 KB 0644
patchcheck.py File 5.42 KB 0755
patchcheck.pyc File 7.24 KB 0644
patchcheck.pyo File 7.24 KB 0644
pathfix.py File 4.23 KB 0755
pathfix.pyc File 3.75 KB 0644
pathfix.pyo File 3.75 KB 0644
pdeps.py File 3.84 KB 0755
pdeps.pyc File 3.14 KB 0644
pdeps.pyo File 3.14 KB 0644
pickle2db.py File 3.85 KB 0755
pickle2db.pyc File 3.73 KB 0644
pickle2db.pyo File 3.73 KB 0644
pindent.py File 16.77 KB 0755
pindent.pyc File 11.3 KB 0644
pindent.pyo File 11.3 KB 0644
ptags.py File 1.2 KB 0755
ptags.pyc File 1.37 KB 0644
ptags.pyo File 1.37 KB 0644
pysource.py File 3.76 KB 0755
pysource.pyc File 3.92 KB 0644
pysource.pyo File 3.92 KB 0644
redemo.py File 5.66 KB 0755
redemo.pyc File 5.16 KB 0644
redemo.pyo File 5.16 KB 0644
reindent-rst.py File 278 B 0755
reindent-rst.pyc File 481 B 0644
reindent-rst.pyo File 481 B 0644
reindent.py File 10.58 KB 0755
reindent.pyc File 8.77 KB 0644
reindent.pyo File 8.74 KB 0644
rgrep.py File 1.46 KB 0755
rgrep.pyc File 1.84 KB 0644
rgrep.pyo File 1.84 KB 0644
serve.py File 1.12 KB 0755
serve.pyc File 1.56 KB 0644
serve.pyo File 1.56 KB 0644
setup.py File 421 B 0755
setup.pyc File 548 B 0644
setup.pyo File 548 B 0644
suff.py File 622 B 0755
suff.pyc File 904 B 0644
suff.pyo File 904 B 0644
svneol.py File 2.86 KB 0755
svneol.pyc File 2.83 KB 0644
svneol.pyo File 2.76 KB 0644
texcheck.py File 9.04 KB 0755
texcheck.pyc File 8.18 KB 0644
texcheck.pyo File 8.18 KB 0644
texi2html.py File 68.19 KB 0755
texi2html.pyc File 81.37 KB 0644
texi2html.pyo File 81.37 KB 0644
treesync.py File 5.65 KB 0755
treesync.pyc File 5.85 KB 0644
treesync.pyo File 5.85 KB 0644
untabify.py File 1.19 KB 0755
untabify.pyc File 1.55 KB 0644
untabify.pyo File 1.55 KB 0644
which.py File 1.59 KB 0755
which.pyc File 1.59 KB 0644
which.pyo File 1.59 KB 0644
win_add2path.py File 1.58 KB 0755
win_add2path.pyc File 2.02 KB 0644
win_add2path.pyo File 2.02 KB 0644
xxci.py File 2.73 KB 0755
xxci.pyc File 3.93 KB 0644
xxci.pyo File 3.93 KB 0644