403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/dnf/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/dnf/__pycache__/plugin.cpython-39.opt-1.pyc
a

�!c�$�@s�ddlmZddlmZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZe�d�ZdZGdd	�d	e�ZGd
d�de�Zdd
�Zdd�Zdd�Zdd�Zdd�ZdS)�)�absolute_import)�print_function)�unicode_literalsN)�_�dnfzdnf.plugin.dynamicc@s\eZdZdZdZdZedd��Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�ZdS)�Pluginz5The base class custom plugins must derive from. #:apiz	<invalid>Ncs�tj��}|jr|jn|j��fdd�|jD�}|D]\}tj�|�r4z|�	|�Wq4t
y�}z$tj�
td�t|���WYd}~q4d}~00q4|S)Ncsg|]}d|�f�qS)z
%s/%s.conf�)�.0�path��namer�./usr/lib/python3.9/site-packages/dnf/plugin.py�
<listcomp>9�z&Plugin.read_config.<locals>.<listcomp>zParsing file failed: %s)�libdnf�confZConfigParser�config_namerZpluginconfpath�osr
�isfile�read�	Exceptionr�
exceptionsZConfigErrorr�str)�clsr�parser�files�file�errr
�read_config4s
0zPlugin.read_configcCs||_||_dS�N)�base�cli��selfr r!rrr
�__init__BszPlugin.__init__cCsdSrr�r#rrr
�
pre_configGszPlugin.pre_configcCsdSrrr%rrr
�configKsz
Plugin.configcCsdSrrr%rrr
�resolvedOszPlugin.resolvedcCsdSrrr%rrr
�sackSszPlugin.sackcCsdSrrr%rrr
�pre_transactionWszPlugin.pre_transactioncCsdSrrr%rrr
�transaction[szPlugin.transaction)�__name__�
__module__�__qualname__�__doc__rr�classmethodrr$r&r'r(r)r*r+rrrr
r.s

rc@sveZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd
S)�PluginscCsg|_g|_dSr)�
plugin_cls�pluginsr%rrr
r$aszPlugins.__init__c	Csv|jD]j}zt||��Wqtjjy2�Yqtynt��\}}}t�	|||�}t
�d�|��Yq0qdS)N�)
r3�getattrrr�Errorr�sys�exc_info�	traceback�format_exception�loggerZcritical�join)r#�method�plugin�exc_type�	exc_value�
exc_tracebackZexcept_listrrr
�_calleres
zPlugins._callercst|jdd�D]`}|j�t�fdd�|D��r0q|�|�}|�d�o\|�dd�o\|�dd�}|r|j�|�qdS)zwChecks whether plugins are enabled or disabled in configuration files
           and removes disabled plugins from listNc3s|]}t��|�VqdSr��fnmatch)r	�patternrrr
�	<genexpr>urz)Plugins._check_enabled.<locals>.<genexpr>�mainZenabled)r2r�anyrZhas_sectionZ
has_optionZ
getboolean�remove)r#r�enable_pluginsZplug_clsrZdisabledrrr
�_check_enabledps


��zPlugins._check_enabledcCs�ttjvrtd��tj�t�tjt<}g|_t|j	||�}t
||�t�dd�|_|�
||�t|j�dkr�tdd�|jD��}t�td�d�|��dS)z)Dynamically load relevant plugin modules.zload_plugins() called twiceNrcss|]}|jVqdSrr)r	r>rrr
rF�rz Plugins._load.<locals>.<genexpr>zLoaded plugins: %s�, )�DYNAMIC_PACKAGEr7�modules�RuntimeErrorrZpycomp�
ModuleType�__path__�_get_plugins_filesZ
pluginpath�_import_modules�_plugin_classesr2rK�len�sortedr;�debugrr<)r#rZskipsrJ�packager�namesrrr
�_loads

z
Plugins._loadcCs|�d�dS)Nr&�rBr%rrr
�_run_pre_config�szPlugins._run_pre_configcCs|�d�dS)Nr'r[r%rrr
�_run_config�szPlugins._run_configNcCs&|jD]}|||�}|j�|�qdSr)r2r3�append)r#r r!Zp_clsr>rrr
�	_run_init�s

zPlugins._run_initcCs|�d�dS)Nr)r[r%rrr
�run_sack�szPlugins.run_sackcCs|�d�dS)Nr(r[r%rrr
�run_resolved�szPlugins.run_resolvedcCs|�d�dS)Nr*r[r%rrr
�run_pre_transaction�szPlugins.run_pre_transactioncCs|�d�dS)Nr+r[r%rrr
�run_transaction�szPlugins.run_transactioncCst�td��tjt=dS)NzPlugins were unloaded)r;rWrr7rNrMr%rrr
�_unload�szPlugins._unloadcCs�|js
dSt�}|jD]}||t�|j�<qt|���}t�}|jD]}|�|�	|j
��qD|sddS|jD]}|�|j
�qj|D]}|j�
||�q�dS)zH
        Unload plugins that were removed in the `transaction`.
        N)Z
remove_set�dictr3�inspectZgetfile�	__class__�set�keys�update�intersectionrZinstall_set�difference_updaterI)r#r+r3r>Zplugin_filesZerased_plugin_filesZpkgZplugin_filerrr
�unload_removed_plugins�s


zPlugins.unload_removed_plugins)N)r,r-r.r$rBrKrZr\r]r_r`rarbrcrdrmrrrr
r1`s
r1cCst��Sr)r�__subclasses__rrrr
rT�srTcCs�|D]�}tj�|�\}}|j�|�tj�|�\}}d|j|f}zt�|�}Wqt	y�}z2t
�td�||�t
j
tjjddd�WYd}~qd}~00qdS)Nz%s.%szFailed loading plugin "%s": %sr4T)r8)rr
�splitrQr^�splitextr,�	importlib�
import_modulerr;�errorr�logr�loggingZSUBDEBUG)rXZpy_files�fnr
�moduleZextrrrrr
rS�srScCs6g}t|�}t|�}t�}t�}|D]�}t�d|�D]�}tj�tj�|��\}}	d}
d}|D]B}t||�r^|�|�d}
|D]}
t||
�r~d}
|�|
�q~d}q^|s�|D]}
t||
�r�|�|
�q�|
r6|�|�q6q$|�	|�}|�rt
�td��
d�t|����|�	|�}|�r2t
�td��
d�t|����|S)Nz%s/*.pyTFz=No matches found for the following enable plugin patterns: {}rLz>No matches found for the following disable plugin patterns: {})rh�globrr
rp�basename�_plugin_name_matches_pattern�addr^�
differencer;Zwarningr�formatr<rV)�pathsZdisable_pluginsrJr3Zpattern_enable_foundZpattern_disable_found�prv�plugin_nameZdummyZmatchedZenable_pattern_testedZpattern_skipZpattern_enableZenable_not_foundZdisable_not_foundrrr
rR�sH




�
�rRcs*t||�dd�f�}t�fdd�|D��S)z�
    Checks plugin name matches the pattern.

    The alternative plugin name using dashes instead of underscores is tried
    in case of original name is not matched.

    (see https://bugzilla.redhat.com/show_bug.cgi?id=1980712)
    r�-c3s|]}t�|��VqdSrrC)r	r�rErr
rFrz/_plugin_name_matches_pattern.<locals>.<genexpr>)rh�replacerH)r�rEZ	try_namesrr�r
rz�s
rzcs<�fdd�}tt�jd�tjf|�jdd��}|�_�S)z5A class decorator for automatic command registration.cs|r|���dSr)�register_commandr"��
command_classrr
r$sz"register_command.<locals>.__init__rr)r$r)�typerr,rr�aliasesZ_plugin)r�r$Zplugin_classrr�r
r�s��r�)Z
__future__rrrrDrxrqrfru�operatorrr7r9rZdnf.loggingrZ
dnf.pycompZdnf.utilZdnf.i18nrZ	getLoggerr;rM�objectrr1rTrSrRrzr�rrrr
�<module>s2
2g
%

Youez - 2016 - github.com/yon3zu
LinuXploit