Updates to the test plugin.

This commit is contained in:
Andrew Resch 2008-02-27 08:09:47 +00:00
commit 53ebbe011c
3 changed files with 15 additions and 11 deletions

View file

@ -41,14 +41,14 @@ class CorePlugin(PluginBase):
try: try:
from core import Core from core import Core
self.plugin = Core(plugin_api, plugin_name) self.plugin = Core(plugin_api, plugin_name)
except: except Exception, e:
pass log.debug("Did not load a Core plugin: %s", e)
class GtkUIPlugin(PluginBase): class GtkUIPlugin(PluginBase):
def __init__(self, plugin_api, plugin_name): def __init__(self, plugin_api, plugin_name):
# Load the GtkUI portion of the plugin # Load the GtkUI portion of the plugin
try: try:
from gtkui import GtkUI from gtkui import GtkUI
self.plugin = GtkUI() self.plugin = GtkUI(plugin_api, plugin_name)
except: except Exception, e:
pass log.debug("Did not load a GtkUI plugin: %s", e)

View file

@ -35,9 +35,13 @@ from deluge.log import LOG as log
import ui import ui
class GtkUI(ui.UI): class GtkUI(ui.UI):
def __init__(self): def __init__(self, plugin_api, plugin_name):
ui.UI.__init__(self) log.debug("Calling UI init")
log.debug("gtkui plugin initialized..") # Call UI constructor
ui.UI.__init__(self, plugin_api, plugin_name)
log.debug("test plugin initialized..")
self.plugin.register_hook("on_apply_prefs", self.apply_prefs)
def apply_prefs(self):
log.debug("applying prefs in test plugin!!")

View file

@ -34,8 +34,8 @@
from deluge.log import LOG as log from deluge.log import LOG as log
class UI: class UI:
def __init__(self): def __init__(self, plugin_api, plugin_name):
pass self.plugin = plugin_api
def enable(self): def enable(self):
pass pass