509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3

  \=m  ã               @   s<  d 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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d„ZG dd„ deƒZdd„ Zdd„ Zdd„ Zdd„ Zejd'k räddlZejZdd„ Z dd„ Z!neZeZ eZ!dd„ Z"G dd„ deƒZ#G d d!„ d!e$ƒZ%G d"d#„ d#eƒZ&G d$d%„ d%e%ƒZ'dS )(zÛ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.
z#Guido van Rossum <guido@python.org>é    N)Úchainé   )ÚdriverÚtokenizeÚtoken)Ú	find_root)ÚpytreeÚpygram)Úbtm_matcherTc             C   st   t | g g dgƒ}tjj|jƒ}g }xLttj|ƒƒD ]:}|jdƒr2|jdƒr2|rZ|dd… }|j	|dd… ƒ q2W |S )zEReturn a sorted list of all available fix names in the given package.Ú*Úfix_z.pyé   Né   éýÿÿÿ)
Ú
__import__ÚosÚpathÚdirnameÚ__file__ÚsortedÚlistdirÚ
startswithÚendswithÚappend)Z	fixer_pkgZremove_prefixZpkgZ	fixer_dirZ	fix_namesÚname© r   ú(/usr/lib64/python3.6/lib2to3/refactor.pyÚget_all_fix_names   s    r   c               @   s   e Zd ZdS )Ú
_EveryNodeN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   +   s   r   c             C   sš   t | tjtjfƒr(| jdkr t‚| jhS t | tjƒrH| jrDt| jƒS t‚t | tj	ƒrŠt
ƒ }x*| jD ] }x|D ]}|jt|ƒƒ qlW qbW |S td|  ƒ‚dS )zf Accepts a pytree Pattern Node and returns a set
        of the pattern types which will match first. Nz$Oh no! I don't understand pattern %s)Ú
isinstancer   ZNodePatternZLeafPatternÚtyper   ZNegatedPatternZcontentÚ_get_head_typesZWildcardPatternÚsetÚupdateÚ	Exception)ZpatÚrÚpÚxr   r   r   r$   /   s    


r$   c             C   sÊ   t jtƒ}g }x„| D ]|}|jrjyt|jƒ}W n tk
rJ   |j|ƒ Y q�X xB|D ]}|| j|ƒ qRW q|jdk	r†||j j|ƒ q|j|ƒ qW x,tt	j
jjƒ t	j
jƒD ]}|| j|ƒ q¬W t|ƒS )z^ Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.  N)ÚcollectionsÚdefaultdictÚlistÚpatternr$   r   r   Z_accept_typer   r	   Úpython_grammarZsymbol2numberÚvaluesÚtokensÚextendÚdict)Z
fixer_listZ
head_nodesZeveryÚfixerZheadsZ	node_typer   r   r   Ú_get_headnode_dictK   s"    



r5   c                s   ‡ fdd„t ˆ dƒD ƒS )zN
    Return the fully qualified names for fixers in the package pkg_name.
    c                s   g | ]}ˆ d  | ‘qS )Ú.r   )Ú.0Úfix_name)Úpkg_namer   r   ú
<listcomp>h   s   z+get_fixers_from_package.<locals>.<listcomp>F)r   )r9   r   )r9   r   Úget_fixers_from_packaged   s    
r;   c             C   s   | S )Nr   )Úobjr   r   r   Ú	_identityk   s    r=   r   c             C   s   | j ddƒS )Nz
Ú
)Úreplace)Úinputr   r   r   Ú_from_system_newlinesr   s    rA   c             C   s    t jdkr| jdt jƒS | S d S )Nr>   )r   Úlinesepr?   )r@   r   r   r   Ú_to_system_newlinest   s    
rC   c                sT  d}t jtj| ƒjƒ‰ ‡ fdd„}ttjt jtj	hƒ}t
ƒ }yøxò|ƒ \}}||krVq@q@|tjkrl|rfP d}q@|tjko||dk�r,|ƒ \}}|tjksœ|dkržP |ƒ \}}|tjksº|dkr¼P |ƒ \}}|tjkrâ|dkrâ|ƒ \}}xJ|tjk�r(|j|ƒ |ƒ \}}|tjk�s|d	k�rP |ƒ \}}qäW q@P q@W W n tk
�rJ   Y nX t|ƒS )
NFc                 s   t ˆ ƒ} | d | d fS )Nr   r   )Únext)Útok)Úgenr   r   Úadvance‚   s    z(_detect_future_features.<locals>.advanceTÚfromZ
__future__Úimportú(ú,)r   Úgenerate_tokensÚioÚStringIOÚreadlineÚ	frozensetr   ÚNEWLINEÚNLÚCOMMENTr%   ÚSTRINGÚNAMEÚOPÚaddÚStopIteration)ÚsourceZhave_docstringrG   ÚignoreÚfeaturesÚtpÚvaluer   )rF   r   Ú_detect_future_features   sD    








r^   c               @   s   e Zd ZdZdS )Ú
FixerErrorzA fixer could not be loaded.N)r   r    r!   Ú__doc__r   r   r   r   r_   §   s   r_   c               @   sä   e Zd ZdddœZdZdZd4dd„Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Zd5dd„Zd6dd„Zdd„ Zd7dd„Zdd„ Zd8dd„Zdd„ Zd d!„ Zd9d"d#„Zd:d$d%„Zd&Zd'Zd(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Zd0d1„ Zd2d3„ ZdS );ÚRefactoringToolF)Úprint_functionÚwrite_unchanged_filesZFixr   Nc             C   s2  || _ |pg | _| jjƒ | _|dk	r0| jj|ƒ | jd rDtj| _ntj	| _| jj
dƒ| _g | _tjdƒ| _g | _d| _tj| jtj| jd�| _| jƒ \| _| _g | _tjƒ | _g | _g | _xXt| j| jƒD ]F}|j rä| jj!|ƒ qÌ|| jkrü| jj"|ƒ qÌ|| jkrÌ| jj"|ƒ qÌW t#| jƒ| _$t#| jƒ| _%dS )zÑ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.
        Nrb   rc   ra   F)ÚconvertÚlogger)&ÚfixersÚexplicitÚ_default_optionsÚcopyÚoptionsr&   r	   Ú!python_grammar_no_print_statementÚgrammarr/   Úgetrc   ÚerrorsÚloggingZ	getLoggerre   Ú	fixer_logÚwroter   ZDriverr   rd   Ú
get_fixersÚ	pre_orderÚ
post_orderÚfilesÚbmZBottomMatcherÚBMZbmi_pre_orderZbmi_post_orderr   ZBM_compatibleZ	add_fixerr   r5   Úbmi_pre_order_headsÚbmi_post_order_heads)ÚselfZfixer_namesrj   rg   r4   r   r   r   Ú__init__³   s<    





zRefactoringTool.__init__c             C   s\  g }g }�x&| j D �]}t|i i dgƒ}|jddƒd }|j| jƒrV|t| jƒd… }|jdƒ}| jdjdd„ |D ƒƒ }yt	||ƒ}W n$ t
k
r¬   td	||f ƒ‚Y nX || j| jƒ}	|	jrä| jd
k	rä|| jkrä| jd|ƒ q| jd|ƒ |	jdk�r|j|	ƒ q|	jdk�r |j|	ƒ qtd|	j ƒ‚qW tjdƒ}
|j|
d� |j|
d� ||fS )a  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   r6   r   NÚ_Ú c             S   s   g | ]}|j ƒ ‘qS r   )Útitle)r7   r)   r   r   r   r:   ÷   s    z.RefactoringTool.get_fixers.<locals>.<listcomp>zCan't find %s.%sTzSkipping optional fixer: %szAdding transformation: %sZpreZpostzIllegal fixer order: %rZ	run_order)Úkeyéÿÿÿÿ)rf   r   Úrsplitr   ÚFILE_PREFIXÚlenÚsplitÚCLASS_PREFIXÚjoinÚgetattrÚAttributeErrorr_   rj   rp   rg   Úlog_messageÚ	log_debugÚorderr   ÚoperatorÚ
attrgetterÚsort)rz   Zpre_order_fixersZpost_order_fixersZfix_mod_pathÚmodr8   ÚpartsÚ
class_nameZ	fix_classr4   Zkey_funcr   r   r   rr   ç   s8    


zRefactoringTool.get_fixersc             O   s   ‚ dS )zCalled when an error occurs.Nr   )rz   ÚmsgÚargsÚkwdsr   r   r   Ú	log_error  s    zRefactoringTool.log_errorc             G   s   |r|| }| j j|ƒ dS )zHook to log a message.N)re   Úinfo)rz   r’   r“   r   r   r   r‰     s    zRefactoringTool.log_messagec             G   s   |r|| }| j j|ƒ d S )N)re   Údebug)rz   r’   r“   r   r   r   rŠ     s    zRefactoringTool.log_debugc             C   s   dS )zTCalled with the old version, new version, and filename of a
        refactored file.Nr   )rz   Úold_textÚnew_textÚfilenameÚequalr   r   r   Úprint_output  s    zRefactoringTool.print_outputc             C   s<   x6|D ].}t jj|ƒr&| j|||ƒ q| j|||ƒ qW dS )z)Refactor a list of files and directories.N)r   r   ÚisdirÚrefactor_dirÚrefactor_file)rz   ÚitemsÚwriteÚdoctests_onlyZdir_or_filer   r   r   Úrefactor#  s    
zRefactoringTool.refactorc       
      C   s¤   t jd }x”t j|ƒD ]†\}}}| jd|ƒ |jƒ  |jƒ  xH|D ]@}|jdƒ rBt jj|ƒd |krBt jj||ƒ}	| j	|	||ƒ qBW dd„ |D ƒ|dd…< qW dS )zÄ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.
        ÚpyzDescending into %sr6   r   c             S   s   g | ]}|j d ƒs|‘qS )r6   )r   )r7   Zdnr   r   r   r:   >  s    z0RefactoringTool.refactor_dir.<locals>.<listcomp>N)
r   ÚextsepÚwalkrŠ   rŽ   r   r   Úsplitextr†   rŸ   )
rz   Zdir_namer¡   r¢   Zpy_extÚdirpathZdirnamesÚ	filenamesr   Úfullnamer   r   r   rž   ,  s    

zRefactoringTool.refactor_dirc             C   sˆ   yt |dƒ}W n. tk
r< } z| jd||ƒ dS d}~X nX ztj|jƒd }W d|jƒ  X t|d|d��}t|j	ƒ ƒ|fS Q R X dS )zG
        Do our best to decode a Python source file correctly.
        ÚrbzCan't open %s: %sNr   r(   )Úencoding)NN)
ÚopenÚOSErrorr•   r   Údetect_encodingrO   ÚcloseÚ_open_with_encodingrA   Úread)rz   rš   ÚfÚerrr¬   r   r   r   Ú_read_python_source@  s    
z#RefactoringTool._read_python_sourcec             C   sº   | j |ƒ\}}|dkrdS |d7 }|rn| jd|ƒ | j||ƒ}| jsL||kr`| j|||||ƒ q¶| jd|ƒ nH| j||ƒ}| jsŠ|rª|jrª| jt|ƒdd… |||d� n| jd|ƒ dS )	zRefactors a file.Nr>   zRefactoring doctests in %szNo doctest changes in %sr   )r¡   r¬   zNo changes in %sr€   )rµ   rŠ   Úrefactor_docstringrc   Úprocessed_fileÚrefactor_stringÚwas_changedÚstr)rz   rš   r¡   r¢   r@   r¬   ÚoutputÚtreer   r   r   rŸ   P  s    zRefactoringTool.refactor_filec             C   s”   t |ƒ}d|krtj| j_zJy| jj|ƒ}W n4 tk
r` } z| jd||jj	|ƒ dS d}~X nX W d| j| j_X ||_
| jd|ƒ | j||ƒ |S )aF  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.
        rb   zCan't parse %s: %s: %sNzRefactoring %s)r^   r	   rk   r   rl   Zparse_stringr'   r•   Ú	__class__r   Úfuture_featuresrŠ   Úrefactor_tree)rz   Údatar   r[   r¼   r´   r   r   r   r¸   g  s    
zRefactoringTool.refactor_stringc             C   sŒ   t jjƒ }|rN| jdƒ | j|dƒ}| js2||krB| j|d|ƒ qˆ| jdƒ n:| j|dƒ}| jsj|r~|jr~| jt	|ƒd|ƒ n
| jdƒ d S )NzRefactoring doctests in stdinz<stdin>zNo doctest changes in stdinzNo changes in stdin)
ÚsysÚstdinr²   rŠ   r¶   rc   r·   r¸   r¹   rº   )rz   r¢   r@   r»   r¼   r   r   r   Úrefactor_stdin‚  s    

zRefactoringTool.refactor_stdinc       
      C   sþ  x"t | j| jƒD ]}|j||ƒ qW | j| j|jƒ ƒ | j| j|jƒ ƒ | jj|j	ƒ ƒ}�xvt
|jƒ ƒ�rÐ�x`| jjD �]R}||koŠ|| rv|| jtjjdd� |jr¼|| jtjjd� �x
t|| ƒD � ]ø}||| krì|| j|ƒ yt|ƒ W n tk
�r   wÌY nX |j�r(||jk�r(qÌ|j|ƒ}|rÌ|j||ƒ}|dk	rÌ|j|ƒ x,|jƒ D ] }|j�spg |_|jj|ƒ �q^W | jj|j	ƒ ƒ}x2|D ]*}	|	|k�r®g ||	< ||	 j||	 ƒ �q˜W qÌW qvW q\W x$t | j| jƒD ]}|j||ƒ �qâW |jS )aÏ  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.
        T)r   Úreverse)r   N)r   rs   rt   Z
start_treeÚtraverse_byrx   ry   rw   ZrunZleavesÚanyr0   rf   rŽ   r   ZBaseZdepthZkeep_line_orderZ
get_linenor-   Úremover   Ú
ValueErrorZfixers_appliedÚmatchÚ	transformr?   r   r2   Zfinish_treer¹   )
rz   r¼   r   r4   Z	match_setÚnodeÚresultsÚnewZnew_matchesZfxrr   r   r   r¿   ’  sJ    



$zRefactoringTool.refactor_treec             C   s^   |sdS xP|D ]H}xB||j  D ]4}|j|ƒ}|r|j||ƒ}|dk	r|j|ƒ |}qW qW dS )a  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?   )rz   rf   Z	traversalrË   r4   rÌ   rÍ   r   r   r   rÅ   á  s    


zRefactoringTool.traverse_byc             C   s†   | j j|ƒ |dkr.| j|ƒd }|dkr.dS ||k}| j||||ƒ |r`| jd|ƒ | js`dS |rv| j||||ƒ n| jd|ƒ dS )zR
        Called when a file has been refactored and there may be changes.
        Nr   zNo changes to %szNot writing changes to %s)ru   r   rµ   rœ   rŠ   rc   Ú
write_file)rz   r™   rš   r˜   r¡   r¬   r›   r   r   r   r·   ø  s    zRefactoringTool.processed_filec          %   C   s¬   yt |d|d�}W n. tk
r@ } z| jd||ƒ dS d}~X nX zHy|jt|ƒƒ W n0 tk
r† } z| jd||ƒ W Y dd}~X nX W d|jƒ  X | jd|ƒ d| _dS )zÑ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.
        Úw)r¬   zCan't create %s: %sNzCan't write %s: %szWrote changes to %sT)r±   r®   r•   r¡   rC   r°   rŠ   rq   )rz   r™   rš   r˜   r¬   r³   r´   r   r   r   rÎ     s    $
zRefactoringTool.write_filez>>> z... c       
      C   s  g }d}d}d}d}xØ|j dd�D ]È}|d7 }|jƒ j| jƒr€|dk	r\|j| j||||ƒƒ |}|g}|j| jƒ}	|d|	… }q"|dk	rº|j|| j ƒs®||| jjƒ  d krº|j	|ƒ q"|dk	rØ|j| j||||ƒƒ d}d}|j	|ƒ q"W |dk	�r|j| j||||ƒƒ dj
|ƒS )aË  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.)
        Nr   T)Úkeependsr   r>   r}   )Ú
splitlinesÚlstripr   ÚPS1r2   Úrefactor_doctestÚfindÚPS2Úrstripr   r†   )
rz   r@   rš   ÚresultÚblockZblock_linenoÚindentÚlinenoÚlineÚir   r   r   r¶   %  s:    



z"RefactoringTool.refactor_docstringc       
         s  yˆj ||ˆ ƒ}W nd tk
rv } zHˆjjtjƒrRx|D ]}ˆjd|jdƒƒ q8W ˆjd|||j	j
|ƒ |S d}~X nX ˆj||ƒ�r
t|ƒjdd�}|d|d … ||d d…  }	}|d jdƒsÖ|d  d7  < ˆ ˆj |jdƒ g}|�r
|‡ ‡fd	d
„|D ƒ7 }|S )zÞ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).

        z
Source: %sr>   z+Can't parse docstring in %s line %s: %s: %sNT)rÐ   r   r   c                s   g | ]}ˆ ˆj  | ‘qS r   )rÖ   )r7   rÜ   )rÚ   rz   r   r   r:   j  s    z4RefactoringTool.refactor_doctest.<locals>.<listcomp>r€   r€   )Úparse_blockr'   re   ZisEnabledForro   ÚDEBUGrŠ   r×   r•   r½   r   r¿   rº   rÑ   r   rÓ   Úpop)
rz   rÙ   rÛ   rÚ   rš   r¼   r´   rÜ   rÍ   Zclippedr   )rÚ   rz   r   rÔ   P  s$    
"z RefactoringTool.refactor_doctestc             C   sÒ   | j rd}nd}| js$| jd|ƒ n&| jd|ƒ x| jD ]}| j|ƒ q8W | jrt| jdƒ x| jD ]}| j|ƒ qbW | jrÎt| jƒdkr”| jdƒ n| jdt| jƒƒ x&| jD ]\}}}| j|f|ž|Ž q®W d S )	NÚwerez
need to bezNo files %s modified.zFiles that %s modified:z$Warnings/messages while refactoring:r   zThere was 1 error:zThere were %d errors:)rq   ru   r‰   rp   rn   rƒ   )rz   rá   ÚfileÚmessager’   r“   r”   r   r   r   Ú	summarizem  s$    
zRefactoringTool.summarizec             C   s"   | j j| j|||ƒƒ}tƒ |_|S )z³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   Zparse_tokensÚ	wrap_toksrP   r¾   )rz   rÙ   rÛ   rÚ   r¼   r   r   r   rÞ   „  s    zRefactoringTool.parse_blockc             c   sh   t j| j||ƒjƒ}xN|D ]F\}}\}}\}	}
}||d 7 }|	|d 7 }	||||f|	|
f|fV  qW dS )z;Wraps a tokenize stream to systematically modify start/end.r   N)r   rL   Ú	gen_linesÚ__next__)rz   rÙ   rÛ   rÚ   r1   r#   r]   Zline0Zcol0Zline1Zcol1Z	line_textr   r   r   rå   Ž  s
    zRefactoringTool.wrap_toksc             c   s€   || j  }|| j }|}xV|D ]N}|j|ƒr@|t|ƒd… V  n(||jƒ d krXdV  ntd||f ƒ‚|}qW x
dV  qrW dS )z–Generates lines as expected by tokenize from a list of lines.

        This strips the first len(indent + self.PS1) characters off each line.
        Nr>   zline=%r, prefix=%rr}   )rÓ   rÖ   r   rƒ   r×   ÚAssertionError)rz   rÙ   rÚ   Úprefix1Zprefix2ÚprefixrÜ   r   r   r   ræ   œ  s    



zRefactoringTool.gen_lines)NN)FF)FF)FF)F)NFN)N)r   r    r!   rh   r…   r‚   r{   rr   r•   r‰   rŠ   rœ   r£   rž   rµ   rŸ   r¸   rÃ   r¿   rÅ   r·   rÎ   rÓ   rÖ   r¶   rÔ   rä   rÞ   rå   ræ   r   r   r   r   ra   «   s:   
4(
	


O 

+
ra   c               @   s   e Zd ZdS )ÚMultiprocessingUnsupportedN)r   r    r!   r   r   r   r   rë   °  s   rë   c                   sB   e Zd Z‡ fdd„Zd‡ fdd„	Z‡ fdd„Z‡ fd	d
„Z‡  ZS )ÚMultiprocessRefactoringToolc                s"   t t| ƒj||Ž d | _d | _d S )N)Úsuperrì   r{   ÚqueueÚoutput_lock)rz   r“   Úkwargs)r½   r   r   r{   ¶  s    z$MultiprocessRefactoringTool.__init__Fr   c                s  |dkrt tˆƒj|||ƒS ydd l‰ W n tk
r@   t‚Y nX ˆjd k	rTtdƒ‚ˆ jƒ ˆ_ˆ j	ƒ ˆ_
‡ ‡fdd„t|ƒD ƒ}z.x|D ]}|jƒ  qˆW t tˆƒj|||ƒ W d ˆjjƒ  xt|ƒD ]}ˆjjd ƒ qÄW x|D ]}|jƒ rÞ|jƒ  qÞW d ˆ_X d S )Nr   r   z already doing multiple processesc                s   g | ]}ˆ j ˆjd �‘qS ))Útarget)ZProcessÚ_child)r7   rÝ   )Úmultiprocessingrz   r   r   r:   È  s   z8MultiprocessRefactoringTool.refactor.<locals>.<listcomp>)rí   rì   r£   ró   ÚImportErrorrë   rî   ÚRuntimeErrorZJoinableQueueZLockrï   ÚrangeÚstartr†   ÚputZis_alive)rz   r    r¡   r¢   Znum_processesZ	processesr)   rÝ   )r½   )ró   rz   r   r£   »  s2    









z$MultiprocessRefactoringTool.refactorc          
      sR   | j jƒ }xB|d k	rL|\}}ztt| ƒj||Ž W d | j jƒ  X | j jƒ }qW d S )N)rî   rm   rí   rì   rŸ   Z	task_done)rz   Ztaskr“   rð   )r½   r   r   rò   Ø  s    


z"MultiprocessRefactoringTool._childc                s2   | j d k	r| j j||fƒ ntt| ƒj||ŽS d S )N)rî   rø   rí   rì   rŸ   )rz   r“   rð   )r½   r   r   rŸ   ã  s    

z)MultiprocessRefactoringTool.refactor_file)FFr   )r   r    r!   r{   r£   rò   rŸ   Ú__classcell__r   r   )r½   r   rì   ´  s
    rì   )T)r   r   )(r`   Ú
__author__r   rÁ   ro   rŒ   r+   rM   Ú	itertoolsr   Zpgen2r   r   r   Z
fixer_utilr   r}   r   r	   r
   rv   r   r'   r   r$   r5   r;   r=   Úversion_infoÚcodecsr­   r±   rA   rC   r^   r_   Úobjectra   rë   rì   r   r   r   r   Ú<module>	   sF   


(    	