mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
change default hosts to a list as we'll probably be using it in the connection manager which needs to extend it
This commit is contained in:
parent
3ac9085a73
commit
8e62f5b3a8
1 changed files with 15 additions and 3 deletions
|
@ -83,7 +83,7 @@ CONFIG_DEFAULTS = {
|
||||||
DEFAULT_HOST = "127.0.0.1"
|
DEFAULT_HOST = "127.0.0.1"
|
||||||
DEFAULT_PORT = 58846
|
DEFAULT_PORT = 58846
|
||||||
DEFAULT_HOSTS = {
|
DEFAULT_HOSTS = {
|
||||||
"hosts": [(hashlib.sha1(str(time.time())).hexdigest(), DEFAULT_HOST, DEFAULT_PORT, "", "")]
|
"hosts": [[hashlib.sha1(str(time.time())).hexdigest(), DEFAULT_HOST, DEFAULT_PORT, "", ""]]
|
||||||
}
|
}
|
||||||
|
|
||||||
HOSTLIST_COL_ID = 0
|
HOSTLIST_COL_ID = 0
|
||||||
|
@ -491,7 +491,8 @@ class Tracker(resource.Resource):
|
||||||
headers = {}
|
headers = {}
|
||||||
filename = self.tracker_icons.get(request.tracker_name)
|
filename = self.tracker_icons.get(request.tracker_name)
|
||||||
if filename:
|
if filename:
|
||||||
request.setHeader("cache-control", "public, must-revalidate, max-age=86400")
|
request.setHeader("cache-control",
|
||||||
|
"public, must-revalidate, max-age=86400")
|
||||||
if filename.endswith(".ico"):
|
if filename.endswith(".ico"):
|
||||||
request.setHeader("content-type", "image/x-icon")
|
request.setHeader("content-type", "image/x-icon")
|
||||||
elif filename.endwith(".png"):
|
elif filename.endwith(".png"):
|
||||||
|
@ -514,7 +515,8 @@ class Flag(resource.Resource):
|
||||||
filename = pkg_resources.resource_filename("deluge",
|
filename = pkg_resources.resource_filename("deluge",
|
||||||
os.path.join(*path))
|
os.path.join(*path))
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
request.setHeader("cache-control", "public, must-revalidate, max-age=86400")
|
request.setHeader("cache-control",
|
||||||
|
"public, must-revalidate, max-age=86400")
|
||||||
request.setHeader("content-type", "image/png")
|
request.setHeader("content-type", "image/png")
|
||||||
data = open(filename, "rb")
|
data = open(filename, "rb")
|
||||||
request.setResponseCode(http.OK)
|
request.setResponseCode(http.OK)
|
||||||
|
@ -523,6 +525,16 @@ class Flag(resource.Resource):
|
||||||
request.setResponseCode(http.NOT_FOUND)
|
request.setResponseCode(http.NOT_FOUND)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
class Icons(resource.Resource):
|
||||||
|
def getChild(self, path, request):
|
||||||
|
request.icon = path
|
||||||
|
return self
|
||||||
|
|
||||||
|
def render(self, request):
|
||||||
|
headers = {}
|
||||||
|
print request.icon
|
||||||
|
return ""
|
||||||
|
|
||||||
class TopLevel(resource.Resource):
|
class TopLevel(resource.Resource):
|
||||||
addSlash = True
|
addSlash = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue