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

Delta Between Two Patch Sets: sitescripts/extensions/utils.py

Issue 30017558: Noissue - Use latest stable AMO api (Closed) Base URL: https://hg.adblockplus.org/abpssembly/file/776cf4ca9d1d
Left Patch Set: Created Feb. 25, 2019, 9:03 a.m.
Right Patch Set: Created Feb. 25, 2019, 9:36 a.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 | « no previous file | 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 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 def _getMozillaDownloadLink(galleryID): 276 def _getMozillaDownloadLink(galleryID):
277 """ 277 """
278 gets download link for a Gecko add-on from the Mozilla Addons site 278 gets download link for a Gecko add-on from the Mozilla Addons site
279 """ 279 """
280 url = 'https://addons.mozilla.org/api/v3/addons/addon/' + galleryID 280 url = 'https://addons.mozilla.org/api/v3/addons/addon/' + galleryID
281 with _urlopen(url) as data: 281 with _urlopen(url) as data:
282 result = json.load(data) 282 result = json.load(data)
283 283
284 return ( 284 return (
285 result['current_version']['files'][0]['url'], 285 result['current_version']['files'][0]['url'],
286 result['current_version']['version'] 286 result['current_version']['version'],
287 ) 287 )
288 288
289 289
290 def _getLocalLink(repo): 290 def _getLocalLink(repo):
291 """ 291 """
292 gets the link for the newest download of an add-on in the local downloads 292 gets the link for the newest download of an add-on in the local downloads
293 repository 293 repository
294 """ 294 """
295 highestURL = None 295 highestURL = None
296 highestVersion = None 296 highestVersion = None
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if not extensions: 395 if not extensions:
396 return 396 return
397 397
398 updates = {} 398 updates = {}
399 for extension in extensions: 399 for extension in extensions:
400 updates[extension['basename']] = { 400 updates[extension['basename']] = {
401 'url': extension['updateURL'], 401 'url': extension['updateURL'],
402 'version': extension['version'], 402 'version': extension['version'],
403 } 403 }
404 writeLibabpUpdateManifest(path, updates) 404 writeLibabpUpdateManifest(path, updates)
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld