/usr/lib/python3/dist-packages/landscape/lib
NameSizeModeActions
apt/-0755rm
__pycache__/-0755rm
amp.py217450644editdlrm
backoff.py16830644editdlrm
base64.py1960644editdlrm
bootstrap.py14160644editdlrm
bpickle.py64710644editdlrm
cli.py4400644editdlrm
cloud.py17150644editdlrm
compat.py6160644editdlrm
config.py124840644editdlrm
disk.py50270644editdlrm
encoding.py5450644editdlrm
fd.py7510644editdlrm
fetch.py66470644editdlrm
format.py9590644editdlrm
fs.py38890644editdlrm
gpg.py17960644editdlrm
hashlib.py2640644editdlrm
jiffies.py16210644editdlrm
juju.py8600644editdlrm
lock.py7050644editdlrm
log.py4840644editdlrm
logging.py25280644editdlrm
message.py26380644editdlrm
monitor.py62810644editdlrm
network.py98210644editdlrm
os_release.py13240644editdlrm
persist.py209950644editdlrm
plugin.py17870644editdlrm
process.py66030644editdlrm
reactor.py88120644editdlrm
schema.py64570644editdlrm
scriptcontent.py5220644editdlrm
sequenceranges.py57240644editdlrm
store.py14080644editdlrm
sysstats.py79200644editdlrm
tag.py5060644editdlrm
testing.py246620644editdlrm
timestamp.py2330644editdlrm
twisted_util.py44760644editdlrm
user.py14760644editdlrm
versioning.py12650644editdlrm
vm_info.py31720644editdlrm
warning.py3940644editdlrm
__init__.py1980644editdlrm
Edit: /usr/lib/python3/dist-packages/landscape/lib/plugin.py (1787B)
from __future__ import absolute_import import logging from .format import format_object class PluginConfigError(Exception): """There was an error registering or configuring a plugin.""" class PluginRegistry(object): """A central integration point for plugins.""" def __init__(self): self._plugins = [] self._plugin_names = {} def add(self, plugin): """Register 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}. """ logging.info("Registering plugin %s.", format_object(plugin)) self._plugins.append(plugin) if hasattr(plugin, "plugin_name"): self._plugin_names[plugin.plugin_name] = plugin plugin.register(self) def get_plugins(self): """Get the list of plugins.""" return self._plugins def get_plugin(self, name): """Get a particular plugin by name.""" return self._plugin_names[name] class Plugin(object): """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. """ run_interval = 5 def register(self, registry): self.registry = registry if hasattr(self, "run") and self.run_interval is not None: registry.reactor.call_every(self.run_interval, self.run)