Beispiel #1
0
if __name__ == '__main__':
    mail = ServerReportEmail()

    plugins_dir = os.path.expanduser(PLUGIN_DIR)
    if ( DEBUG_MODE ):
        print("Plugins directory is %s" % plugins_dir)
    plugin_files = ServerReportPlugins(plugins_dir)

    sys.path.insert(0, plugins_dir)

    for plugin_file in plugin_files:
        __import__(plugin_file, None, None, [''])

	plugins_loaded = []
	# Load a plugins
	for master_plugin in ServerReportPluginBase.__subclasses__():
		if len( master_plugin.__subclasses__() ) == 0:
			continue
		for plugin in master_plugin.__subclasses__():
			p = plugin()
			msg = p.collect()
			if msg is not None:
				mail.add_content(msg)
			plugins_loaded.append(plugin)
			
			#for plugin in ServerReportPluginReplaceFile.__subclasses__():
			#p = plugin()
			#mail.add_content(p.collect())
			#plugins_loaded.append(plugin)

	# Other plugins from Base
Beispiel #2
0
	def __init__(self):
		ServerReportPluginBase.__init__(self)
		self._buffer = []
		self._openfile()
		self._do_buffer()
		self._check_buffer()
Beispiel #3
0
	def __init__(self):
		ServerReportPluginBase.__init__(self)
		self._buffer = {}
		self._init_plugin()