AlkantarClanX12

Your IP : 3.145.93.227


Current Path : /opt/alt/python33/lib64/python3.3/lib2to3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/lib2to3/__pycache__/fixer_base.cpython-33.pyc

�
��f2c@s~dZddlZddlZddlmZddlmZddlmZGdd�de	�Z
Gd	d
�d
e
�ZdS(u2Base class for fixers (optional, but recommended).iNi(uPatternCompiler(upygram(udoes_tree_importcBs|EeZdZdZdZdZdZdZdZ	e
jd�Ze
�ZdZdZdZdZdZdZejZdd�Zdd�Zd	d
�Zdd�Zd
d�Zddd�Zdd�Zddd�Z dd�Z!dd�Z"dd�Z#dS(uBaseFixuOptional base class for fixers.

    The subclass name must be FixFooBar where FooBar is the result of
    removing underscores and capitalizing the words of the fix name.
    For example, the class name for a fixer named 'has_key' should be
    FixHasKey.
    iuposticCs ||_||_|j�dS(uInitializer.  Subclass may override.

        Args:
            options: an dict containing the options passed to RefactoringTool
            that could be used to customize the fixer through the command line.
            log: a list to append warnings and other messages to.
        N(uoptionsulogucompile_pattern(uselfuoptionsulog((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyu__init__0s		uBaseFix.__init__cCsC|jdk	r?t�}|j|jdd�\|_|_ndS(u�Compiles self.PATTERN into self.pattern.

        Subclass may override if it doesn't want to use
        self.{pattern,PATTERN} in .match().
        u	with_treeNT(uPATTERNuNoneuPatternCompilerucompile_patternuTrueupatternupattern_tree(uselfuPC((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyucompile_pattern<s	uBaseFix.compile_patterncCs
||_dS(uOSet the filename.

        The main refactoring tool should call this.
        N(ufilename(uselfufilename((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyuset_filenameGsuBaseFix.set_filenamecCs&i|d6}|jj||�o%|S(uReturns match for a given parse tree node.

        Should return a true or false object (not necessarily a bool).
        It may return a non-empty dict of matching sub-nodes as
        returned by a matching pattern.

        Subclass may override.
        unode(upatternumatch(uselfunodeuresults((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyumatchNs	
u
BaseFix.matchcCs
t��dS(u�Returns the transformation for a given parse tree node.

        Args:
          node: the root of the parse tree that matched the fixer.
          results: a dict mapping symbolic names to part of the match.

        Returns:
          None, or a node that is a modified copy of the
          argument node.  The node argument may also be modified in-place to
          effect the same change.

        Subclass *must* override.
        N(uNotImplementedError(uselfunodeuresults((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyu	transformZsuBaseFix.transformuxxx_todo_changemecCsI|}x,||jkr4|tt|j��}q	W|jj|�|S(u�Return a string suitable for use as an identifier

        The new name is guaranteed not to conflict with other identifiers.
        (u
used_namesustrunextunumbersuadd(uselfutemplateuname((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyunew_namejs
uBaseFix.new_namecCs@|jr,d|_|jjd|j�n|jj|�dS(Nu### In file %s ###F(u	first_loguFalseuloguappendufilename(uselfumessage((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyulog_messageus		uBaseFix.log_messagecCsX|j�}|j�}d|_d}|j|||f�|rT|j|�ndS(uWarn the user that a given chunk of code is not valid Python 3,
        but that it cannot be converted automatically.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        uuLine %d: could not convert: %sN(u
get_linenoucloneuprefixulog_message(uselfunodeureasonulinenou
for_outputumsg((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyucannot_convert{s	uBaseFix.cannot_convertcCs'|j�}|jd||f�dS(u�Used for warning the user about possible uncertainty in the
        translation.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        uLine %d: %sN(u
get_linenoulog_message(uselfunodeureasonulineno((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyuwarning�suBaseFix.warningcCs8|j|_|j|�tjd�|_d|_dS(u�Some fixers need to maintain tree-wide state.
        This method is called once, at the start of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        iNT(u
used_namesuset_filenameu	itertoolsucountunumbersuTrueu	first_log(uselfutreeufilename((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyu
start_tree�s
uBaseFix.start_treecCsdS(u�Some fixers need to maintain tree-wide state.
        This method is called once, at the conclusion of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        N((uselfutreeufilename((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyufinish_tree�suBaseFix.finish_treeNF($u__name__u
__module__u__qualname__u__doc__uNoneuPATTERNupatternupattern_treeuoptionsufilenameu	itertoolsucountunumbersusetu
used_namesuorderuFalseuexplicitu	run_orderu_accept_typeukeep_line_orderu
BM_compatibleupygramupython_symbolsusymsu__init__ucompile_patternuset_filenameumatchu	transformunew_nameulog_messageucannot_convertuwarningu
start_treeufinish_tree(u
__locals__((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyuBaseFixs4		
uBaseFixcs>|EeZdZdZdZ�fdd�Zdd�Z�S(uConditionalFixu@ Base class for fixers which not execute if an import is found. cs#tt|�j|�d|_dS(N(usuperuConditionalFixu
start_treeuNoneu_should_skip(uselfuargs(u	__class__(u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyu
start_tree�suConditionalFix.start_treecCsg|jdk	r|jS|jjd�}|d}dj|dd��}t|||�|_|jS(Nu.ii����i����(u_should_skipuNoneuskip_onusplitujoinudoes_tree_import(uselfunodeupkguname((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyushould_skip�s
uConditionalFix.should_skipN(u__name__u
__module__u__qualname__u__doc__uNoneuskip_onu
start_treeushould_skip(u
__locals__((u	__class__u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyuConditionalFix�suConditionalFix(u__doc__uloggingu	itertoolsupatcompuPatternCompileruupygramu
fixer_utiludoes_tree_importuobjectuBaseFixuConditionalFix(((u7/opt/alt/python33/lib64/python3.3/lib2to3/fixer_base.pyu<module>s�