From 06b19538fd73ff9e8d6cd43806faeefe1cb45f66 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 10 Jun 2009 13:27:55 +0000 Subject: [PATCH] provide 2 helper methods for adding and removing scripts from the webserver --- deluge/ui/web/server.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index 52d422482..9844966f0 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -338,6 +338,29 @@ class TopLevel(resource.Resource): @property def stylesheets(self): return self.__stylesheets + + def add_script(self, script): + """ + Adds a script to the server so it is included in the element + of the index page. + + :param script: The path to the script + :type script: string + """ + + self.__scripts.append(script) + self.__debug_scripts.append(script) + + def remove_script(self, script): + """ + Removes a script from the server. + + :param script: The path to the script + :type script: string + """ + self.__scripts.remove(script) + self.__debug_scripts.remove(script) + def getChild(self, path, request): if path == "":