| 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 17 matching lines...) Expand all  Loading... | 
| 28 from StringIO import StringIO | 28 from StringIO import StringIO | 
| 29 from sitescripts.utils import get_config | 29 from sitescripts.utils import get_config | 
| 30 from xml.parsers.expat import ExpatError | 30 from xml.parsers.expat import ExpatError | 
| 31 | 31 | 
| 32 PACKAGE_SUFFIXES = { | 32 PACKAGE_SUFFIXES = { | 
| 33     'gecko': '.xpi', | 33     'gecko': '.xpi', | 
| 34     'chrome': '.crx', | 34     'chrome': '.crx', | 
| 35     'safari': '.safariextz', | 35     'safari': '.safariextz', | 
| 36     'ie': '.exe', | 36     'ie': '.exe', | 
| 37     'android': '.apk', | 37     'android': '.apk', | 
| 38     'edge': '.appx' | 38     'edge': '.appx', | 
| 39 } | 39 } | 
| 40 | 40 | 
| 41 | 41 | 
| 42 def compareVersionParts(part1, part2): | 42 def compareVersionParts(part1, part2): | 
| 43     def convertInt(value, default): | 43     def convertInt(value, default): | 
| 44         try: | 44         try: | 
| 45             return int(value) | 45             return int(value) | 
| 46         except ValueError: | 46         except ValueError: | 
| 47             return default | 47             return default | 
| 48 | 48 | 
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 373     if not extensions: | 373     if not extensions: | 
| 374         return | 374         return | 
| 375 | 375 | 
| 376     updates = {} | 376     updates = {} | 
| 377     for extension in extensions: | 377     for extension in extensions: | 
| 378         basename = extension['basename'] | 378         basename = extension['basename'] | 
| 379         updateURL = extension['updateURL'] | 379         updateURL = extension['updateURL'] | 
| 380         version = extension['version'] | 380         version = extension['version'] | 
| 381         updates['%s/%s' % (basename, 'msie64')] = { | 381         updates['%s/%s' % (basename, 'msie64')] = { | 
| 382             'url': updateURL.replace('.exe', '-x64.msi'), | 382             'url': updateURL.replace('.exe', '-x64.msi'), | 
| 383             'version': version | 383             'version': version, | 
| 384         } | 384         } | 
| 385         updates['%s/%s' % (basename, 'msie32')] = { | 385         updates['%s/%s' % (basename, 'msie32')] = { | 
| 386             'url': updateURL.replace('.exe', '-x86.msi'), | 386             'url': updateURL.replace('.exe', '-x86.msi'), | 
| 387             'version': version | 387             'version': version, | 
| 388         } | 388         } | 
| 389     writeLibabpUpdateManifest(path, updates) | 389     writeLibabpUpdateManifest(path, updates) | 
| 390 | 390 | 
| 391 | 391 | 
| 392 def writeAndroidUpdateManifest(path, extensions): | 392 def writeAndroidUpdateManifest(path, extensions): | 
| 393     """ | 393     """ | 
| 394       Writes update.json for Android | 394       Writes update.json for Android | 
| 395     """ | 395     """ | 
| 396 | 396 | 
| 397     if not extensions: | 397     if not extensions: | 
| 398         return | 398         return | 
| 399 | 399 | 
| 400     updates = {} | 400     updates = {} | 
| 401     for extension in extensions: | 401     for extension in extensions: | 
| 402         updates[extension['basename']] = { | 402         updates[extension['basename']] = { | 
| 403             'url': extension['updateURL'], | 403             'url': extension['updateURL'], | 
| 404             'version': extension['version'] | 404             'version': extension['version'], | 
| 405         } | 405         } | 
| 406     writeLibabpUpdateManifest(path, updates) | 406     writeLibabpUpdateManifest(path, updates) | 
| LEFT | RIGHT | 
|---|