mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
provide 2 helper methods for adding and removing scripts from the webserver
This commit is contained in:
parent
110af0c2fc
commit
06b19538fd
1 changed files with 23 additions and 0 deletions
|
@ -338,6 +338,29 @@ class TopLevel(resource.Resource):
|
||||||
@property
|
@property
|
||||||
def stylesheets(self):
|
def stylesheets(self):
|
||||||
return self.__stylesheets
|
return self.__stylesheets
|
||||||
|
|
||||||
|
def add_script(self, script):
|
||||||
|
"""
|
||||||
|
Adds a script to the server so it is included in the <head> 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):
|
def getChild(self, path, request):
|
||||||
if path == "":
|
if path == "":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue