ž ¬ÿf’,c@sôdZdZddlZddlZddlZddlZeedƒsZedƒ‚ndddgZda da d d „Z d d „Z Gd d„de ƒZdd„ZGdd„dƒZdd„Zdd„Zedkrðe ƒndS(u–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. u6iNuNLu4tokenize.NL doesn't exist -- tokenize module too olducheckuNannyNaguprocess_tokenscGsKd}x.|D]&}tjj|t|ƒƒd}q WtjjdƒdS(Nuu u (usysustderruwriteustr(uargsusepuarg((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyuerrprint#s   uerrprintcCsëy)tjtjdd…dƒ\}}Wn6tjk ra}zt|ƒdSWYdd}~XnXxF|D]>\}}|dkrŽtdan|dkritdaqiqiW|sÌtdtjddƒdSx|D]}t|ƒqÓWdS(Niuqvu-qu-vuUsage:iu[-v] file_or_directory ...(ugetoptusysuargvuerroruerrprintu filename_onlyuverboseucheck(uoptsuargsumsguouauarg((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyumain*s)     umaincBsJ|EeZdZdZdd„Zdd„Zdd„Zdd „Zd S( uNannyNagug Raised by tokeneater() if detecting an ambiguous indent. Captured and handled in check(). cCs!||||_|_|_dS(N(ulinenoumsguline(uselfulinenoumsguline((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyu__init__AsuNannyNag.__init__cCs|jS(N(ulineno(uself((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyu get_linenoCsuNannyNag.get_linenocCs|jS(N(umsg(uself((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyuget_msgEsuNannyNag.get_msgcCs|jS(N(uline(uself((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyuget_lineGsuNannyNag.get_lineN(u__name__u __module__u __qualname__u__doc__u__init__u get_linenouget_msguget_line(u __locals__((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyuNannyNag<s    c &CsÉtjj|ƒrÌtjj|ƒ rÌtr?td|fƒntj|ƒ}xw|D]o}tjj||ƒ}tjj|ƒr•tjj|ƒ s·tjj|dd…ƒdkrUt |ƒqUqUWdSyt j |ƒ}Wn=t k r}zt d||fƒdSWYdd}~XnXtdkr<td|ƒnzaytt j|jƒƒWn@t jk r›}zt d||fƒdSWYdd}~Xntk r×}zt d ||fƒdSWYdd}~XnÅtk r›}z¥|jƒ}|jƒ}tr?td ||fƒtd |fƒt|jƒƒnFd |kr\d |d }ntrot|ƒnt||t|ƒƒdSWYdd}~XnXWd|jƒXtrÅtd|fƒndS(u~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. u%r: listing directoryiNu.pyu%r: I/O Error: %siuchecking %r ...u%r: Token Error: %su%r: Indentation Error: %su)%r: *** Line %d: trouble in tab city! ***uoffending line: %ru u"u%r: Clean bill of health.iýÿÿÿ(uosupathuisdiruislinkuverboseuprintulistdirujoinunormcaseucheckutokenizeuopenuIOErroruerrprintuprocess_tokensugenerate_tokensureadlineu TokenErroruIndentationErroruNannyNagu get_linenouget_lineuget_msgu filename_onlyurepruclose( ufileunamesunameufullnameufumsgunagubadlineuline((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyucheckJsT % "      cBst|EeZdZd\ZZdd„Zdd„Zdd„Zdd „Zd d „Z d d „Z dd„Z dS(u Whitespaceu c Cs||_tjtj}}g}d}}}x¤|jD]™}||krc|d}|d}q:||krÒ|d}|d}|t|ƒkr·|dg|t|ƒd}n||d||su#format_witnesses..u at tab sizeiusu u, (ulenujoin(uwufirstsuprefix((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyuformat_witnesses s  uformat_witnessescCsŠ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| ƒ} |d j | ƒs‚|d j | ƒ} dt | ƒ}t | d|| ƒ‚q‚qIqIWdS( Nuiiuindent not greater e.g. uindent not equal e.g. iÿÿÿÿiÿÿÿÿiÿÿÿÿiÿÿÿÿiÿÿÿÿ(utokenizeuINDENTuDEDENTuNEWLINEuCOMMENTuNLu Whitespaceulessunot_less_witnessuformat_witnessesuNannyNaguappenduequalunot_equal_witness(utokensuINDENTuDEDENTuNEWLINEuJUNKuindentsu check_equalutypeutokenustartuendulineuthisguyuwitnessumsg((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyuprocess_tokenss6          u__main__(u__doc__u __version__uosusysugetoptutokenizeuhasattru ValueErroru__all__uverboseu filename_onlyuerrprintumainu ExceptionuNannyNaguchecku Whitespaceuformat_witnessesuprocess_tokensu__name__(((u-/opt/alt/python33/lib64/python3.3/tabnanny.pyu s&       =†  7