tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
M\¬Qc@sådZdZddlZddlZddlZddlZeedƒsZedƒ‚ndddgZd    a    d    a
d
„Z d „Z de fd „ƒYZd „Zddd„ƒYZd„Zd„Zedkráe ƒndS(s–The Tab Nanny despises ambiguous indentation.  She knows no mercy.
 
tabnanny -- Detection of ambiguous indentation
 
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
 
Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
t6iÿÿÿÿNtNLs4tokenize.NL doesn't exist -- tokenize module too oldtchecktNannyNagtprocess_tokensicGsKd}x.|D]&}tjj|t|ƒƒd}q WtjjdƒdS(Ntt s
(tsyststderrtwritetstr(targstseptarg((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyterrprint#s
 
cCsÐy#tjtjddƒ\}}Wn!tjk
rF}t|ƒdSXxF|D]>\}}|dkrstdan|dkrNtdaqNqNW|s±tdtjddƒdSx|D]}t|ƒq¸WdS(Nitqvs-qs-vsUsage:is[-v] file_or_directory ...(tgetoptRtargvterrorRt filename_onlytverboseR(toptsR tmsgtotaR ((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytmain*s#
    cBs2eZdZd„Zd„Zd„Zd„ZRS(sg
    Raised by tokeneater() if detecting an ambiguous indent.
    Captured and handled in check().
    cCs!||||_|_|_dS(N(tlinenoRtline(tselfRRR((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyt__init__AscCs|jS(N(R(R((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyt
get_linenoCscCs|jS(N(R(R((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytget_msgEscCs|jS(N(R(R((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytget_lineGs(t__name__t
__module__t__doc__RRRR (((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyR<s
            c    Cs4tjj|ƒrÁtjj|ƒ rÁtr:d|fGHntj|ƒ}xq|D]i}tjj||ƒ}tjj|ƒrtjj|ƒ s¬tjj|dƒdkrPt|ƒqPqPWdSyt    |ƒ}Wn(t
k
rû}t d||fƒdSXtdkrd|GHnyt t j|jƒƒWnêt jk
r[}t d||fƒdStk
r‚}t d    ||fƒdStk
r}|jƒ}|jƒ}trØd
||fGHd |fGH|jƒGHn>d |krõd |d }ntr|GHn|G|Gt|ƒGHdSXtr0d|fGHndS(s~check(file_or_dir)
 
    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
    along the way. If file_or_dir is an ordinary Python source file, it is
    checked for whitespace related problems. The diagnostic messages are
    written to standard output using the print statement.
    s%r: listing directoryiýÿÿÿs.pyNs%r: I/O Error: %sischecking %r ...s%r: Token Error: %ss%r: Indentation Error: %ss)%r: *** Line %d: trouble in tab city! ***soffending line: %rRt"s%r: Clean bill of health.(tostpathtisdirtislinkRtlistdirtjointnormcaseRtopentIOErrorRRttokenizetgenerate_tokenstreadlinet
TokenErrortIndentationErrorRRR RRtrepr(    tfiletnamestnametfullnametfRtnagtbadlineR((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyRJsR
%       t
WhitespacecBsSeZd\ZZd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
RS(s     c    Cs||_tjtj}}g}d}}}x¤|jD]™}||krc|d}|d}q:||krÒ|d}|d}|t|ƒkr·|dg|t|ƒd}n||d||<d}q:Pq:W||_||_t|ƒ|f|_t|ƒdk|_    dS(Nii(
trawR;tStTtlentntntttupletnormt    is_simple(    RtwsR=R>tcounttbR@RAtch((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyR›s(     
 
 
"            cCs&|j\}}tt|ƒd|ƒS(Ni(RCtmaxR?(RRFttrailing((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytlongest_run_of_spaces´scCs^|j\}}d}x3t|t|ƒƒD]}|||||}q+W||||jS(Ni(RCtrangeR?RA(RttabsizeRFRJtilti((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyt indent_level¸s
cCs|j|jkS(N(RC(Rtother((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytequalÏscCst|jƒ|jƒƒd}g}xdtd|dƒD]O}|j|ƒ|j|ƒkr9|j||j|ƒ|j|ƒfƒq9q9W|S(Ni(RIRKRLRPtappend(RRQR@Rtts((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytnot_equal_witnessÖs      cCs›|j|jkrtS|jr8|jr8|j|jkSt|jƒ|jƒƒd}x=td|dƒD](}|j|ƒ|j|ƒkrktSqkWtS(Nii(    R@tFalseRDRARIRKRLRPtTrue(RRQR@RT((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytlessîs cCst|jƒ|jƒƒd}g}xdtd|dƒD]O}|j|ƒ|j|ƒkr9|j||j|ƒ|j|ƒfƒq9q9W|S(Ni(RIRKRLRPRS(RRQR@RRT((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytnot_less_witnessÿs      ( R!R"R=R>RRKRPRRRURXRY(((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyR;„s                         cCsLtd„|ƒ}d}t|ƒdkr7|d}n|ddj|ƒS(NcSst|dƒS(Ni(R
(ttup((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyt<lambda> ss at tab sizeitsRs, (tmapR?R*(twtfirststprefix((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pytformat_witnesses
s
 cCsŠtj}tj}tj}tjtjf}tdƒg}d}xA|D]9\}}}    }
} ||krsd}qI||krðd}t|ƒ} |dj| ƒsà|dj| ƒ} dt    | ƒ}t
|    d|| ƒ‚n|j | ƒqI||kr d}|d=qI|rI||krId}t| ƒ} |dj | ƒs‚|dj | ƒ} dt    | ƒ}t
|    d|| ƒ‚q‚qIqIWdS(NRiiiÿÿÿÿsindent not greater e.g. sindent not equal e.g. (R.tINDENTtDEDENTtNEWLINEtCOMMENTRR;RXRYRaRRSRRRU(ttokensRbRcRdtJUNKtindentst check_equalttypettokentstarttendRtthisguytwitnessR((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyRs6                   
 
 t__main__((R#t __version__R%RRR.thasattrt
ValueErrort__all__RRRRt    ExceptionRRR;RaRR!(((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/tabnanny.pyt<module> s&                :†        7