OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
4 # License, v. 2.0. If a copy of the MPL was not distributed with this | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
6 | 6 |
7 import os, sys, re, subprocess, shutil, buildtools | 7 import os, sys, re, subprocess, shutil, buildtools |
8 from getopt import getopt, GetoptError | 8 from getopt import getopt, GetoptError |
9 from StringIO import StringIO | 9 from StringIO import StringIO |
10 from zipfile import ZipFile | 10 from zipfile import ZipFile |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 def createDevEnv(baseDir, scriptName, opts, args, type): | 220 def createDevEnv(baseDir, scriptName, opts, args, type): |
221 if type == 'safari': | 221 if type == 'safari': |
222 import buildtools.packagerSafari as packager | 222 import buildtools.packagerSafari as packager |
223 else: | 223 else: |
224 import buildtools.packagerChrome as packager | 224 import buildtools.packagerChrome as packager |
225 | 225 |
226 file = StringIO() | 226 file = StringIO() |
227 packager.createBuild(baseDir, type=type, outFile=file, devenv=True, releaseBui
ld=True) | 227 packager.createBuild(baseDir, type=type, outFile=file, devenv=True, releaseBui
ld=True) |
228 | 228 |
229 devenv_dir = os.path.join(baseDir, 'devenv') | 229 from buildtools.packager import getDevEnvPath |
| 230 devenv_dir = getDevEnvPath(baseDir) |
| 231 |
230 shutil.rmtree(devenv_dir, ignore_errors=True) | 232 shutil.rmtree(devenv_dir, ignore_errors=True) |
231 | 233 |
232 file.seek(0) | 234 file.seek(0) |
233 with ZipFile(file, 'r') as zip_file: | 235 with ZipFile(file, 'r') as zip_file: |
234 zip_file.extractall(devenv_dir) | 236 zip_file.extractall(devenv_dir) |
235 | 237 |
236 | 238 |
237 def setupTranslations(baseDir, scriptName, opts, args, type): | 239 def setupTranslations(baseDir, scriptName, opts, args, type): |
238 if len(args) < 1: | 240 if len(args) < 1: |
239 print 'Project key is required to update translation master files.' | 241 print 'Project key is required to update translation master files.' |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 if option in ('-h', '--help'): | 571 if option in ('-h', '--help'): |
570 usage(scriptName, type, command) | 572 usage(scriptName, type, command) |
571 sys.exit() | 573 sys.exit() |
572 commands[command](baseDir, scriptName, opts, args, type) | 574 commands[command](baseDir, scriptName, opts, args, type) |
573 else: | 575 else: |
574 print 'Command %s is not supported for this application type' % command | 576 print 'Command %s is not supported for this application type' % command |
575 usage(scriptName, type) | 577 usage(scriptName, type) |
576 else: | 578 else: |
577 print 'Command %s is unrecognized' % command | 579 print 'Command %s is unrecognized' % command |
578 usage(scriptName, type) | 580 usage(scriptName, type) |
OLD | NEW |