Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2015 Eyeo GmbH | 4 # Copyright (C) 2006-2015 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 except: | 89 except: |
90 start_response("400 Processing Error", [("Content-Type", "text/plain")]) | 90 start_response("400 Processing Error", [("Content-Type", "text/plain")]) |
91 return ["Failed to parse addonVersion."] | 91 return ["Failed to parse addonVersion."] |
92 manifest = _get_update_manifest(build_id, builds_dir, builds_url) | 92 manifest = _get_update_manifest(build_id, builds_dir, builds_url) |
93 response = manifest.encode("utf-8") | 93 response = manifest.encode("utf-8") |
94 start_response("200 OK", [("Content-Type", "application/xml; charset=utf-8")]) | 94 start_response("200 OK", [("Content-Type", "application/xml; charset=utf-8")]) |
95 return [response] | 95 return [response] |
96 | 96 |
97 @url_handler("/adblockbrowser/updates.xml") | 97 @url_handler("/adblockbrowser/updates.xml") |
98 def adblockbrowser_updates(environ, start_response): | 98 def adblockbrowser_updates(environ, start_response): |
99 builds_dir = get_config().get("extensions", "downloadsDirectory") | 99 config = get_config() |
100 builds_url = get_config().get("extensions", "downloadsURL").rstrip("/") | 100 |
Sebastian Noack
2015/11/14 21:09:23
How about caching the config object instead callin
Felix Dahlke
2015/11/19 09:37:34
Done.
| |
101 builds_dir = config.get("extensions", "downloadsDirectory") | |
102 builds_url = config.get("extensions", "downloadsURL").rstrip("/") | |
103 | |
101 return _handle_request(environ, start_response, builds_dir, builds_url) | 104 return _handle_request(environ, start_response, builds_dir, builds_url) |
102 | 105 |
103 @url_handler("/devbuilds/adblockbrowser/updates.xml") | 106 @url_handler("/devbuilds/adblockbrowser/updates.xml") |
104 def adblockbrowser_devbuild_updates(environ, start_response): | 107 def adblockbrowser_devbuild_updates(environ, start_response): |
105 nightlies_dir = get_config().get("extensions", "nightliesDirectory") | 108 config = get_config() |
109 | |
110 nightlies_dir = config.get("extensions", "nightliesDirectory") | |
106 builds_dir = os.path.join(nightlies_dir, "adblockbrowser") | 111 builds_dir = os.path.join(nightlies_dir, "adblockbrowser") |
107 | 112 |
108 nightlies_url = get_config().get("extensions", "nightliesURL").rstrip("/") | 113 nightlies_url = config.get("extensions", "nightliesURL").rstrip("/") |
109 builds_url = "%s/adblockbrowser" % nightlies_url | 114 builds_url = "%s/adblockbrowser" % nightlies_url |
110 | 115 |
111 return _handle_request(environ, start_response, builds_dir, builds_url) | 116 return _handle_request(environ, start_response, builds_dir, builds_url) |
LEFT | RIGHT |