관리-도구
편집 파일: fixer_base.cpython-38.opt-2.pyc
U e5d" � @ sP d dl Z ddlmZ ddlmZ ddlmZ G dd� de�ZG dd � d e�Z dS ) � N� )�PatternCompiler)�pygram)�does_tree_importc @ s� e Zd ZdZdZdZdZdZe� d�Z e� ZdZ dZdZdZdZdZejZdd� Zdd � Zd d� Zdd � Zdd� Zddd�Zdd� Zddd�Zdd� Zdd� Zdd� Z dS )�BaseFixNr ZpostF� c C s || _ || _| �� d S �N)�options�log�compile_pattern)�selfr r � r �*/usr/lib64/python3.8/lib2to3/fixer_base.py�__init__/ s zBaseFix.__init__c C s, | j d k r(t� }|j| j dd�\| _| _d S )NT)Z with_tree)�PATTERNr r �pattern�pattern_tree)r ZPCr r r r ; s �zBaseFix.compile_patternc C s || _ d S r )�filename)r r r r r �set_filenameF s zBaseFix.set_filenamec C s d|i}| j �||�o|S )N�node)r �match�r r Zresultsr r r r M s z BaseFix.matchc C s t � �d S r )�NotImplementedErrorr r r r � transformY s zBaseFix.transform�xxx_todo_changemec C s2 |}|| j kr"|tt| j�� }q| j �|� |S r )� used_names�str�next�numbers�add)r �template�namer r r �new_namei s zBaseFix.new_namec C s. | j rd| _ | j�d| j � | j�|� d S )NFz### In file %s ###)� first_logr �appendr )r �messager r r �log_messaget s zBaseFix.log_messagec C s>