From 30c88195ee02d4fa745c1c0202644ec143c57ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 5 Jul 2009 02:53:57 +0200 Subject: Better debug/info messages --- portato/plugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'portato/plugin.py') diff --git a/portato/plugin.py b/portato/plugin.py index e627eb1..716a9b2 100644 --- a/portato/plugin.py +++ b/portato/plugin.py @@ -197,6 +197,10 @@ class Plugin (object): if disable: self.status = self.STAT_HARD_DISABLED + # debug test + if hasattr(self, "widget_init") and not isinstance(self, WidgetPlugin): + debug("Plugin '%s' has an init_widget() function but is not a WidgetPlugin. Are you sure, this is correct?", self.name) + def _init (self): """ Method called from outside to init the extension parts of this plugin. @@ -307,7 +311,7 @@ class WidgetPlugin (Plugin): self.widget_init() def widget_init (self): - debug("No widgets to initialize. Wrong class used for plugin?") + debug("%s: No widgets to initialize. Wrong class used for plugin?", self.name) def add_widget (self, slot, widget): """ @@ -442,6 +446,7 @@ class PluginQueue (object): p._widget_init() for w in p.widgets: WidgetSlot.slots[w.slot].add_widget(w) + info(_("Widgets of plugin '%s' loaded."), p.name) def add (self, plugin, disable = False): """ -- cgit v1.2.3