Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: sitescripts/extensions/web/adblockbrowserUpdates.py

Issue 29330140: Issue 3312 - Serve release update manifests for Adblock Browser (Closed)
Left Patch Set: Don't call get_config() multiple times in a row Created Nov. 19, 2015, 9:37 a.m.
Right Patch Set: Add some whitespace Created Nov. 19, 2015, 3:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « .sitescripts.example ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 config = get_config() 99 config = get_config()
100
100 builds_dir = config.get("extensions", "downloadsDirectory") 101 builds_dir = config.get("extensions", "downloadsDirectory")
Sebastian Noack 2015/11/19 09:48:40 Mit: Please set newlines consistent with the handl
Felix Dahlke 2015/11/19 09:50:34 IMHO, readlines only help readability in rare case
Felix Dahlke 2015/11/19 09:51:12 s/readlines/newlines/ :)
Sebastian Noack 2015/11/19 09:53:01 I think it does, but I guess it's matter of taste.
Felix Dahlke 2015/11/19 15:55:23 Changed it since you do disagree.
101 builds_url = config.get("extensions", "downloadsURL").rstrip("/") 102 builds_url = config.get("extensions", "downloadsURL").rstrip("/")
103
102 return _handle_request(environ, start_response, builds_dir, builds_url) 104 return _handle_request(environ, start_response, builds_dir, builds_url)
103 105
104 @url_handler("/devbuilds/adblockbrowser/updates.xml") 106 @url_handler("/devbuilds/adblockbrowser/updates.xml")
105 def adblockbrowser_devbuild_updates(environ, start_response): 107 def adblockbrowser_devbuild_updates(environ, start_response):
106 config = get_config() 108 config = get_config()
107 109
108 nightlies_dir = config.get("extensions", "nightliesDirectory") 110 nightlies_dir = config.get("extensions", "nightliesDirectory")
109 builds_dir = os.path.join(nightlies_dir, "adblockbrowser") 111 builds_dir = os.path.join(nightlies_dir, "adblockbrowser")
110 112
111 nightlies_url = config.get("extensions", "nightliesURL").rstrip("/") 113 nightlies_url = config.get("extensions", "nightliesURL").rstrip("/")
112 builds_url = "%s/adblockbrowser" % nightlies_url 114 builds_url = "%s/adblockbrowser" % nightlies_url
113 115
114 return _handle_request(environ, start_response, builds_dir, builds_url) 116 return _handle_request(environ, start_response, builds_dir, builds_url)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld