add some test web plugin code
This commit is contained in:
parent
16d695f077
commit
f2364b8531
|
@ -0,0 +1,6 @@
|
||||||
|
Deluge.Preferences.addPage(_('Execute'), {
|
||||||
|
border: false,
|
||||||
|
xtype: 'form',
|
||||||
|
layout: 'form',
|
||||||
|
items: []
|
||||||
|
});
|
|
@ -22,6 +22,7 @@
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
from deluge.ui.client import client
|
from deluge.ui.client import client
|
||||||
|
@ -30,7 +31,18 @@ from deluge.plugins.pluginbase import WebPluginBase
|
||||||
|
|
||||||
class WebUI(WebPluginBase):
|
class WebUI(WebPluginBase):
|
||||||
def enable(self):
|
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):
|
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")
|
||||||
|
|
|
@ -50,7 +50,7 @@ setup(
|
||||||
%s = %s:CorePlugin
|
%s = %s:CorePlugin
|
||||||
[deluge.plugin.gtkui]
|
[deluge.plugin.gtkui]
|
||||||
%s = %s:GtkUIPlugin
|
%s = %s:GtkUIPlugin
|
||||||
[deluge.plugin.webui]
|
[deluge.plugin.web]
|
||||||
%s = %s:WebUIPlugin
|
%s = %s:WebUIPlugin
|
||||||
""" % ((__plugin_name__, __plugin_name__.lower())*3)
|
""" % ((__plugin_name__, __plugin_name__.lower())*3)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue