관리-도구
편집 파일: fixer_base.cpython-311.opt-2.pyc
� c��f" � �l � d dl Z ddlmZ ddlmZ ddlmZ G d� de� � Z G d� d e� � Z dS ) � N� )�PatternCompiler)�pygram)�does_tree_importc �� � e Zd Z dZdZdZdZdZ ej d� � Z e� � ZdZ dZdZdZdZdZej Zd� Zd� Zd� Zd � Zd � Zdd�Zd � Zdd�Zd� Zd� Zd� Z dS )�BaseFixNr �postF� c �L � || _ || _ | � � � d S �N)�options�log�compile_pattern)�selfr r s �9/opt/alt/python311/lib64/python3.11/lib2to3/fixer_base.py�__init__zBaseFix.__init__/ s/ � � � �������������� c � � | j �9t � � }|� | j d�� � \ | _ | _ d S d S )NT)� with_tree)�PATTERNr r �pattern�pattern_tree)r �PCs r r zBaseFix.compile_pattern; sX � � � �<�#� �"�"�B�.0�.@�.@���KO� /A� /Q� /Q�+�D�L�$�+�+�+� $�#r c � � || _ d S r )�filename)r r s r �set_filenamezBaseFix.set_filenameF s � � � !�� � � r c �F � d|i}| j � ||� � o|S )N�node)r �match�r r �resultss r r z BaseFix.matchM s/ � � � �4�.���|�!�!�$��0�0�<�W�<r c � � t � � �r )�NotImplementedErrorr s r � transformzBaseFix.transformY s � � � "�#�#�#r �xxx_todo_changemec � � |}|| j v r-|t t | j � � � � z }|| j v �-| j � |� � |S r )� used_names�str�next�numbers�add)r �template�names r �new_namezBaseFix.new_namei sa � � � ���d�o�%�%��c�$�t�|�"4�"4�5�5�5�D� �d�o�%�%�����D�!�!�!��r c � � | j r)d| _ | j � d| j z � � | j � |� � d S )NFz### In file %s ###)� first_logr �appendr )r �messages r �log_messagezBaseFix.log_messaget sJ � ��>� B�"�D�N��H�O�O�0�4�=�@�A�A�A������ � � � � r c �� � |� � � }|� � � }d|_ d}| � |||fz � � |r| � |� � d S d S )N� zLine %d: could not convert: %s)� get_lineno�clone�prefixr3 )r r �reason�lineno� for_output�msgs r �cannot_convertzBaseFix.cannot_convertz s| � � � ���"�"���Z�Z�\�\� �� ��.������� �3�3�4�4�4�� %����V�$�$�$�$�$� %� %r c �d � |� � � }| � d||fz � � d S )NzLine %d: %s)r6 r3 )r r r9 r: s r �warningzBaseFix.warning� s<