X-Git-Url: http://git.ipfire.org/?p=collecty.git;a=blobdiff_plain;f=src%2Fcollecty%2Fdaemon.py;h=d4e9b4a3e1b8d3424efcc5811e4d90ccd3fec198;hp=eb64571c4b9a9c171ffac00409ec6a21de019f70;hb=8ee5a71a80e7361880f7719bdd3398403ddb4401;hpb=682b512d9b86eecb472ea3bcf89bfb02ee98082b diff --git a/src/collecty/daemon.py b/src/collecty/daemon.py index eb64571..d4e9b4a 100644 --- a/src/collecty/daemon.py +++ b/src/collecty/daemon.py @@ -29,6 +29,7 @@ import threading import time from . import bus +from . import locales from . import plugins from .constants import * @@ -80,6 +81,8 @@ class Collecty(object): log.debug(_("Collecty successfully initialized with %s plugins") \ % len(self.plugins)) + log.debug(_("Supported locales: %s") % ", ".join(locales.get_supported_locales())) + def add_plugin(self, plugin_class): # Try initialising a new plugin. If that fails, we will log the # error and try to go on. @@ -193,6 +196,20 @@ class Collecty(object): return plugin.generate_graph(template_name, *args, **kwargs) + def graph_info(self, template_name, *args, **kwargs): + plugin = self.get_plugin_from_template(template_name) + if not plugin: + raise RuntimeError("Could not find template %s" % template_name) + + return plugin.graph_info(template_name, *args, **kwargs) + + def last_update(self, template_name, *args, **kwargs): + plugin = self.get_plugin_from_template(template_name) + if not plugin: + raise RuntimeError("Could not find template %s" % template_name) + + return plugin.last_update(*args, **kwargs) + def create_worker_threads(self, num=None): """ Creates a number of worker threads