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 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 import buildtools | 10 import buildtools |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 No command given, assuming "build". For a list of commands run: | 590 No command given, assuming "build". For a list of commands run: |
591 | 591 |
592 %s help | 592 %s help |
593 ''' % scriptName | 593 ''' % scriptName |
594 | 594 |
595 command = args[0] | 595 command = args[0] |
596 if command in commands: | 596 if command in commands: |
597 if commands[command].isSupported(type): | 597 if commands[command].isSupported(type): |
598 try: | 598 try: |
599 opts, args = commands[command].parseArgs(type, args[1:]) | 599 opts, args = commands[command].parseArgs(type, args[1:]) |
600 except GetoptError, e: | 600 except GetoptError as e: |
601 print str(e) | 601 print str(e) |
602 usage(scriptName, type, command) | 602 usage(scriptName, type, command) |
603 sys.exit(2) | 603 sys.exit(2) |
604 for option, value in opts: | 604 for option, value in opts: |
605 if option in ('-h', '--help'): | 605 if option in ('-h', '--help'): |
606 usage(scriptName, type, command) | 606 usage(scriptName, type, command) |
607 sys.exit() | 607 sys.exit() |
608 commands[command](baseDir, scriptName, opts, args, type) | 608 commands[command](baseDir, scriptName, opts, args, type) |
609 else: | 609 else: |
610 print 'Command %s is not supported for this application type' % comm
and | 610 print 'Command %s is not supported for this application type' % comm
and |
611 usage(scriptName, type) | 611 usage(scriptName, type) |
612 else: | 612 else: |
613 print 'Command %s is unrecognized' % command | 613 print 'Command %s is unrecognized' % command |
614 usage(scriptName, type) | 614 usage(scriptName, type) |
OLD | NEW |