Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 os | 5 import os |
6 import sys | 6 import sys |
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import shutil | 9 import shutil |
10 from getopt import getopt, GetoptError | 10 from getopt import getopt, GetoptError |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 devenv_dir = getDevEnvPath(baseDir, type) | 211 devenv_dir = getDevEnvPath(baseDir, type) |
212 | 212 |
213 shutil.rmtree(devenv_dir, ignore_errors=True) | 213 shutil.rmtree(devenv_dir, ignore_errors=True) |
214 | 214 |
215 file.seek(0) | 215 file.seek(0) |
216 with ZipFile(file, 'r') as zip_file: | 216 with ZipFile(file, 'r') as zip_file: |
217 zip_file.extractall(devenv_dir) | 217 zip_file.extractall(devenv_dir) |
218 | 218 |
219 | 219 |
220 def readLocaleConfig(baseDir, type, metadata): | 220 def readLocaleConfig(baseDir, type, metadata): |
221 if type != 'generic': | 221 if type != 'generic': |
Vasily Kuznetsov
2017/10/10 12:44:33
We could swap the branches of this if statement to
tlucas
2017/10/10 12:50:13
Well, imho the "not generic" platforms are those m
| |
222 import buildtools.packagerChrome as packager | 222 import buildtools.packagerChrome as packager |
223 localeDir = os.path.join(baseDir, '_locales') | 223 localeDir = os.path.join(baseDir, '_locales') |
224 localeConfig = { | 224 localeConfig = { |
225 'default_locale': packager.defaultLocale, | 225 'default_locale': packager.defaultLocale, |
226 } | 226 } |
227 else: | 227 else: |
228 localeDir = os.path.join( | 228 localeDir = os.path.join( |
229 baseDir, *metadata.get('locales', 'base_path').split('/') | 229 baseDir, *metadata.get('locales', 'base_path').split('/') |
230 ) | 230 ) |
231 localeConfig = { | 231 localeConfig = { |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 if option in ('-h', '--help'): | 508 if option in ('-h', '--help'): |
509 usage(scriptName, type, command) | 509 usage(scriptName, type, command) |
510 sys.exit() | 510 sys.exit() |
511 commands[command](baseDir, scriptName, opts, args, type) | 511 commands[command](baseDir, scriptName, opts, args, type) |
512 else: | 512 else: |
513 print 'Command %s is not supported for this application type' % comm and | 513 print 'Command %s is not supported for this application type' % comm and |
514 usage(scriptName, type) | 514 usage(scriptName, type) |
515 else: | 515 else: |
516 print 'Command %s is unrecognized' % command | 516 print 'Command %s is unrecognized' % command |
517 usage(scriptName, type) | 517 usage(scriptName, type) |
LEFT | RIGHT |