Updates to the test plugin.

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

View File

@ -41,14 +41,14 @@ class CorePlugin(PluginBase):
try:
from core import Core
self.plugin = Core(plugin_api, plugin_name)
except:
pass
except Exception, e:
log.debug("Did not load a Core plugin: %s", e)
class GtkUIPlugin(PluginBase):
def __init__(self, plugin_api, plugin_name):
# Load the GtkUI portion of the plugin
try:
from gtkui import GtkUI
self.plugin = GtkUI()
except:
pass
self.plugin = GtkUI(plugin_api, plugin_name)
except Exception, e:
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
class GtkUI(ui.UI):
def __init__(self):
ui.UI.__init__(self)
log.debug("gtkui plugin initialized..")
def __init__(self, plugin_api, plugin_name):
log.debug("Calling UI init")
# 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
class UI:
def __init__(self):
pass
def __init__(self, plugin_api, plugin_name):
self.plugin = plugin_api
def enable(self):
pass