add some test web plugin code

This commit is contained in:
Damien Churchill 2009-04-27 22:02:26 +00:00
parent 16d695f077
commit f2364b8531
3 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,6 @@
Deluge.Preferences.addPage(_('Execute'), {
border: false,
xtype: 'form',
layout: 'form',
items: []
});

View File

@ -22,6 +22,7 @@
# Boston, MA 02110-1301, USA.
#
import pkg_resources
from deluge.log import LOG as log
from deluge.ui.client import client
@ -30,7 +31,18 @@ from deluge.plugins.pluginbase import WebPluginBase
class WebUI(WebPluginBase):
def enable(self):
log.debug("Example Web plugin enabled!")
log.debug("Execute Web plugin enabled!")
deluge_web = component.get("DelugeWeb")
deluge_web.top_level.scripts.append("/js/deluge-execute.js")
deluge_web.top_level.debug_scripts.append("/js/deluge-execute.js")
javascript = component.get("Javascript")
js_path = pkg_resources.resource_filename("execute", "data")
print js_path
javascript.directories.append(js_path)
def disable(self):
log.debug("Example Web plugin disabled!")
log.debug("Execute Web plugin disabled!")
deluge_web = component.get("DelugeWeb")
deluge_web.top_level.scripts.remove("/js/deluge-execute.js")
deluge_web.top_level.debug_scripts.remove("/js/deluge-execute.js")

View File

@ -50,7 +50,7 @@ setup(
%s = %s:CorePlugin
[deluge.plugin.gtkui]
%s = %s:GtkUIPlugin
[deluge.plugin.webui]
[deluge.plugin.web]
%s = %s:WebUIPlugin
""" % ((__plugin_name__, __plugin_name__.lower())*3)
)