;ò
òŒü?c           @   sÞ   d  Z  d Z d k Z d k Z d k Z d k Z e e d ƒ o e d ƒ ‚ n d d d g Z d a	 d a
 d	 „  Z d
 „  Z d e f d „  ƒ  YZ d „  Z d f  d „  ƒ  YZ d „  Z d „  Z e d j o e ƒ  n d S(   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.
s   6Ns   NLs4   tokenize.NL doesn't exist -- tokenize module too olds   checks   NannyNags   process_tokensi    c          G   sK   d } x. |  D]& } t i i | t | ƒ ƒ d } q Wt i i d ƒ d  S(   Ns    s    s   
(   s   seps   argss   args   syss   stderrs   writes   str(   s   argss   args   sep(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   errprint#   s     
c          C   sß   y# t  i  t i d d ƒ \ } } Wn& t  i j
 o } t | ƒ d  Sn XxJ | D]B \ } }  | d j o t
 d a
 n | d j o t d a qS qS W| o t d t i d d ƒ d  Sn x | D] } t | ƒ qÇ Wd  S(   Ni   s   qvs   -qs   -vs   Usage:i    s   [-v] file_or_directory ...(   s   getopts   syss   argvs   optss   argss   errors   msgs   errprints   os   as   filename_onlys   verboses   args   check(   s   as   argss   os   args   msgs   opts(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   main*   s$     #
	  c           B   s2   t  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   sg   
    Raised by tokeneater() if detecting an ambiguous indent.
    Captured and handled in check().
    c         C   s%   | | | f \ |  _  |  _ |  _ d  S(   N(   s   linenos   msgs   lines   self(   s   selfs   linenos   msgs   line(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   __init__A   s    c         C   s   |  i Sd  S(   N(   s   selfs   lineno(   s   self(    (    s%   /mit/python/lib/python2.3/tabnanny.pys
   get_linenoC   s    c         C   s   |  i Sd  S(   N(   s   selfs   msg(   s   self(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   get_msgE   s    c         C   s   |  i Sd  S(   N(   s   selfs   line(   s   self(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   get_lineG   s    (   s   __name__s
   __module__s   __doc__s   __init__s
   get_linenos   get_msgs   get_line(    (    (    s%   /mit/python/lib/python2.3/tabnanny.pys   NannyNag<   s
    			c   	      C   s;  t  i i |  ƒ o t  i i |  ƒ o¤ t o d |  GHn t  i |  ƒ } xu | D]m } t  i i	 |  | ƒ } t  i i | ƒ o t  i i | ƒ p t  i i | d ƒ d j o t | ƒ qR qR Wd Sn y t |  ƒ } Wn4 t j
 o( } t d |  t | ƒ f ƒ d Sn Xt d j o d G|  Gd GHn y t t i | i ƒ ƒ WnÔ t i j
 o( } t d	 |  t | ƒ f ƒ d SnŸ t j
 o’ } | i ƒ  } | i ƒ  } t o) d
 |  | f GHd G| GH| i ƒ  GHn> d |  j o d |  d }  n t o	 |  GHn |  G| G| GHd Sn Xt o d |  GHn d S(   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   %s: listing directoryiýÿÿÿs   .pyNs   %s: I/O Error: %si   s   checkings   ...s   %s: Token Error: %ss)   %s: *** Line %d: trouble in tab city! ***s   offending line:s    s   "s   %s: Clean bill of health.(    s   oss   paths   isdirs   files   islinks   verboses   listdirs   namess   names   joins   fullnames   normcases   checks   opens   fs   IOErrors   msgs   errprints   strs   process_tokenss   tokenizes   generate_tokenss   readlines
   TokenErrors   NannyNags   nags
   get_linenos   badlines   get_lines   lines   get_msgs   filename_only(	   s   files   names   fs   lines   nags   badlines   namess   msgs   fullname(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   checkJ   sL     ' D	
  		s
   Whitespacec           B   sS   t  Z d \ Z Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   Ns    	c   	      C   s"  | |  _ t i t i f \ } } g  } d } } } xª |  i D]Ÿ } | | j o | d } | d } q? | | j of | d } | d } | t | ƒ j o# | d g | t | ƒ d } n | | d | | <d } q? Pq? W| |  _ | |  _	 t | ƒ | f |  _ t | ƒ d j |  _ d  S(   Ni    i   (   s   wss   selfs   raws
   Whitespaces   Ss   Ts   counts   bs   ns   nts   chs   lens   tuples   norms	   is_simple(	   s   selfs   wss   counts   bs   ns   Ss   chs   Ts   nt(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   __init__˜   s*    	
 


#
		c         C   s*   |  i \ } } t t | ƒ d | ƒ Sd  S(   Ni   (   s   selfs   norms   counts   trailings   maxs   len(   s   selfs   counts   trailing(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   longest_run_of_spaces±   s    c         C   sb   |  i \ } } d } x3 t | t | ƒ ƒ D] } | | | | | } q+ W| | | |  i	 Sd  S(   Ni    (
   s   selfs   norms   counts   trailings   ils   ranges   tabsizes   lens   is   nt(   s   selfs   tabsizes   counts   is   trailings   il(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   indent_levelµ   s     c         C   s   |  i | i j Sd  S(   N(   s   selfs   norms   other(   s   selfs   other(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   equalÌ   s    c         C   s–   t  |  i ƒ  | i ƒ  ƒ d } g  } xf t d | d ƒ D]Q } |  i | ƒ | i | ƒ j o, | i	 | |  i | ƒ | i | ƒ f ƒ q9 q9 W| Sd  S(   Ni   (
   s   maxs   selfs   longest_run_of_spacess   others   ns   as   ranges   tss   indent_levels   append(   s   selfs   others   as   tss   n(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   not_equal_witnessÓ   s     0c         C   s¯   |  i | i j o t Sn |  i o | i o |  i | i j Sn t |  i ƒ  | i ƒ  ƒ d } xB t d | d ƒ D]- } |  i
 | ƒ | i
 | ƒ j o t Sqv qv Wt Sd  S(   Ni   i   (   s   selfs   ns   others   Falses	   is_simples   nts   maxs   longest_run_of_spacess   ranges   tss   indent_levels   True(   s   selfs   others   tss   n(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   lessë   s     c         C   s–   t  |  i ƒ  | i ƒ  ƒ d } g  } xf t d | d ƒ D]Q } |  i | ƒ | i | ƒ j o, | i	 | |  i | ƒ | i | ƒ f ƒ q9 q9 W| Sd  S(   Ni   (
   s   maxs   selfs   longest_run_of_spacess   others   ns   as   ranges   tss   indent_levels   append(   s   selfs   others   as   tss   n(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   not_less_witnessü   s     0(   s   __name__s
   __module__s   Ss   Ts   __init__s   longest_run_of_spacess   indent_levels   equals   not_equal_witnesss   lesss   not_less_witness(    (    (    s%   /mit/python/lib/python2.3/tabnanny.pys
   Whitespace   s   						c         C   sR   t  d „  |  ƒ } d } t |  ƒ d j o | d } n | d d i | ƒ Sd  S(   Nc         C   s   t  |  d ƒ S(   Ni    (   s   strs   tup(   s   tup(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   <lambda>  s    s   at tab sizei   s   ss    s   , (   s   maps   ws   firstss   prefixs   lens   join(   s   ws   prefixs   firsts(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   format_witnesses  s
    c         C   s™  t  i } t  i } t  i } t  i t  i f } t d ƒ g } d } xP|  D]H\ } } } } } | | j o
 d } qI | | j ou d } t | ƒ } | d i | ƒ o= | d i | ƒ }	 d t |	 ƒ }
 t | d |
 | ƒ ‚ n | i | ƒ qI | | j o d } | d =qI | o
 | | j oh d } t | ƒ } | d i | ƒ o= | d i | ƒ }	 d t |	 ƒ }
 t | d |
 | ƒ ‚ q‘qI qI Wd  S(   Ns    i    i   iÿÿÿÿs   indent not greater e.g. s   indent not equal e.g. (   s   tokenizes   INDENTs   DEDENTs   NEWLINEs   COMMENTs   NLs   JUNKs
   Whitespaces   indentss   check_equals   tokenss   types   tokens   starts   ends   lines   thisguys   lesss   not_less_witnesss   witnesss   format_witnessess   msgs   NannyNags   appends   equals   not_equal_witness(   s   tokenss   DEDENTs   JUNKs   INDENTs   thisguys   NEWLINEs   tokens   starts   indentss   witnesss   msgs   ends   lines   types   check_equal(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   process_tokens  s8    			 

s   __main__(   s   __doc__s   __version__s   oss   syss   getopts   tokenizes   hasattrs
   ValueErrors   __all__s   verboses   filename_onlys   errprints   mains	   Exceptions   NannyNags   checks
   Whitespaces   format_witnessess   process_tokenss   __name__(   s   mains
   Whitespaces   __all__s   process_tokenss   format_witnessess   checks   syss   NannyNags   tokenizes   getopts   errprints   __version__s   os(    (    s%   /mit/python/lib/python2.3/tabnanny.pys   ?   s&   							7†		7