CasperSecurity

Current Path : /lib/python3/dist-packages/landscape/lib/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/landscape/lib/__pycache__/plugin.cpython-310.pyc

o

���c��@sTddlmZddlZddlmZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	dS)�)�absolute_importN�)�
format_objectc@seZdZdZdS)�PluginConfigErrorz7There was an error registering or configuring a plugin.N)�__name__�
__module__�__qualname__�__doc__�r
r
�6/usr/lib/python3/dist-packages/landscape/lib/plugin.pyrsrc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�PluginRegistryz(A central integration point for plugins.cCsg|_i|_dS)N)�_plugins�
_plugin_names��selfr
r
r�__init__s
zPluginRegistry.__init__cCs@t�dt|��|j�|�t|d�r||j|j<|�|�dS)aRegister a plugin.

        The plugin's C{register} method will be called with this registry as
        its argument.

        If the plugin has a C{plugin_name} attribute, it will be possible to
        look up the plugin later with L{get_plugin}.
        zRegistering plugin %s.�plugin_nameN)	�logging�inforr
�append�hasattrrr�register)r�pluginr
r
r�adds
	
zPluginRegistry.addcCs|jS)zGet the list of plugins.)r
rr
r
r�get_plugins"szPluginRegistry.get_pluginscCs
|j|S)z Get a particular plugin by name.)r)r�namer
r
r�
get_plugin&s
zPluginRegistry.get_pluginN)rrrr	rrrrr
r
r
rrsrc@seZdZdZdZdd�ZdS)�Plugina�A convenience for writing plugins.

    This provides a register method which will set up a bunch of
    reactor handlers in the idiomatic way.

    If C{run} is defined on subclasses, it will be called every C{run_interval}
    seconds after being registered.

    @cvar run_interval: The interval, in seconds, to execute the
    C{run} method. If set to C{None}, then C{run} will not be
    scheduled.
    �cCs8||_t|d�r|jdur|j�|j|j�dSdSdS)N�run)�registryr�run_interval�reactor�
call_everyr)rr r
r
rr;s�zPlugin.registerN)rrrr	r!rr
r
r
rr+s
r)
�
__future__rr�formatr�	Exceptionr�objectrrr
r
r
r�<module>s
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY