| OLD | NEW |
| 1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
| 2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | 4 |
| 5 import re | 5 import re |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 import codecs | 8 import codecs |
| 9 import json | 9 import json |
| 10 import urlparse | 10 import urlparse |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 CROWDIN_AP_URL = 'https://api.crowdin.com/api/project' | 38 CROWDIN_AP_URL = 'https://api.crowdin.com/api/project' |
| 39 FIREFOX_RELEASES_URL = 'http://www.mozilla.org/en-US/firefox/all.html' | 39 FIREFOX_RELEASES_URL = 'http://www.mozilla.org/en-US/firefox/all.html' |
| 40 FIREFOX_LP_URL = 'https://addons.mozilla.org/en-US/firefox/language-tools/' | 40 FIREFOX_LP_URL = 'https://addons.mozilla.org/en-US/firefox/language-tools/' |
| 41 CHROMIUM_DEB_URL = 'https://packages.debian.org/sid/all/chromium-l10n/filelist' | 41 CHROMIUM_DEB_URL = 'https://packages.debian.org/sid/all/chromium-l10n/filelist' |
| 42 | 42 |
| 43 | 43 |
| 44 def read_locale_config(baseDir, platform, metadata): | 44 def read_locale_config(baseDir, platform, metadata): |
| 45 if platform != 'generic': | 45 if platform != 'generic': |
| 46 import buildtools.packagerChrome as packager | 46 import buildtools.packagerChrome as packager |
| 47 localeDir = os.path.join(baseDir, '_locales') | 47 localeDir = os.path.join(baseDir, 'adblockplusui', 'locale') |
| 48 localeConfig = { | 48 localeConfig = { |
| 49 'default_locale': packager.defaultLocale, | 49 'default_locale': packager.defaultLocale, |
| 50 } | 50 } |
| 51 else: | 51 else: |
| 52 localeDir = os.path.join( | 52 localeDir = os.path.join( |
| 53 baseDir, *metadata.get('locales', 'base_path').split('/') | 53 baseDir, *metadata.get('locales', 'base_path').split('/') |
| 54 ) | 54 ) |
| 55 localeConfig = { | 55 localeConfig = { |
| 56 'default_locale': metadata.get('locales', 'default_locale'), | 56 'default_locale': metadata.get('locales', 'default_locale'), |
| 57 } | 57 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 # Remove any extra files | 318 # Remove any extra files |
| 319 for dir, files in dirs.iteritems(): | 319 for dir, files in dirs.iteritems(): |
| 320 baseDir = os.path.join(localeConfig['base_path'], dir) | 320 baseDir = os.path.join(localeConfig['base_path'], dir) |
| 321 if not os.path.exists(baseDir): | 321 if not os.path.exists(baseDir): |
| 322 continue | 322 continue |
| 323 for file in os.listdir(baseDir): | 323 for file in os.listdir(baseDir): |
| 324 path = os.path.join(baseDir, file) | 324 path = os.path.join(baseDir, file) |
| 325 valid_extension = file.endswith('.json') | 325 valid_extension = file.endswith('.json') |
| 326 if os.path.isfile(path) and valid_extension and not file in files: | 326 if os.path.isfile(path) and valid_extension and not file in files: |
| 327 os.remove(path) | 327 os.remove(path) |
| OLD | NEW |