Vc, dZddlZddlZddlZeeds edgdZdadadZ dZ Gdd e Z d Z Gd d Zd ZdZedkr e dSdS)6NNLz4tokenize.NL doesn't exist -- tokenize module too old)checkNannyNagprocess_tokenscd}|D]3}tj|t|zd}4tjddS)N  )sysstderrwritestr)argssepargs !/usr/lib64/python3.11/tabnanny.pyerrprintr"sY C s3xx(((JTcxddl} |tjddd\}}n'#|j$r}t |Yd}~dSd}~wwxYw|D]%\}}|dkr t dza|dkr t dza&|s#t dtjdddS|D]}t|dS)Nrqvz-qz-vzUsage:z[-v] file_or_directory ...)getoptr argverrorr filename_onlyverboser)roptsrmsgoars rmainr")sMMM]]38ABB<66 dd < ""1 9 .)A-M 9 "kG 38A;(DEEE c s+2 AAAc(eZdZ dZdZdZdZdS)rc2|||c|_|_|_dSN)linenorline)selfr&rr's r__init__zNannyNag.__init__Bs+13( TXtyyyrc|jSr%)r&r(s r get_linenozNannyNag.get_linenoDs {rc|jSr%)rr+s rget_msgzNannyNag.get_msgFs xrc|jSr%)r'r+s rget_linezNannyNag.get_lineHs yrN)__name__ __module__ __qualname__r)r,r.r0rrrr=sU===rrc~ tj|rtj|strt |dtj|}|D]}tj||}tj|rtj|r+tj|dddkrt|dS tj |}n,#t$r}t|d|Yd}~dSd}~wwxYwtdkrt d|z ttj|jn_#tj$r3}t|d|Yd}~|dSd}~wt&$r3}t|d|Yd}~|dSd}~wt($r}|}|}trHt d ||fzt d |t |nAd |vrd |zd z}t0rt |nt ||t3|Yd}~|dSd}~wwxYw |n#|wxYwtrt |d dSdS)Nz: listing directoryz.pyz : I/O Error: rzchecking %r ...z: Token Error: z: Indentation Error: z)%r: *** Line %d: trouble in tab city! ***zoffending line: r "z: Clean bill of health.)ospathisdirislinkrprintlistdirjoinnormcasertokenizeopenOSErrorrrgenerate_tokensreadline TokenErrorcloseIndentationErrorrr,r0r.rrepr) filenamesnamefullnamefrnagbadliner's rrrKsb w}}T 27>>$#7#7   5 TTT3 4 4 4 4    Dw||D$//H h'' GNN8,,   bcc++u4 h M$   cc2333{( $&'''x/ ;;<<<<  $$$4555(  % cc:;;;      ..""||~~  3 =wO P P P E$$0 1 1 1 #++-- d{ 33:#3D 3eDkkkkgtDzz222    =0   5 TTT34444455sm D"" E ,EE ,&FL K0#G7L  K0H 2L K0B8K+L +K00L LcBeZdZd\ZZdZdZdZdZdZ dZ dZ d S) Whitespacez c||_tjtj}}g}dx}x}}|jD]c}||kr |dz}|dz}||krJ|dz}|dz}|t |kr|dg|t |z dzzz}||dz||<d}c||_||_t||f|_t |dk|_ dS)Nrr) rawrQSTlennnttuplenorm is_simple) r(wsrTrUcountbrWrXchs rr)zWhitespace.__init__s|Z\1A(  BQw EEq E!VE ??!QC1s5zz>A+=$>>E 8a<a%LL!O UqrcV|j\}}tt|dz |SNr)rZmaxrV)r(r]trailings rlongest_run_of_spacesz Whitespace.longest_run_of_spacess')x3u::a<***rc|j\}}d}t|t|D]}|||z||zz}||||jzzzS)Nr)rZrangerVrX)r(tabsizer]rcilis r indent_levelzWhitespace.indent_levelsb)x wE ++ , ,Aaj58++BB'R$'\222rc"|j|jkSr%)rZ)r(others requalzWhitespace.equalsyEJ&&rcxt||dz}g}td|dzD]l}||||kr>||||||fm|Srarbrdrfrjappendr(rlrWr!tss rnot_equal_witnesszWhitespace.not_equal_witness **,,++-- / /12 3 1Q3-- 5 5B  $$(:(:2(>(>> 52,,R00 --b113555rc^|j|jkrdS|jr|jr|j|jkSt||dz}t d|dzD]1}||||krdS2dS)NFrT)rWr[rXrbrdrfrj)r(rlrWrrs rlesszWhitespace.lesss 6UW  5 > 'eo '7eh& & **,,++-- / /12 31Q3--  B  $$(:(:2(>(>> uu trcxt||dz}g}td|dzD]l}||||kr>||||||fm|Srarorqs rnot_less_witnesszWhitespace.not_less_witnessrtrN) r1r2r3rTrUr)rdrjrmrsrwryr4rrrQrQs DAq*)))2+++333.'''   0   "     rrQcd|D}d}t|dkr|dz}|dzd|zS)Nc3@K|]}t|dVdS)rN)r).0tups r z#format_witnesses..s, ' 'cc#a&kk ' ' ' ' ' 'rz at tab sizersr z, )rVr>)wfirstsprefixs rformat_witnessesrsP ' 'Q ' ' 'F F 1vvz# C<$))F++ ++rctj}tj}tj}tjtjf}t dg}d}|D] \}}} } } ||krd}||krd}t |} |d| sD|d| } dt| z}t| d|| | | ||krd}|d=|rt||vrpd}t | } |d | sD|d | } dt| z}t| d|| "dS)Nr rrzindent not greater e.g. zindent not equal e.g. )r@INDENTDEDENTNEWLINECOMMENTrrQrwryrrrprmrs)tokensrrrJUNKindents check_equaltypetokenstartendr'thisguywitnessrs rrrs _F _FG  X[ (D"~~GK+1,4,4'ueS$ 7?+ 4 KK V^# 4K ''G2;##G,, 4!"+66w??03CG3L3LLuQxd333 NN7 # # # # V^ 4K  4T- 4K &&G2;$$W-- 4!"+77@@.1A'1J1JJuQxd333Y,4,4r__main__) __version__r8r r@hasattr ValueError__all__rrrr" ExceptionrrrQrrr1r4rrrs7 $ wxM *K L LL 1 1 1  (     y   ;5;5;5zDDDDDDDDL,,,444444n z DFFFFF  r