ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
fc           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z e j	 j
 d d d  e j	 j
 d d d  e j	 j
 d d d  e j	 j
 d d  e j	 j
 d d  g Z e j d	  Z d
   Z e d d  Z d   Z d   Z e d d d   d    Z e d d d   d d   Z d   Z e d d e d    Z e d d e d    Z e  j d  Z e d d e d    Z e d d e d    Z e d  d e d!    Z e d" d e d#    Z d$   Z  e! d% k re    n  d S(&   iNt   Modulest   _ctypest   libffit
   libffi_osxt   libffi_msvct   expatt   zlibt   srcdirc         C   s"   d j  |  |  d k r d n d  S(   s7   Return 'N file(s)' with the proper plurality on 'file'.s	   {} file{}i   t   st    (   t   format(   t   count(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   n_files_str   s    c            s       f d   } | S(   s*   Decorator to output status info to stdout.c            s        f d   } | S(   Nc             so   t  j j  d  t  j j     |  |   }  rF  rF d GHn%  rZ  |  GHn | rf d n d GH| S(   Ns    ... t   donet   yest   NO(   t   syst   stdoutt   writet   flush(   t   argst   kwargst   result(   t   fxnt   infot   messaget   modal(    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   call_fxn   s    (    (   R   R   (   R   R   R   (   R   s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   decorated_fxn   s    (    (   R   R   R   R   (    (   R   R   R   s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   status   s    c          C   sB   d j    }  y t j |  d t j SWn t j k
 r= d SXd S(   s0   Get the symbolic name for the current git branchs   git rev-parse --abbrev-ref HEADt   stderrN(   t   splitt
   subprocesst   check_outputt   PIPEt   CalledProcessErrort   None(   t   cmd(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   get_git_branch.   s
    c          C   sB   d j    }  y t j |  d t j Wn t j k
 r= d SXd S(   sk   Get the remote name to use for upstream branches

    Uses "upstream" if it exists, "origin" otherwise
    s   git remote get-url upstreamR   t   origint   upstream(   R   R    R!   R"   R#   (   R%   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   get_git_upstream_remote7   s    s   Getting base branch for PRR   c         C   s   |  d  k	 r |  Sd S(   Ns   not a PR branch(   R$   (   t   x(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   <lambda>E   R	   c          C   s   t  j j t  j j t d   s% d  St j }  |  j d k rF d } n d j	 |   } t
   } | d  k sv | | k rz d  St   } | d | S(   Ns   .gitt   alphat   masters   {0.major}.{0.minor}t   /(   t   ost   patht   existst   joint   SRCDIRR$   R   t   version_infot   releaselevelR
   R&   R)   (   t   versiont   base_brancht   this_brancht   upstream_remote(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   get_base_branchD   s    !				s6   Getting the list of files that have been added/changedc         C   s   t  t |    S(   N(   R   t   len(   R*   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyR+   X   R	   c            sv  t  j j t  j j t d   r|  r4 d |  } n d } g  } t j | j   d t j } z x | j	 D] } | j
   j   } | j d	 d  \ }   t |  } | j d  s qk n  d   k r   j d d  d j     n  | j    qk WWd	 | j	 j   Xn t j d
  g  } xO | D]G   t  j j      t   f d   t D  raq'n  | j    q'W| S(   s0   Get the list of changed or added files from git.s   .gits   git diff --name-status s   git status --porcelainR   i   t   MAUs    -> i   Ns)   need a git checkout to get modified filesc         3   s   |  ] }   j  |  Vq d  S(   N(   t
   startswith(   t   .0R0   (   t   filename(    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pys	   <genexpr>z   s    (   R/   R0   R1   R2   R3   R    t   PopenR   R"   R   t   decodet   rstripR$   t   sett   intersectiont   stript   appendt   closeR   t   exitt   normpatht   anyt   EXCLUDE_DIRS(   R7   R%   t	   filenamest   stt   linet   status_textR   t
   filenames2(    (   R?   s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   changed_filesW   s2    !c         C   sr   t  |   } | d k r" t |  Sd j t |   g } x$ |  D] } | j d j |   qA Wd j |  Sd  S(   Ni    s   {}:s     {}s   
(   R;   R   R
   RF   R2   (   t
   file_pathsR   t   linesR0   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   report_modified_files   s    
s   Fixing whitespacec         C   s\   t  t _ g  } xF d   |  D D]4 } t j t j j t |   r  | j |  q  q  W| S(   sA   Make sure that the whitespace for .py files have been normalized.c         s   s$   |  ] } | j  d   r | Vq d S(   s   .pyN(   t   endswith(   R>   R*   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pys	   <genexpr>   s    (	   t   Falset   reindentt
   makebackupt   checkR/   R0   R2   R3   RF   (   RR   t   fixedR0   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   normalize_whitespace   s    	s   Fixing C file whitespacec         C   s   g  } xv |  D]n } t  j j t |  } t | d   } d | j   k rR w n  Wd QXt j | d d t | j	 |  q W| S(   s   Report if any C files t   rs   	Ni   t   verbose(
   R/   R0   R2   R3   t   opent   readt   untabifyt   processRV   RF   (   RR   RZ   R0   t   abspatht   f(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   normalize_c_whitespace   s    s   \s+(\r?\n)$s   Fixing docs whitespacec   	      C   s   g  } x |  D] } t  j j t |  } y t | d   } | j   } Wd  QXg  | D] } t j d |  ^ qV } | | k r t j	 | | d  t | d   } | j
 |  Wd  QX| j |  n  Wq t k
 r } d | | f GHq Xq W| S(   Nt   rbs   \1s   .bakt   wbs   Cannot fix %s: %s(   R/   R0   R2   R3   R^   t	   readlinest   ws_ret   subt   shutilt   copyfilet
   writelinesRF   t	   Exception(	   RR   RZ   R0   Rb   Rc   RS   RN   t	   new_linest   err(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   normalize_docs_whitespace   s    %s   Docs modifiedR   c         C   s
   t  |   S(   s9   Report if any file in the Doc directory has been changed.(   t   bool(   RR   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   docs_modified   s    s   Misc/ACKS updatedc         C   s   t  j j d d  |  k S(   s$   Check if Misc/ACKS has been changed.t   Misct   ACKS(   R/   R0   R2   (   RR   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   credit_given   s    s    Misc/NEWS.d updated with `blurb`c         C   s   t  d   |  D  S(   s&   Check if Misc/NEWS.d has been changed.c         s   s0   |  ]& } | j  t j j d  d d   Vq d S(   Rs   s   NEWS.dt   nextN(   R=   R/   R0   R2   (   R>   t   p(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pys	   <genexpr>   s   (   RJ   (   RR   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   reported_news   s    	c          C   s  t    }  t |   } g  | D] } | j d  r | ^ q } g  | D] } | j d  rD | ^ qD } g  | D]* } | j d  rl | j d  rl | ^ ql } d   | D } t |  t |  t |  t |  t |  t	 |  | s | r| r d n d	 } Hd
 | GHn  d  S(   Ns   .pys   .cs   .ht   Docs   .rsts   .incc         S   s%   h  |  ] } | j  d   r |  q S(   Rs   (   R=   (   R>   Rw   (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pys	   <setcomp>   s   	 s    and check for refleaks?t   ?s   Did you run the test suite(   s   .cs   .h(   s   .rsts   .inc(
   R:   RQ   RU   R=   R[   Rd   Rp   Rr   Ru   Rx   (   R7   RR   t   fnt   python_filest   c_filest	   doc_filest
   misc_filest   end(    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   main   s"    	((





t   __main__("   t   reR   Rj   t   os.pathR/   R    t	   sysconfigRW   R`   R0   R2   RK   t   get_config_varR3   R   RV   R$   R   R&   R)   R:   RQ   RT   R[   Rd   t   compileRh   Rp   t   TrueRr   Ru   Rx   R   t   __name__(    (    (    s0   /usr/lib64/python2.7/Tools/scripts/patchcheck.pyt   <module>   sB   							)		