OLD | NEW |
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-2013 Eyeo GmbH | 4 # Copyright (C) 2006-2013 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join(r
epo.repository, 'AndroidManifest.xml')] | 183 command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join(r
epo.repository, 'AndroidManifest.xml')] |
184 result = subprocess.check_output(command) | 184 result = subprocess.check_output(command) |
185 manifest = dom.parseString(result) | 185 manifest = dom.parseString(result) |
186 usesSdk = manifest.getElementsByTagName('uses-sdk')[0] | 186 usesSdk = manifest.getElementsByTagName('uses-sdk')[0] |
187 | 187 |
188 return { | 188 return { |
189 'revision': revision, | 189 'revision': revision, |
190 'minSdkVersion': usesSdk.attributes["android:minSdkVersion"].value, | 190 'minSdkVersion': usesSdk.attributes["android:minSdkVersion"].value, |
191 } | 191 } |
192 else: | 192 else: |
193 try: | 193 files = subprocess.check_output(['hg', '-R', repo.repository, 'locate', '-r'
, version]).splitlines() |
| 194 if 'metadata.%s' % repo.type in files: |
194 command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join
(repo.repository, 'metadata.%s' % repo.type)] | 195 command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join
(repo.repository, 'metadata.%s' % repo.type)] |
195 result = subprocess.check_output(command) | 196 result = subprocess.check_output(command) |
196 except: | 197 else: |
197 # Fall back to platform-independent metadata file for now | 198 # Fall back to platform-independent metadata file for now |
198 command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join
(repo.repository, 'metadata')] | 199 command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join
(repo.repository, 'metadata')] |
199 result = subprocess.check_output(command) | 200 result = subprocess.check_output(command) |
200 | 201 |
201 parser = SafeConfigParser() | 202 parser = SafeConfigParser() |
202 parser.readfp(StringIO(result)) | 203 parser.readfp(StringIO(result)) |
203 | 204 |
204 result = { | 205 result = { |
205 'extensionID': parser.get('general', 'id'), | 206 'extensionID': parser.get('general', 'id'), |
206 'version': version, | 207 'version': version, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 result = SafeConfigParser() | 243 result = SafeConfigParser() |
243 getDownloadLinks(result) | 244 getDownloadLinks(result) |
244 file = open(get_config().get('extensions', 'downloadLinksFile'), 'wb') | 245 file = open(get_config().get('extensions', 'downloadLinksFile'), 'wb') |
245 result.write(file) | 246 result.write(file) |
246 file.close() | 247 file.close() |
247 | 248 |
248 writeUpdateManifest(result) | 249 writeUpdateManifest(result) |
249 | 250 |
250 if __name__ == "__main__": | 251 if __name__ == "__main__": |
251 updateLinks() | 252 updateLinks() |
OLD | NEW |