???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
fc           @   sù  d  Z  d Z d d l Z d d l Z d d l Z d d l Z y d d l Z Wn: e k
 rˆ d d d „  ƒ  YZ e ƒ  Z e j d IJn Xe j	 d ƒ Z
 e j	 d ƒ Z d	 „  Z d
 „  Z d „  Z d e j d Z y# e j e j d d ƒ \ Z Z Wn= e j k
 r5Z e j e IJe j e IJe j d ƒ n Xe j Z e Z xA e D]9 \ Z Z e d k rpe j Z qLe d k rLe Z qLqLWe s¬e j e IJe j d ƒ n  xF e j e e ƒ D]2 Z e r×d e GHn  e e ƒ Z  e  r¿e GHq¿q¿Wd S(   s_   List all those Python files that require a coding directive

Usage: nocoding.py dir1 [dir2...]
s   Oleg Broytmann, Georg BrandliÿÿÿÿNt   pysourcec           B   s   e  Z d Z Z Z d  „  Z RS(   c   	      o   s§   x  | D]˜ } t  j j | ƒ r0 | j d ƒ Vq t  j j | ƒ r xZ t  j | ƒ D]F \ } } } x4 | D], } | j d ƒ rh t  j j | | ƒ Vqh qh WqR Wq q Wd  S(   Ns   .py(   t   ost   patht   isfilet   endswitht   isdirt   walkt   join(	   t   selft   pathst   argst   kwargsR   t   roott   dirst   filest   filename(    (    s2   /usr/lib64/python2.7/Tools/scripts/findnocoding.pyt   walk_python_files   s    N(   t   __name__t
   __module__t   Nonet   has_python_extt   looks_like_pythont   can_be_compiledR   (    (    (    s2   /usr/lib64/python2.7/Tools/scripts/findnocoding.pyR       s   s^   The pysource module is not available; no sophisticated Python source file search will be done.s&   ^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s   ^[ \t\f]*(?:[#\r\n]|$)c         C   s&   t  j |  ƒ } | r" | j d ƒ Sd S(   Ni   t    (   t   decl_ret   matcht   group(   t   lineR   (    (    s2   /usr/lib64/python2.7/Tools/scripts/findnocoding.pyt   get_declaration&   s    c         C   s.   y t  |  | ƒ Wn t k
 r% t SXt Sd  S(   N(   t   unicodet   UnicodeDecodeErrort   Falset   True(   t   textt   codec(    (    s2   /usr/lib64/python2.7/Tools/scripts/findnocoding.pyt   has_correct_encoding,   s
    c         C   sª   y t  |  d ƒ } Wn t k
 r' d  SX| j ƒ  } | j ƒ  } t | ƒ sg t j | ƒ ru t | ƒ ru | j ƒ  t S| j	 ƒ  } | j ƒ  t
 | | | d ƒ r¦ t St S(   Nt   rUt   ascii(   t   opent   IOErrorR   t   readlineR   t   blank_reR   t   closeR   t   readR#   R    (   t   fullpatht   infilet   line1t   line2t   rest(    (    s2   /usr/lib64/python2.7/Tools/scripts/findnocoding.pyt   needs_declaration4   s    

sj   Usage: %s [-cd] paths...
    -c: recognize Python source files trying to compile them
    -d: debug outputi    i   t   cds   -cs   -ds   Testing for coding: %s(    (!   t   __doc__t
   __author__t   sysR   t   ret   getoptR    t   ImportErrort   stderrt   compileR   R)   R   R#   R1   t   argvt   usaget   optsR
   t   errort   msgt   exitR   t	   is_pythonR   t   debugt   ot   aR   R    R   R,   t   result(    (    (    s2   /usr/lib64/python2.7/Tools/scripts/findnocoding.pyt   <module>   sH   0				#	