HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/landscape/lib/__pycache__/plugin.cpython-38.pyc
U

���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__szPluginRegistry.__init__cCs@t�dt|��|j�|�t|d�r2||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)rZpluginr
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&szPluginRegistry.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.
    �cCs0||_t|d�r,|jdk	r,|j�|j|j�dS)N�run)�registryr�run_intervalZreactorZ
call_everyr)rrr
r
rr;szPlugin.registerN)rrrr	r rr
r
r
rr+s
r)
Z
__future__rr�formatr�	Exceptionr�objectrrr
r
r
r�<module>s