관리-도구
편집 파일: fix_metaclass.cpython-311.pyc
� �܋f� � �~ � d Z ddlmZ ddlmZmZmZmZmZm Z ddl mZ ddlm Z mZ d� Z G d� dej � � 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 �v � d }| j D �]-}|j }|j t j k rY|d t t j d� � k r4|d t t j d� � k r|d r|g|z } n��x|j t j k r�|j D ]�}|r n�|j t j k r|}�t |� � t k rbd x}x}}|j D ]T} | t t j d� � k r| }�#|r!| t t j d� � k r| }�F|r|r | }||||f} n�U����/|S )Nr � metaclass� �=� )�children�typer �argumentr r �NAME�EQUAL�arglist�COMMAr ) �parent�results�node�kids�child�comma�meta�equal�name�args �r/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/libpasteurize/fixes/fix_metaclass.py� has_metaclassr$ sh � ��G��� "� "���}���9�� �%�%��A�w�$�u�z�<�8�8�8�8��Q��4���T�2�2�2�2��Q�� 3� �&�4�-����� �Y�$�,� &� &� �� "� "���!�E�E��:���,�,�!�E�E��%�[�[�D�(�(�*.�.�D�.�5�4�$�~� "� "���$�u�z�<�"@�"@�@�@�#&�D�D�!� "�c�T�%�+�t�-D�-D�&D�&D�$'�E�E�!� "�e� "�#&�D�',�d�E�4�&@�G�!�E�����N� c � � e Zd ZdZd� ZdS )�FixMetaclassz classdef<any*> c �� � t |� � }|sd S |D ]}|� � � �t t j d� � }t t j dd�� � }|}d|_ t t j |||g� � }t |� � |j D ]�} | j t j k r�| j D ]�} | j t j k r�| j � | � � dz }t t j | j � � }| � ||� � | � |t% � � � � | � ||� � n����d S )N� __metaclass__r � )�prefixr )r$ �remover r r r r+ r r �atomr r r �suite�INDENT�index�value�insert_childr ) �selfr r �meta_resultsr �targetr r! � stmt_node�item�stmt�loc�idents r# � transformzFixMetaclass.transform5 sX � �$�T�*�*���#�V�V� � � �D��K�K�M�M�M�M��e�j�"2�3�3���U�[�$�t�4�4�4����������V�U�D�$9�:�:� ��� � � ��M� � �D��y�D�J�&�&� �M� � �D��y�E�L�0�0� #�m�1�1�$�7�7�!�;�� $�U�\�4�:� >� >���)�)�#�u�5�5�5��)�)�#�w�y�y�9�9�9��)�)�#�y�9�9�9��� 1�� � r% N)�__name__� __module__�__qualname__�PATTERNr; � r% r# r'