관리-도구
편집 파일: fix_metaclass.cpython-37.opt-1.pyc
B �A�[� � @ sj d Z ddlmZ ddlmZmZmZmZmZm Z ddl mZ ddlm Z mZ dd� ZG dd � d ej�Zd S )zn Fixer for (metaclass=X) -> __metaclass__ = X Some semantics (see PEP 3115) may be altered in the translation.� )� fixer_base)�Name�syms�Node�Leaf�Newline� find_root)�token)�indentation�suitifyc C s d }�x| j D � ]�}|j }|jtjkrd|d ttjd�krb|d ttjd�krb|d rb|g| }P q|jtjkrx�|j D ]�}|r�P |jtj kr�|}qxt|�t krxd } }}xX|j D ]N} | ttjd�kr�| }q�|r�| ttjd�kr�| }q�|r�|r�| }||||f}P q�W qxW qW |S )Nr � metaclass� �=� )�children�typer Zargumentr r �NAME�EQUALZarglist�COMMAr ) �parent�results�nodeZkidsZchildZcomma�meta�equal�name�arg� r �R/opt/alt/python37/lib/python3.7/site-packages/libpasteurize/fixes/fix_metaclass.py� has_metaclass s6 r c @ s e Zd ZdZdd� ZdS )�FixMetaclassz classdef<any*> c C s� t |�}|sd S x|D ]}|�� qW ttjd�}ttjddd�}|}d|_ttj |||g�}t |� x||jD ]r} | jtj krnx`| jD ]V} | jtjkr�| j�| �d }ttj| j�}| �||� | �|t� � | �||� P q�W qnW d S )NZ __metaclass__r � )�prefixr )r �remover r r r r! r r Zatomr r r Zsuite�INDENT�index�valueZinsert_childr ) �selfr r Zmeta_resultsr �targetr r Z stmt_node�itemZstmtZloc�identr r r � transform5 s* zFixMetaclass.transformN)�__name__� __module__�__qualname__ZPATTERNr* r r r r r / s r N)�__doc__Zlib2to3r Zlib2to3.fixer_utilr r r r r r Zlib2to3.pygramr Zlibfuturize.fixer_utilr r r ZBaseFixr r r r r �<module> s $