
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
ó
{fc           @€  sÞ  d  Z  d d l m Z d 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
 d d l m Z d d l m Z m Z m Z d d l m Z d d	 l m Z m Z d d
 l m Z d d l m Z e d „ Z d e f d „  ƒ  YZ d „  Z d „  Z d „  Z  d „  Z! e j" d d f k  rgd d l# Z# e# j$ Z% d „  Z& d „  Z' n e$ Z% e! Z& e! Z' d „  Z( d e f d „  ƒ  YZ) d e* f d „  ƒ  YZ+ d e f d „  ƒ  YZ, d e+ f d „  ƒ  YZ- d S(    sÛ   Refactoring framework.

Used as a main program, this can refactor any number of files and/or
recursively descend down directories.  Imported as a module, this
provides infrastructure to write your own refactoring tool.
iÿÿÿÿ(   t   with_statements#   Guido van Rossum <guido@python.org>N(   t   chaini   (   t   drivert   tokenizet   token(   t	   find_root(   t   pytreet   pygram(   t	   btm_utils(   t   btm_matcherc         C€  sz   t  |  g  g  d g ƒ } g  } xU t j | j ƒ D]A \ } } } | j d ƒ r1 | rb | d } n  | j | ƒ q1 q1 W| S(   sE   Return a sorted list of all available fix names in the given package.t   *t   fix_i   (   t
   __import__t   pkgutilt   iter_modulest   __path__t
   startswitht   append(   t	   fixer_pkgt   remove_prefixt   pkgt	   fix_namest   findert   namet   ispkg(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   get_all_fix_names"   s    "t
   _EveryNodec           B€  s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR   .   s   c         C€  sß   t  |  t j t j f ƒ rC |  j d k r3 t ‚ n  t |  j g ƒ St  |  t j ƒ rt |  j	 rk t
 |  j	 ƒ St ‚ n  t  |  t j ƒ rË t ƒ  } x5 |  j	 D]* } x! | D] } | j t
 | ƒ ƒ q¦ Wq™ W| St d |  ƒ ‚ d S(   sf    Accepts a pytree Pattern Node and returns a set
        of the pattern types which will match first. s$   Oh no! I don't understand pattern %sN(   t
   isinstanceR   t   NodePatternt   LeafPatternt   typet   NoneR   t   sett   NegatedPatternt   contentt   _get_head_typest   WildcardPatternt   updatet	   Exception(   t   patt   rt   pt   x(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR%   2   s    				c         C€  s  t  j t ƒ } g  } x£ |  D]› } | j r„ y t | j ƒ } Wn t k
 r^ | j | ƒ q· XxU | D] } | | j | ƒ qf Wq | j d k	 rª | | j j | ƒ q | j | ƒ q Wx: t	 t
 j j j ƒ  t
 j j ƒ D] } | | j | ƒ qÝ Wt | ƒ S(   s^    Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.  N(   t   collectionst   defaultdictt   listt   patternR%   R   R   t   _accept_typeR!   R   R   t   python_grammart   symbol2numbert
   itervaluest   tokenst   extendt   dict(   t
   fixer_listt
   head_nodest   everyt   fixert   headst	   node_type(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   _get_headnode_dictN   s"    	c         C€  s(   g  t  |  t ƒ D] } |  d | ^ q S(   sN   
    Return the fully qualified names for fixers in the package pkg_name.
    t   .(   R   t   False(   t   pkg_namet   fix_name(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   get_fixers_from_packageg   s    c         C€  s   |  S(   N(    (   t   obj(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt	   _identityn   s    i   i    c         C€  s   |  j  d d ƒ S(   Nu   
u   
(   t   replace(   t   input(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   _from_system_newlinesu   s    c         C€  s*   t  j d k r" |  j d t  j ƒ S|  Sd  S(   Ns   
u   
(   t   ost   linesepRF   (   RG   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   _to_system_newlinesw   s    c         €  sà  t  } t j t j |  ƒ j ƒ ‰  ‡  f d †  } t t j t j t j	 f ƒ } t
 ƒ  } ykxdt rÀ| ƒ  \ } } | | k r„ q] q] | t j k r¦ | r� Pn  t } q] | t j k r¼| d k r¼| ƒ  \ } } | t j k së | d k rï Pn  | ƒ  \ } } | t j k s| d k rPn  | ƒ  \ } } | t j k rY| d k rY| ƒ  \ } } n  xa | t j k r¸| j | ƒ | ƒ  \ } } | t j k s¢| d k r¦Pn  | ƒ  \ } } q\Wq] Pq] WWn t k
 rÕn Xt | ƒ S(   Nc          €  s   ˆ  j  ƒ  }  |  d |  d f S(   Ni    i   (   t   next(   t   tok(   t   gen(    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   advance…   s    u   fromu
   __future__u   importu   (u   ,(   R@   R   t   generate_tokenst   StringIOt   readlinet	   frozensetR   t   NEWLINEt   NLt   COMMENTR"   t   Truet   STRINGt   NAMEt   OPt   addt   StopIteration(   t   sourcet   have_docstringRO   t   ignoret   featurest   tpt   value(    (   RN   s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   _detect_future_features‚   sD    				t
   FixerErrorc           B€  s   e  Z d  Z RS(   s   A fixer could not be loaded.(   R   R   t   __doc__(    (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRd   ª   s   t   RefactoringToolc           B€  s!  e  Z i e d  6e d 6Z d Z d Z d d d „ Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z e e d
 „ Z e e d „ Z d „  Z e e d „ Z d „  Z e d „ Z d „  Z d „  Z d e d d „ Z d d „ Z d Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   t   print_functiont   write_unchanged_filest   FixR   c         C€  sÄ  | |  _  | p g  |  _ |  j j ƒ  |  _ | d k	 rI |  j j | ƒ n  |  j d re t j |  _	 n t j
 |  _	 |  j j d ƒ |  _ g  |  _ t j d ƒ |  _ g  |  _ t |  _ t j |  j	 d t j d |  j ƒ|  _ |  j ƒ  \ |  _ |  _ g  |  _ t j ƒ  |  _ g  |  _ g  |  _  x} t! |  j |  j ƒ D]f } | j" rT|  j j# | ƒ q2| |  j k rv|  j j$ | ƒ q2| |  j k r2|  j  j$ | ƒ q2q2Wt% |  j ƒ |  _& t% |  j  ƒ |  _' d S(   sÑ   Initializer.

        Args:
            fixer_names: a list of fixers to import
            options: a dict with configuration.
            explicit: a list of fixers to run even if they are explicit.
        Rg   Rh   Rf   t   convertt   loggerN((   t   fixerst   explicitt   _default_optionst   copyt   optionsR!   R'   R   t!   python_grammar_no_print_statementt   grammarR2   t   getRh   t   errorst   loggingt	   getLoggerRk   t	   fixer_logR@   t   wroteR   t   DriverR   Rj   t
   get_fixerst	   pre_ordert
   post_ordert   filest   bmt   BottomMatchert   BMt   bmi_pre_ordert   bmi_post_orderR   t   BM_compatiblet	   add_fixerR   R>   t   bmi_pre_order_headst   bmi_post_order_heads(   t   selft   fixer_namesRp   Rm   R;   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   __init__¶   s<    									c         C€  sÝ  g  } g  } x•|  j  D]Š} t | i  i  d g ƒ } | j d d ƒ d } | j |  j ƒ rr | t |  j ƒ } n  | j d ƒ } |  j d j g  | D] } | j	 ƒ  ^ q” ƒ } y t
 | | ƒ }	 Wn' t k
 rì t d | | f ƒ ‚ n X|	 |  j |  j ƒ }
 |
 j r?|  j t k	 r?| |  j k r?|  j d | ƒ q n  |  j d	 | ƒ |
 j d
 k rn| j |
 ƒ q |
 j d k r�| j |
 ƒ q t d |
 j ƒ ‚ q Wt j d ƒ } | j d | ƒ | j d | ƒ | | f S(   s  Inspects the options to load the requested patterns and handlers.

        Returns:
          (pre_order, post_order), where pre_order is the list of fixers that
          want a pre-order AST traversal, and post_order is the list that want
          post-order traversal.
        R
   R?   i   iÿÿÿÿt   _t    s   Can't find %s.%ss   Skipping optional fixer: %ss   Adding transformation: %st   pret   posts   Illegal fixer order: %rt	   run_ordert   key(   Rl   R   t   rsplitR   t   FILE_PREFIXt   lent   splitt   CLASS_PREFIXt   joint   titlet   getattrt   AttributeErrorRd   Rp   Rw   Rm   RW   t   log_messaget	   log_debugt   orderR   t   operatort
   attrgettert   sort(   R‡   t   pre_order_fixerst   post_order_fixerst   fix_mod_patht   modRB   t   partsR+   t
   class_namet	   fix_classR;   t   key_func(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRz   ê   s8    /c         O€  s   ‚  d S(   s   Called when an error occurs.N(    (   R‡   t   msgt   argst   kwds(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt	   log_error  s    c         G€  s'   | r | | } n  |  j  j | ƒ d S(   s   Hook to log a message.N(   Rk   t   info(   R‡   R§   R¨   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR™     s    c         G€  s'   | r | | } n  |  j  j | ƒ d  S(   N(   Rk   t   debug(   R‡   R§   R¨   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRš     s    c         C€  s   d S(   sT   Called with the old version, new version, and filename of a
        refactored file.N(    (   R‡   t   old_textt   new_textt   filenamet   equal(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   print_output!  s    c         C€  sP   xI | D]A } t  j j | ƒ r5 |  j | | | ƒ q |  j | | | ƒ q Wd S(   s)   Refactor a list of files and directories.N(   RI   t   patht   isdirt   refactor_dirt   refactor_file(   R‡   t   itemst   writet   doctests_onlyt   dir_or_file(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   refactor&  s    c         C€  sé   t  j d } xÕ t  j | ƒ D]Ä \ } } } |  j d | ƒ | j ƒ  | j ƒ  xe | D]] } | j d ƒ rW t  j j | ƒ d | k rW t  j j | | ƒ }	 |  j	 |	 | | ƒ qW qW Wg  | D] }
 |
 j d ƒ s¿ |
 ^ q¿ | (q Wd S(   sÄ   Descends down a directory and refactor every Python file found.

        Python files are assumed to have a .py extension.

        Files and subdirectories starting with '.' are skipped.
        t   pys   Descending into %sR?   i   N(
   RI   t   extsept   walkRš   Rž   R   R²   t   splitextR•   Rµ   (   R‡   t   dir_nameR·   R¸   t   py_extt   dirpatht   dirnamest	   filenamesR   t   fullnamet   dn(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR´   /  s    

c         C€  s�   y t  | d ƒ } Wn' t k
 r< } |  j d | | ƒ d SXz t j | j ƒ d } Wd | j ƒ  Xt | d d | ƒ� } t	 | j
 ƒ  ƒ | f SWd QXd S(   sG   
        Do our best to decode a Python source file correctly.
        t   rbs   Can't open %s: %si    NR*   t   encoding(   NN(   t   opent   IOErrorRª   R!   R   t   detect_encodingRR   t   closet   _open_with_encodingRH   t   read(   R‡   R¯   t   ft   errRÇ   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   _read_python_sourceC  s    c         C€  s  |  j  | ƒ \ } } | d k r% d S| d 7} | r› |  j d | ƒ |  j | | ƒ } |  j sl | | k rˆ |  j | | | | | ƒ qþ |  j d | ƒ nc |  j | | ƒ } |  j sÅ | rî | j rî |  j t | ƒ d  | d | d | ƒn |  j d | ƒ d S(	   s   Refactors a file.Nu   
s   Refactoring doctests in %ss   No doctest changes in %siÿÿÿÿR·   RÇ   s   No changes in %s(	   RÐ   R!   Rš   t   refactor_docstringRh   t   processed_filet   refactor_stringt   was_changedt   unicode(   R‡   R¯   R·   R¸   RG   RÇ   t   outputt   tree(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRµ   S  s    
c         C€  s·   t  | ƒ } d | k r* t j |  j _ n  zM y |  j j | ƒ } Wn0 t k
 ru } |  j d | | j j	 | ƒ d SXWd |  j |  j _ X| | _
 |  j d | ƒ |  j | | ƒ | S(   sF  Refactor a given input string.

        Args:
            data: a string holding the code to be refactored.
            name: a human-readable name for use in error/log messages.

        Returns:
            An AST corresponding to the refactored input stream; None if
            there were errors during the parse.
        Rg   s   Can't parse %s: %s: %sNs   Refactoring %s(   Rc   R   Rq   R   Rr   t   parse_stringR(   Rª   t	   __class__R   t   future_featuresRš   t   refactor_tree(   R‡   t   dataR   R`   R×   RÏ   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRÓ   j  s     			c         C€  sÆ   t  j j ƒ  } | ro |  j d ƒ |  j | d ƒ } |  j sI | | k r_ |  j | d | ƒ qÂ |  j d ƒ nS |  j | d ƒ } |  j s™ | rµ | j rµ |  j t	 | ƒ d | ƒ n |  j d ƒ d  S(   Ns   Refactoring doctests in stdins   <stdin>s   No doctest changes in stdins   No changes in stdin(
   t   syst   stdinRÍ   Rš   RÑ   Rh   RÒ   RÓ   RÔ   RÕ   (   R‡   R¸   RG   RÖ   R×   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   refactor_stdin…  s    c   
      C€  s›  x- t  |  j |  j ƒ D] } | j | | ƒ q W|  j |  j | j ƒ  ƒ |  j |  j | j ƒ  ƒ |  j j | j	 ƒ  ƒ } xçt
 | j ƒ  ƒ rcxÎ|  j j D]À} | | k rœ | | rœ | | j d t j j d t ƒ | j rþ | | j d t j j ƒ n  x[t | | ƒ D]F} | | | k r9| | j | ƒ n  y t | ƒ Wn t k
 r]qn X| j r|| | j k r|qn  | j | ƒ } | r| j | | ƒ } | d k	 rU| j | ƒ x9 | j ƒ  D]+ } | j säg  | _ n  | j j | ƒ qÉW|  j j | j	 ƒ  ƒ } x? | D]4 }	 |	 | k r6g  | |	 <n  | |	 j | |	 ƒ qWqUqqWqœ qœ Wq} Wx- t  |  j |  j ƒ D] } | j | | ƒ qzW| j  S(   sÏ  Refactors a parse tree (modifying the tree in place).

        For compatible patterns the bottom matcher module is
        used. Otherwise the tree is traversed node-to-node for
        matches.

        Args:
            tree: a pytree.Node instance representing the root of the tree
                  to be refactored.
            name: a human-readable name for this tree.

        Returns:
            True if the tree was modified, False otherwise.
        R�   t   reverseN(!   R   R{   R|   t
   start_treet   traverse_byR…   R†   R€   t   runt   leavest   anyt   valuesRl   Rž   R   t   Baset   depthRW   t   keep_line_ordert
   get_linenoR/   t   removeR   t
   ValueErrort   fixers_appliedt   matcht	   transformR!   RF   R   R6   t   finish_treeRÔ   (
   R‡   R×   R   R;   t	   match_sett   nodet   resultst   newt   new_matchest   fxr(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRÛ   •  sJ     		.c         C€  sƒ   | s
 d Sxr | D]j } xa | | j  D]R } | j | ƒ } | r% | j | | ƒ } | d k	 rw | j | ƒ | } qw q% q% Wq Wd S(   s  Traverse an AST, applying a set of fixers to each node.

        This is a helper method for refactor_tree().

        Args:
            fixers: a list of fixer instances.
            traversal: a generator that yields AST nodes.

        Returns:
            None
        N(   R    Rî   Rï   R!   RF   (   R‡   Rl   t	   traversalRò   R;   Ró   Rô   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRâ   ä  s    c         C€  s½   |  j  j | ƒ | d k rB |  j | ƒ d } | d k rB d Sn  | | k } |  j | | | | ƒ | rŠ |  j d | ƒ |  j sŠ d Sn  | r© |  j | | | | ƒ n |  j d | ƒ d S(   sR   
        Called when a file has been refactored and there may be changes.
        i    Ns   No changes to %ss   Not writing changes to %s(   R}   R   R!   RÐ   R±   Rš   Rh   t
   write_file(   R‡   R®   R¯   R­   R·   RÇ   R°   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRÒ   û  s    	c         C€  s¸   y t  | d d | ƒ} Wn* t j k
 rE } |  j d | | ƒ d SXzG y | j t | ƒ ƒ Wn) t j k
 r‹ } |  j d | | ƒ n XWd | j ƒ  X|  j d | ƒ t |  _	 d S(   sÑ   Writes a string to a file.

        It first shows a unified diff between the old text and the new text, and
        then rewrites the file; the latter is only done if the write option is
        set.
        t   wRÇ   s   Can't create %s: %sNs   Can't write %s: %ss   Wrote changes to %s(
   RÌ   RI   t   errorRª   R·   RK   RË   Rš   RW   Rx   (   R‡   R®   R¯   R­   RÇ   RÎ   RÏ   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRø     s     s   >>> s   ... c   
      C€  s‡  g  } d } d } d } d } x+| j t ƒ D]} | d 7} | j ƒ  j |  j ƒ r² | d k	 r„ | j |  j | | | | ƒ ƒ n  | } | g } | j |  j ƒ }	 | |	  } q. | d k	 r| j | |  j	 ƒ sñ | | |  j	 j
 ƒ  d k r| j | ƒ q. | d k	 r/| j |  j | | | | ƒ ƒ n  d } d } | j | ƒ q. W| d k	 rz| j |  j | | | | ƒ ƒ n  d j | ƒ S(   sË  Refactors a docstring, looking for doctests.

        This returns a modified version of the input string.  It looks
        for doctests, which start with a ">>>" prompt, and may be
        continued with "..." prompts, as long as the "..." is indented
        the same as the ">>>".

        (Unfortunately we can't use the doctest module's parser,
        since, like most parsers, it is not geared towards preserving
        the original source.)
        i    i   u   
u    N(   R!   t
   splitlinesRW   t   lstripR   t   PS1R6   t   refactor_doctestt   findt   PS2t   rstripR   R•   (
   R‡   RG   R¯   t   resultt   blockt   block_linenot   indentt   linenot   linet   i(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRÑ   (  s:    
	c   
      C€  ss  y |  j  | | | ƒ } Wnu t k
 r� } |  j j t j ƒ rm x* | D] } |  j d | j d ƒ ƒ qG Wn  |  j d | | | j	 j
 | ƒ | SX|  j | | ƒ rot | ƒ j t ƒ } | | d  | | d }	 } |	 d g | d k sø t |	 ƒ ‚ | d j d ƒ s| d c d 7<n  | |  j | j d ƒ g } | ro| g  | D] } | |  j | ^ qK7} qon  | S(   sÞ   Refactors one doctest.

        A doctest is given as a block of lines, the first of which starts
        with ">>>" (possibly indented), while the remaining lines start
        with "..." (identically indented).

        s
   Source: %su   
s+   Can't parse docstring in %s line %s: %s: %si   iÿÿÿÿi    (   t   parse_blockR(   Rk   t   isEnabledForRu   t   DEBUGRš   R  Rª   RÙ   R   RÛ   RÕ   Rû   RW   t   AssertionErrort   endswithRý   t   popR   (
   R‡   R  R  R  R¯   R×   RÏ   R  Rô   t   clipped(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRþ   S  s&     	#.c         C€  s  |  j  r d } n d } |  j s4 |  j d | ƒ n1 |  j d | ƒ x |  j D] } |  j | ƒ qN W|  j rŸ |  j d ƒ x! |  j D] } |  j | ƒ q… Wn  |  j rt |  j ƒ d k rÍ |  j d ƒ n |  j d t |  j ƒ ƒ x0 |  j D]" \ } } } |  j | | | Ž qð Wn  d  S(	   Nt   weres
   need to bes   No files %s modified.s   Files that %s modified:s$   Warnings/messages while refactoring:i   s   There was 1 error:s   There were %d errors:(   Rx   R}   R™   Rw   Rt   R’   (   R‡   R  t   filet   messageR§   R¨   R©   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt	   summarizep  s$    					c         C€  s1   |  j  j |  j | | | ƒ ƒ } t ƒ  | _ | S(   s³   Parses a block into a tree.

        This is necessary to get correct line number / offset information
        in the parser diagnostics and embedded into the parse tree.
        (   R   t   parse_tokenst	   wrap_toksRS   RÚ   (   R‡   R  R  R  R×   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR	  ‡  s    !c         c€  sŠ   t  j |  j | | ƒ j ƒ } xe | D]] \ } } \ } } \ }	 }
 } | | d 7} |	 | d 7}	 | | | | f |	 |
 f | f Vq% Wd S(   s;   Wraps a tokenize stream to systematically modify start/end.i   N(   R   RP   t	   gen_linesRL   (   R‡   R  R  R  R5   R    Rb   t   line0t   col0t   line1t   col1t	   line_text(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR  ‘  s
    (c         c€  s¢   | |  j  } | |  j } | } xi | D]a } | j | ƒ rN | t | ƒ Vn4 | | j ƒ  d k rl d Vn t d | | f ƒ ‚ | } q' Wx t r� d Vq� Wd S(   s–   Generates lines as expected by tokenize from a list of lines.

        This strips the first len(indent + self.PS1) characters off each line.
        u   
s   line=%r, prefix=%rR‹   N(   Rý   R   R   R’   R  R  RW   (   R‡   R  R  t   prefix1t   prefix2t   prefixR  (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR  Ÿ  s    
	N(   R   R   R@   Rn   R”   R‘   R!   R‰   Rz   Rª   R™   Rš   R±   Rº   R´   RÐ   Rµ   RÓ   Rß   RÛ   Râ   RÒ   Rø   Rý   R   RÑ   Rþ   R  R	  R  R  (    (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRf   ®   s:   

4	(								O		+			
	t   MultiprocessingUnsupportedc           B€  s   e  Z RS(    (   R   R   (    (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR  ³  s   t   MultiprocessRefactoringToolc           B€  s5   e  Z d  „  Z e e d d „ Z d „  Z d „  Z RS(   c         O€  s/   t  t |  ƒ j | | Ž  d  |  _ d  |  _ d  S(   N(   t   superR   R‰   R!   t   queuet   output_lock(   R‡   R¨   t   kwargs(    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR‰   ¹  s    	i   c   	      C€  sf  | d k r( t  t |  ƒ j | | | ƒ Sy d d  l } Wn t k
 rQ t ‚ n X|  j d  k	 rp t d ƒ ‚ n  | j	 ƒ  |  _ | j
 ƒ  |  _ g  t | ƒ D] } | j d |  j ƒ ^ q› } z; x | D] } | j ƒ  qÆ Wt  t |  ƒ j | | | ƒ Wd  |  j j ƒ  x$ t | ƒ D] } |  j j d  ƒ qWx' | D] } | j ƒ  r5| j ƒ  q5q5Wd  |  _ Xd  S(   Ni   iÿÿÿÿs    already doing multiple processest   target(   R!  R   Rº   t   multiprocessingt   ImportErrorR  R"  R!   t   RuntimeErrort   JoinableQueuet   LockR#  t   xranget   Processt   _childt   startR•   t   putt   is_alive(	   R‡   R¶   R·   R¸   t   num_processesR&  R  t	   processesR+   (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRº   ¾  s2    
+c         C€  so   |  j  j ƒ  } xY | d  k	 rj | \ } } z t t |  ƒ j | | Ž  Wd  |  j  j ƒ  X|  j  j ƒ  } q Wd  S(   N(   R"  Rs   R!   R!  R   Rµ   t	   task_done(   R‡   t   taskR¨   R$  (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR-  Û  s    c         O€  sE   |  j  d  k	 r( |  j  j | | f ƒ n t t |  ƒ j | | Ž  Sd  S(   N(   R"  R!   R/  R!  R   Rµ   (   R‡   R¨   R$  (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyRµ   æ  s    (   R   R   R‰   R@   Rº   R-  Rµ   (    (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyR   ·  s
   		(.   Re   t
   __future__R    t
   __author__RI   R   RÝ   Ru   Rœ   R-   RQ   t	   itertoolsR   t   pgen2R   R   R   t
   fixer_utilR   R‹   R   R   R   t   buR	   R~   RW   R   R(   R   R%   R>   RC   RE   t   version_infot   codecsRÈ   RÌ   RH   RK   Rc   Rd   t   objectRf   R  R   (    (    (    s(   /usr/lib64/python2.7/lib2to3/refactor.pyt   <module>	   sH   							(ÿ ÿ 