~eVddlZddlmZGddeZGddZGdd Zy) N) format_objectceZdZdZy)PluginConfigErrorz7There was an error registering or configuring a plugin.N)__name__ __module__ __qualname____doc__6/usr/lib/python3/dist-packages/landscape/lib/plugin.pyrrsAr rc(eZdZdZdZdZdZdZy)PluginRegistryz(A central integration point for plugins.c g|_i|_y)N)_plugins _plugin_namesselfs r __init__zPluginRegistry.__init__ s r ctjdt||jj |t |dr||j |j<|j|y)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) logginginforrappendhasattrrrregister)rplugins r addzPluginRegistry.addsV  -}V/DE V$ 6= )5;D  v11 2r c|jS)zGet the list of plugins.)rrs r get_pluginszPluginRegistry.get_plugins s }}r c |j|S)z Get a particular plugin by name.)r)rnames r get_pluginzPluginRegistry.get_plugin$s!!$''r N)rrr r rrr r#r r r rr s2  (r rceZdZdZdZdZy)PluginaA 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. c||_t|dr>|j1|jj |j|j yyy)Nrun)registryr run_intervalreactor call_everyr()rr)s r rzPlugin.register9sG  4 D$5$5$A    ' '(9(9488 D%B r N)rrr r r*rr r r r%r%)s LEr r%)rformatr Exceptionrrr%r r r r/s/!B B((>EEr