???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
fc           @  sÙ  d  d l  m Z d Z d Z e Z d  d l Z d  d l Z d  d l Z i  Z	 d  e	 d <e	 d <d! e	 d <e	 d	 <d" e	 d <d# e	 d
 <d e	 d <e	 d <e	 d <e	 d <e	 d <d$ e	 d <d% Z
 d d& d „  ƒ  YZ e j e j e e e d „ Z e j e j e e e d „ Z e j e j e e e d „ Z e e e d „ Z e e e d „ Z e e e d „ Z d „  Z e e e d „ Z e e e d „ Z e e e d „ Z d e ƒ  Z d „  Z d „  Z e d k rÕe ƒ  n  d S('   iÿÿÿÿ(   t   print_functioni   Nt   elift   elset   endt   ift   whilet   fort   exceptt   finallyt   tryt   witht   deft   classt   PythonIndenterc           B  sn   e  Z e j e j e e e d  „ Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(	   c         C  s|   | |  _  | |  _ | |  _ | |  _ d |  _ | |  _ | j |  _ t j	 d ƒ |  _
 t j	 d ƒ |  _ t j	 d ƒ |  _ d  S(   Ni    sC   ^(?:\s|\\\n)*(?P<kw>[a-z]+)((?:\s|\\\n)+(?P<id>[a-zA-Z_]\w*))?[^\w]sE   ^(?:\s|\\\n)*#?\s*end\s+(?P<kw>[a-z]+)(\s+(?P<id>[a-zA-Z_]\w*))?[^\w]s   ^[ \t]*(   t   fpit   fpot
   indentsizet   tabsizet   linenot
   expandtabst   writet   _writet   ret   compilet   kwprogt   endprogt   wsprog(   t   selfR   R   R   R   R   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   __init__f   s    						c         C  s6   |  j  r% |  j | j  |  j ƒ ƒ n |  j | ƒ d  S(   N(   R   R   R   (   R   t   line(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyR   z   s    	c         C  s+   |  j  j ƒ  } | r' |  j d 7_ n  | S(   Ni   (   R   t   readlineR   (   R   R   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyR   ‚   s     c         G  sE   | r | | } n  t  j j d |  j | f ƒ |  j d | ƒ d  S(   Ns   Error at line %d: %s
s   ### %s ###
(   t   syst   stderrR   R   (   R   t   fmtt   args(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   error‰   s     c         C  sG   |  j  ƒ  } x4 | d d k rB |  j  ƒ  } | s5 Pn  | | 7} q W| S(   Niþÿÿÿs   \
(   R   (   R   R   t   line2(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   getline   s     c         C  s{   t  | |  j |  j ƒ \ } } |  j j | ƒ j ƒ  } | | } | d  d k rj d | d | | } n  |  j | ƒ d  S(   Ni   s   
s   t    s   	t    (   s   
s   R&   (   t   divmodR   R   R   t   matchR   R   (   R   R   t   indentt   tabst   spacest   i(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   putline›   s    
c         C  sÀ  g  } xut  r}|  j ƒ  } | s% Pn  |  j j | ƒ } | rª d } | j d ƒ } | sh |  j d ƒ n& | j ƒ  d | k rŽ |  j d ƒ n  |  j | t | ƒ ƒ q	 n  |  j	 j | ƒ } | rd| j d ƒ } | t
 k r|  j | t | ƒ ƒ | j | | f ƒ q	 n  t j | ƒ rd| rd|  j | t | ƒ d ƒ | d \ } } | | f | d <q	 qdn  |  j | t | ƒ ƒ q	 W| r¼|  j d ƒ x( | D] \ } } |  j d	 | ƒ q˜Wn  d  S(
   NR   t   kws   unexpected endi    s   unmatched endi   iÿÿÿÿs   unterminated keywordss   	%s
(   t   TrueR%   R   R)   t   groupR#   t   popR.   t   lenR   t   startt   appendt   nextt   has_keyR   (   R   t   stackR   t   mR/   t   kw2t   kwat   kwb(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   reformat¥   s@    	 	c         C  sñ   d } d } x˜ t  r¦ |  j ƒ  } | s+ Pn  |  j j | ƒ } | rS | d 7} q n  |  j j | ƒ } | r– | j d ƒ } | t k r– | d 7} q– n  |  j | ƒ q W| | d k  rÊ t j	 j d ƒ n# | | d k rí t j	 j d ƒ n  d  S(   Ni    i   R/   s5   Warning: input contained more end tags than expected
s5   Warning: input contained less end tags than expected
(
   R0   R%   R   R)   R   R1   R4   R   R   R    (   R   t   begin_countert   end_counterR   R9   R/   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   deleteÐ   s(    	 
c         C  s\  g  } g  } d } } } } } x3t  rW|  j ƒ  } |  j j | ƒ j ƒ  }	 |  j j | ƒ }
 |
 rŽ d } |
 j d ƒ } |
 j d ƒ } n– |  j j | ƒ }
 |
 rô |
 j d ƒ } t j	 | ƒ sÍ d } n  | d k rë |
 j d ƒ } q$d } n0 | |	 |	 d !d k r| j
 | ƒ q% n d } | |	  } t | j |  j ƒ ƒ } t | j |  j ƒ ƒ } x‡ | | k  rç| r´| rŒd
 | | f } n
 d | } |  j | | ƒ d } } n  | j ƒ  \ } } } } t | j |  j ƒ ƒ } qaW| | k rŠ| rŠ| d k r/| | k r"|  j d ƒ n  d } } qŠ| sB| t k rŠ| r[d
 | | f } n
 d | } |  j | | ƒ d } } } qŠn  | | k rë| j
 | | | | f ƒ | rÊ| t k rÊd } n  | | | | f \ } } } } n  | r| t k r| } } | } q| } n  x | D] } |  j | ƒ q Wg  } | sGPn  |  j | ƒ q% Wd  S(   NR&   R   R/   t   idR   R   i   s   
t   #s   # end %s %s
s	   # end %s
s   mismatched end(   R   R   (   s   
RB   (   R0   R%   R   R)   R   R   R1   R   R6   R7   R5   R3   R   R   R   R2   R#   R4   (   R   R8   t   todot	   currentwst   thisidt   firstkwt   lastkwt   topidR   R-   R9   t   thiskwt   endkwt   indentwsR*   t   currentt   st   l(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   completeì   s€    			


	!
		  (   t   __name__t
   __module__R   t   stdint   stdoutt   STEPSIZEt   TABSIZEt
   EXPANDTABSR   R   R   R#   R%   R.   R=   R@   RO   (    (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyR   d   s   					
	+	c         C  s&   t  |  | | | | ƒ } | j ƒ  d  S(   N(   R   RO   (   t   inputt   outputt   stepsizeR   R   t   pi(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   complete_filterM  s    c         C  s&   t  |  | | | | ƒ } | j ƒ  d  S(   N(   R   R@   (   RW   RX   RY   R   R   RZ   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   delete_filterS  s    c         C  s&   t  |  | | | | ƒ } | j ƒ  d  S(   N(   R   R=   (   RW   RX   RY   R   R   RZ   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   reformat_filterY  s    c         C  sG   t  j |  ƒ } t  j ƒ  } t | | | | | ƒ } | j ƒ  | j ƒ  S(   N(   t   iot   BytesIOR   RO   t   getvalue(   t   sourceRY   R   R   RW   RX   RZ   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   complete_string_  s
    
c         C  sG   t  j |  ƒ } t  j ƒ  } t | | | | | ƒ } | j ƒ  | j ƒ  S(   N(   R^   R_   R   R@   R`   (   Ra   RY   R   R   RW   RX   RZ   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   delete_stringg  s
    
c         C  sG   t  j |  ƒ } t  j ƒ  } t | | | | | ƒ } | j ƒ  | j ƒ  S(   N(   R^   R_   R   R=   R`   (   Ra   RY   R   R   RW   RX   RZ   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   reformat_stringo  s
    
c         C  sÅ   d d  l  } d d  l } |  d } | j j | ƒ ry y | j | ƒ Wqy | j k
 ru t d | f d t j ƒqy Xn  y | j	 |  | ƒ Wn1 | j k
 rÀ t d |  | f d t j ƒn Xd  S(   Niÿÿÿÿt   ~s   Can't remove backup %rt   files   Can't rename %r to %r(
   t   ost   os.patht   patht   lexistst   removeR#   t   printR   R    t   rename(   t   filenameRg   t   backup(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   make_backupw  s    
!c         C  s|   t  |  d ƒ  } | j ƒ  } Wd  QXt | | | | ƒ } | | k rI d St |  ƒ t  |  d ƒ  } | j | ƒ Wd  QXd S(   Nt   ri    t   wi   (   t   opent   readRb   Rp   R   (   Rn   RY   R   R   t   fRa   t   result(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   complete_fileˆ  s     
c         C  s|   t  |  d ƒ  } | j ƒ  } Wd  QXt | | | | ƒ } | | k rI d St |  ƒ t  |  d ƒ  } | j | ƒ Wd  QXd S(   NRq   i    Rr   i   (   Rs   Rt   Rc   Rp   R   (   Rn   RY   R   R   Ru   Ra   Rv   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   delete_file–  s     
c         C  s|   t  |  d ƒ  } | j ƒ  } Wd  QXt | | | | ƒ } | | k rI d St |  ƒ t  |  d ƒ  } | j | ƒ Wd  QXd S(   NRq   i    Rr   i   (   Rs   Rt   Rd   Rp   R   (   Rn   RY   R   R   Ru   Ra   Rv   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   reformat_file¤  s     
sG  
usage: pindent (-c|-d|-r) [-s stepsize] [-t tabsize] [-e] [file] ...
-c         : complete a correctly indented program (add #end directives)
-d         : delete #end directives
-r         : reformat a completed program (use #end directives)
-s stepsize: indentation step (default %(STEPSIZE)d)
-t tabsize : the worth in spaces of a tab (default %(TABSIZE)d)
-e         : expand TABs into spaces (default OFF)
[file] ... : files are changed in place, with backups in file~
If no files are specified or a single - is given,
the program acts as a filter (reads stdin, writes stdout).
c         C  sE   t  j j d |  d | d d ƒ t  j j t ƒ t  j d ƒ d  S(   Ns    Error: You can not specify both s    and -i    s    at the same time
i   (   R   R    R   t   usaget   exit(   t   op1t   op2(    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt
   error_bothÁ  s    $c          C  s'  d d  l  }  y# |  j  t j d d ƒ \ } } WnG |  j k
 rx } t j j d | ƒ t j j t ƒ t j d ƒ n Xd  } t	 } t
 } t } xà | D]Ø \ } }	 | d k rÏ | rÆ t | | ƒ n  d } q˜ | d k rú | rñ t | | ƒ n  d	 } q˜ | d
 k r%| rt | | ƒ n  d } q˜ | d k r@t |	 ƒ } q˜ | d k r[t |	 ƒ } q˜ | d k r˜ t } q˜ q˜ W| sªt j j d ƒ t j j t ƒ t j d ƒ n  | sÀ| d g k rït | d ƒ } | t j t j | | | ƒ n4 t | d ƒ } x! | D] }
 | |
 | | | ƒ qWd  S(   Niÿÿÿÿi   s   cdrs:t:es
   Error: %s
i   s   -cRO   s   -dR@   s   -rR=   s   -ss   -ts   -es7   You must specify -c(omplete), -d(elete) or -r(eformat)
t   -t   _filtert   _file(   t   getoptR   t   argvR#   R    R   Rz   R{   t   NoneRT   RU   RV   R~   t   intR0   t   evalRR   RS   (   R‚   t   optsR"   t   msgt   actionRY   R   R   t   ot   aRn   (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   testÇ  sR    # 	 	 		t   __main__(   R   R   R   (   R   R   (   R   R   (   R   R   R   R   (    (   R   R   R   R	   R
   R   R   (    (   t
   __future__R    RT   RU   t   FalseRV   R^   R   R   R6   R4   R   RR   RS   R[   R\   R]   Rb   Rc   Rd   Rp   Rw   Rx   Ry   t   varsRz   R~   RŒ   RP   (    (    (    s-   /usr/lib64/python2.7/Tools/scripts/pindent.pyt   <module>O   sB   

*
é			3