Author: damoxc
Revision: 5748
Log:
add a method to gather the plugins resources for when they need to be
loaded after the ui
Diff:
Modified: trunk/deluge/ui/web/json_api.py
===================================================================
--- trunk/deluge/ui/web/json_api.py 2009-09-14 16:24:47 UTC (rev 5747)
+++ trunk/deluge/ui/web/json_api.py 2009-09-14 16:31:59 UTC (rev 5748)
@@ -786,6 +786,10 @@
return component.get("Web.PluginManager").get_plugin_info(name)
@export
+ def get_plugin_resources(self, name):
+ return component.get("Web.PluginManager").get_plugin_resources(name)
+
+ @export
def register_event_listener(self, event):
"""
Add a listener to the event queue.
Modified: trunk/deluge/ui/web/pluginmanager.py
===================================================================
--- trunk/deluge/ui/web/pluginmanager.py 2009-09-14 16:24:47 UTC (rev
5747)
+++ trunk/deluge/ui/web/pluginmanager.py 2009-09-14 16:31:59 UTC (rev
5748)
@@ -135,3 +135,17 @@
def update(self):
pass
+
+ def get_plugin_resources(self, name):
+ # Get the plugin instance
+ try:
+ plugin = component.get("WebPlugin." + name)
+ except KeyError:
+ log.info("Plugin has no web ui")
+ return
+ info = gather_info(plugin)
+ info["name"] = name
+ info["scripts"] = ["/js/%s/%s" % (name.lower(), os.path.basename(s))
for s in info["scripts"]]
+ info["debug_scripts"] = ["/js/%s/%s" % (name.lower(),
os.path.basename(s)) for s in info["debug_scripts"]]
+ del info["script_directories"]
+ return info
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---