관리-도구
편집 파일: fix_absolute_import.cpython-311.pyc
� �܋fD � �r � d Z ddlmZmZmZmZ ddlmZ ddlm Z m Z ddlmZ ddlm Z G d� de� � Zd S ) a� Fixer for import statements, with a __future__ import line. Based on lib2to3/fixes/fix_import.py, but extended slightly so it also supports Cython modules. If spam is being imported from the local directory, this import: from spam import eggs becomes: from __future__ import absolute_import from .spam import eggs and this import: import spam becomes: from __future__ import absolute_import from . import spam � )�dirname�join�exists�sep)� FixImport)� FromImport�syms)�traverse_imports)� future_importc � � e Zd ZdZd� Zd� ZdS )�FixAbsoluteImport� c �@ � | j rdS |d }|j t j k r~t |d� � s|j d }t |d� � �| � |j � � r5d|j z |_ |� � � t d|� � dS dS d}d}t |� � D ]}| � |� � rd}�d}�|r|r| � |d � � dS t d|g� � }|j |_ t d|� � |S ) z� Copied from FixImport.transform(), but with this line added in any modules that had implicit relative imports changed: from __future__ import absolute_import" N�imp�valuer �.�absolute_importFTz#absolute and local imports together)�skip�typer �import_from�hasattr�children�probably_a_local_importr �changedr r �warningr �prefix)�self�node�resultsr � have_local� have_absolute�mod_name�news �v/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/libfuturize/fixes/fix_absolute_import.py� transformzFixAbsoluteImport.transform sW � � �9� ��F��e�n���9��(�(�(� �c�7�+�+� &��l�1�o�� �c�7�+�+� &��+�+�C�I�6�6� 8� �3�9�,�� ���� � � ��0�$�7�7�7�7�7� 8� 8� �J�!�M�,�S�1�1� )� )���/�/��9�9� )�!%�J�J�$(�M�M�� �� N� �L�L��'L�M�M�M����T�C�5�)�)�C���C�J��,�d�3�3�3��J� c �X � |� d� � rdS |� dd� � d }t | j � � }t ||� � }t t t |� � d� � � � sdS dt ddd d dfD ]}t ||z � � r dS �dS ) zq Like the corresponding method in the base class, but this also supports Cython modules. r F� r z__init__.pyz.pyz.pycz.soz.slz.pydz.pyxT)� startswith�splitr �filenamer r r )r �imp_name� base_path�exts r$ r z)FixAbsoluteImport.probably_a_local_importI s� � � ���t�$�$� ��5��>�>�$��*�*�1�-���D�M�*�*� ���H�-�-� � �d�7�9�-�-�}�=�=�>�>� ��5��3���u�f�f�E� � �C��i�#�o�&�&� ��t�t� ��ur&