관리-도구
편집 파일: autodetect.cpython-311.pyc
� �܋f� � �� � d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dl m Z d dlmZ d dl mZ dZ ej d � � Z ej d � � Z ej d� � Zd� Zd efd�Zd� Zd� ZdS )� N)�Path)�find_requirements)�RequirementsNotFound)�encoding)�PermissionMissing)� is_virtualenv)�django�celery�flaskz%^\s*from ([\._a-zA-Z0-9]+) import .*$z^\s*import ([\._a-zA-Z0-9]+)$z$^\s*import ([\._a-zA-Z0-9]+(, ){1})+c � � t � � }| � d� � D �].}t � |� � }|r�g }|� d� � }|� |d d� � � |� |� � d � d� � D ])}|� |� � � � � �*n_t � |� � pt � |� � }|���|� d� � � d� � }|D ] }|t v r|� |� � �!��0|S )N� � ����,�.)�set�split�_IMPORT_MULTIPLE_REGEX�match�group�append�strip� _IMPORT_REGEX�_FROM_IMPORT_REGEX�POSSIBLE_LIBRARIES�add)� file_contents�names�liner �import_names�first�name�import_names �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/prospector/autodetect.py�find_from_importsr% sM � ��E�E�E��#�#�D�)�)� '� '��&�,�,�T�2�2��� 5��L��K�K��N�N�E�����c�r�c� �+�+�+�� � �5�)�)�!�,�2�2�3�7�7� 2� 2���#�#�D�J�J�L�L�1�1�1�1� 2� "�'�'��-�-�O�1C�1I�1I�$�1O�1O�E��}�� �;�;�q�>�>�/�/��4�4�L�'� '� '�K��0�0�0�� � �+�&�&�&�� '� �L� �pathc �l � t � � } | � � � D ]�}|� � � r#t |� � r�&|t |� � z }n�|� � � sx|j dk rm t j |� � }|t |� � z }nE# t j $ r3}t j |j � d|j � �t � � Y d }~nd }~ww xY wt! |� � t! t"