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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 from buildtools.packager import getDevEnvPath | 229 from buildtools.packager import getDevEnvPath |
230 devenv_dir = getDevEnvPath(baseDir) | 230 devenv_dir = getDevEnvPath(baseDir, type) |
231 | 231 |
232 shutil.rmtree(devenv_dir, ignore_errors=True) | 232 shutil.rmtree(devenv_dir, ignore_errors=True) |
233 | 233 |
234 file.seek(0) | 234 file.seek(0) |
235 with ZipFile(file, 'r') as zip_file: | 235 with ZipFile(file, 'r') as zip_file: |
236 zip_file.extractall(devenv_dir) | 236 zip_file.extractall(devenv_dir) |
237 | 237 |
238 | 238 |
239 def setupTranslations(baseDir, scriptName, opts, args, type): | 239 def setupTranslations(baseDir, scriptName, opts, args, type): |
240 if len(args) < 1: | 240 if len(args) < 1: |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 if option in ('-h', '--help'): | 571 if option in ('-h', '--help'): |
572 usage(scriptName, type, command) | 572 usage(scriptName, type, command) |
573 sys.exit() | 573 sys.exit() |
574 commands[command](baseDir, scriptName, opts, args, type) | 574 commands[command](baseDir, scriptName, opts, args, type) |
575 else: | 575 else: |
576 print 'Command %s is not supported for this application type' % command | 576 print 'Command %s is not supported for this application type' % command |
577 usage(scriptName, type) | 577 usage(scriptName, type) |
578 else: | 578 else: |
579 print 'Command %s is unrecognized' % command | 579 print 'Command %s is unrecognized' % command |
580 usage(scriptName, type) | 580 usage(scriptName, type) |
OLD | NEW |