0x1949 Team - FAZEMRX - MANAGER
Edit File: manager.cpython-310.pyc
o ��{fU � @ s� d dl mZmZmZ eZdgZd dlZd dlZd dl Z d dl Z d dlZd dlZd dl mZ dZeeu r5eneZG dd� d�ZdS )� )�absolute_import�print_function�unicode_literals� PluginManagerN)�Plugin� c @ sF e Zd ZdZdd� Zdd� Zedd� �Zdd � Zd d� Z dd d�Z dS )r z�Find and load plugins. Plugins are stored in files named '*_plugin.py' in the list of directories given to the constructor. c C s6 || _ t|t�rtd�t|����t|�| _d | _d S )NzExpected sequence, got {}) �_app� isinstance� STR_TYPES� TypeError�format�type�list�_plugin_dirs�_plugins)�self�app�plugin_dirs� r �</usr/lib/python3/dist-packages/janitor/plugincore/manager.py�__init__. s � zPluginManager.__init__c c s� � | j D ]K}zdd� t�|�D �}W n! ty3 } z|jtjkr!� t�d�|�� W Y d}~qd}~ww t�d�|t � |��� t|�D ] }tj� ||�V qDqdS )z4Return all filenames in which plugins may be stored.c S s g | ] }|� d �r|�qS )z _plugin.py)�endswith)�.0�filenamer r r � <listcomp>= s �z2PluginManager.get_plugin_files.<locals>.<listcomp>zNo such plugin directory: {}NzPlugin modules in {}: {}) r �os�listdir�OSError�errno�ENOENT�logging�debugr �SPACE�join�sorted�path)r �dirname� basenames�errorr r r r �get_plugin_files8 s( � �� ����zPluginManager.get_plugin_filesc c s � | � � D ]}|V qd S �N)r) )r r r r r �plugin_filesK s ��zPluginManager.plugin_filesc c sX � dd� }dd� t �||�D �}t�d�|t�dd� |D ���� |D ]}|� V q#dS ) z-Find and instantiate all plugins in a module.c S s t �| �o t| t�o | tuS r* )�inspect�isclass� issubclassr )�targetr r r � is_pluginR s ��z.PluginManager._find_plugins.<locals>.is_pluginc S s g | ]\}}|�qS r r )r �name�memberr r r r W s ��z/PluginManager._find_plugins.<locals>.<listcomp>zPlugins in {}: {}c s s � | ]}t |�V qd S r* )�str�r �pluginr r r � <genexpr>\ s � z.PluginManager._find_plugins.<locals>.<genexpr>N)r, � getmembersr r! r r"