OwlCyberSecurity - MANAGER
Edit File: fixer_base.cpython-310.opt-2.pyc
o ����S�g"����������������������@���sR��� �d�dl�Z�ddlmZ�ddlmZ�ddlmZ�G�dd��de�ZG�dd ��d e�Z dS�) �����N����)�PatternCompiler)�pygram)�does_tree_importc�������������������@���s����e�Zd�Z �dZdZdZdZdZe� 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 ����9/opt/alt/python310/lib64/python3.10/lib2to3/fixer_base.py�__init__/���s���zBaseFix.__init__c�����������������C���s2��� �|�j�d�urt��}|j|�j�dd�\|�_|�_d�S�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����r���)�NotImplementedErrorr���r ���r ���r���� transformY���s��� zBaseFix.transform�xxx_todo_changemec�����������������C���s<��� �|}||�j�v�r|tt|�j���}||�j�v�s|�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���sD��� �|����}|���}d|_d}|��|||f���|r |��|��d�S�d�S�)N��zLine %d: could not convert: %s)� get_linenoZclone�prefixr&���)r���r����reason�linenoZ for_output�msgr ���r ���r����cannot_convertz���s����zBaseFix.cannot_convertc�����������������C���s ��� �|����}|��d||f���d�S�)NzLine %d: %s)r(���r&���)r���r���r*���r+���r ���r ���r����warning����s���zBaseFix.warningc�����������������C���s*��� �|j�|�_�|��|��t�d�|�_d|�_d�S�)Nr���T)r���r���� itertools�countr���r#����r���Ztreer���r ���r ���r���� start_tree����s ��� zBaseFix.start_treec�����������������C���s��� �d�S�r���r ���r1���r ���r ���r����finish_tree����s���zBaseFix.finish_tree)r���r���)!�__name__� __module__�__qualname__r���r���r���r ���r���r/���r0���r����setr���ZorderZexplicitZ run_orderZ_accept_typeZkeep_line_orderZ BM_compatibler���Zpython_symbolsZsymsr���r���r���r���r���r"���r&���r-���r.���r2���r3���r ���r ���r ���r���r������s6���� r���c�����������������������s*���e�Zd�Z �dZ��fdd�Zdd��Z���ZS�)�ConditionalFixNc��������������������s���t�t|��j|���d�|�_d�S�r���)�superr8���r2����_should_skip)r����args�� __class__r ���r���r2�������s��� zConditionalFix.start_treec�����������������C���sJ���|�j�d�ur|�j�S�|�j�d�}|d�}d�|d�d���}t|||�|�_�|�j�S�)N�.���)r:����skip_on�split�joinr���)r���r���Zpkgr!���r ���r ���r����should_skip����s��� zConditionalFix.should_skip)r4���r5���r6���r@���r2���rC���� __classcell__r ���r ���r<���r���r8�������s ����r8���) r/���Zpatcompr���r'���r���Z fixer_utilr����objectr���r8���r ���r ���r ���r����<module>���s����