Edit File: plugin_loader.cpython-311.pyc
� L( e� � �Z � d dl mZ d dlZd dlZd dlZd dlZd dlmZ G d� de� � Z dS )� )�absolute_importN)�LveStatsPluginc � � e Zd Zd� Zd� ZdS )�PluginLoaderc � � t j � |� � rYt j � t j � |� � � � s| j � d|� � dS dS dS )z� Check correcting symlink. If symlink incorrect return True :param str path: path to file or symlink :return bool: zIncorrect symlink %sTN)�os�path�islink�exists�realpath�log�warning)�selfr s ��/builddir/build/BUILDROOT/lve-stats-4.2.1-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/core/plugin_loader.py�check_incorrect_symlinkz$PluginLoader.check_incorrect_symlink sq � � �7�>�>�$��� �����r�w�7G�7G��7M�7M�(N�(N� ��H���3�T�:�:�:��4� � � � � c � � t j t � � | _ g }t j � |� � �r{d� t j |� � D � � }|D �]Y}t j � � t j � |� � \ }}t j � ||� � }| � |� � r t j � � ��t j ||� � }d� t |j � � � � � D � � } | s| j � d|� � |� | � � n3# t( $ r&} | j � d|| � � Y d } ~ nd } ~ ww xY wt j � � ��C# t j � � w xY w|| _ d S )Nc 3 �D K � | ]}|� d � � �|V � �dS )z.pyN)�endswith)�.0�fns r � <genexpr>z(PluginLoader.__init__.<locals>.<genexpr>! s4 � � � �X�X��R�[�[�QV�EW�EW�X�"�X�X�X�X�X�Xr c �v � g | ]6}t j |� � r t |t � � r|t u�4|��7S � )�inspect�isclass� issubclassr )r �xs r � <listcomp>z)PluginLoader.__init__.<locals>.<listcomp>, sV � � t� t� t�Q�")�/�!�"4�"4�t�9C�A�~�9V�9V�t�[\�dr�[r�[r� !�[r�[r�[rr zNo classes to load found in %sz%Unable to load %s due to exception %s)�logging� getLogger�__name__r r r �isdir�listdir�imp�acquire_lock�splitext�joinr �release_lock�load_source�list�__dict__�values�error�extend� Exception� exception�plugins)r �plugins_folder�classes_loaded� file_names� file_name�module_name�_� full_path�module�classes�exs r �__init__zPluginLoader.__init__ s� � ��$�X�.�.����� �7�=�=��(�(� '�X�X�r�z�.�'A�'A�X�X�X�J�'� '� '� �� �"�"�"�'�%'�W�%5�%5�i�%@�%@�N�K�� "����^�Y� G� G�I��3�3�I�>�>� !� � �$�&�&�&�&� !�_�[�)�D�D�F�t� t�$�v��/E�/E�/G�/G�*H�*H� t� t� t�G�"� T�����'G��S�S�S�"�)�)�'�2�2�2�2�� � _� _� _��H�&�&�'N�PY�[]�^�^�^�^�^�^�^�^�����_���� �$�&�&�&�&��C�$�&�&�&�&����%����s8 �8AE�$A7E�F$� F�&F�F$�F�F$�$F9N)r"