LEFT | RIGHT |
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 Loading... |
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 Loading... |
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) |
LEFT | RIGHT |