| Left: | ||
| Right: |
| 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 argparse | 5 import argparse |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shutil | 9 import shutil |
| 10 import subprocess | 10 import subprocess |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 | 120 |
| 121 | 121 |
| 122 build_available_subcommands._result = None | 122 build_available_subcommands._result = None |
| 123 | 123 |
| 124 | 124 |
| 125 @argparse_command( | 125 @argparse_command( |
| 126 valid_platforms={'chrome', 'gecko', 'edge'}, | 126 valid_platforms={'chrome', 'gecko', 'edge'}, |
| 127 arguments=( | 127 arguments=( |
| 128 make_argument( | 128 make_argument( |
| 129 '-b', '--build-num', dest='build_num', | 129 '-b', '--build-num', dest='build_num', |
| 130 help=('Use given build number (if omitted the build number will ' | 130 help='Use given build number (if omitted the build number will ' |
| 131 'be retrieved from Mercurial)')), | 131 'be retrieved from Mercurial)'), |
|
Sebastian Noack
2018/01/17 00:44:54
The indentation is off by one. Please align subseq
rosie
2018/01/25 19:22:19
Done.
| |
| 132 make_argument( | 132 make_argument( |
| 133 '-k', '--key', dest='key_file', | 133 '-k', '--key', dest='key_file', |
| 134 help=('File containing private key and certificates required to ' | 134 help='File containing private key and certificates required to ' |
| 135 'sign the package')), | 135 'sign the package'), |
| 136 make_argument( | 136 make_argument( |
| 137 '-r', '--release', action='store_true', | 137 '-r', '--release', action='store_true', |
| 138 help='Create a release build'), | 138 help='Create a release build'), |
| 139 make_argument('output_file', nargs='?') | 139 make_argument('output_file', nargs='?') |
| 140 ) | 140 ) |
| 141 ) | 141 ) |
| 142 def build(base_dir, build_num, key_file, release, output_file, platform, | 142 def build(base_dir, build_num, key_file, release, output_file, platform, |
| 143 **kwargs): | 143 **kwargs): |
| 144 """ | 144 """ |
| 145 Create a build. | 145 Create a build. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 raise argparse.ArgumentTypeError('Wrong version number format') | 323 raise argparse.ArgumentTypeError('Wrong version number format') |
| 324 | 324 |
| 325 return value | 325 return value |
| 326 | 326 |
| 327 | 327 |
| 328 @argparse_command( | 328 @argparse_command( |
| 329 valid_platforms={'chrome', 'gecko', 'edge'}, multi_platform=True, | 329 valid_platforms={'chrome', 'gecko', 'edge'}, multi_platform=True, |
| 330 arguments=( | 330 arguments=( |
| 331 make_argument( | 331 make_argument( |
| 332 '-k', '--key', dest='key_file', | 332 '-k', '--key', dest='key_file', |
| 333 help=('File containing private key and certificates required to ' | 333 help='File containing private key and certificates required to ' |
| 334 'sign the release.')), | 334 'sign the release.'), |
| 335 make_argument( | 335 make_argument( |
| 336 '-d', '--downloads-repository', dest='downloads_repository', | 336 '-d', '--downloads-repository', dest='downloads_repository', |
| 337 help=('Directory containing downloads repository (if omitted ' | 337 help='Directory containing downloads repository (if omitted ' |
| 338 '../downloads is assumed)')), | 338 '../downloads is assumed)'), |
| 339 make_argument( | 339 make_argument( |
| 340 'version', help='Version number of the release', | 340 'version', help='Version number of the release', |
| 341 type=valid_version_format) | 341 type=valid_version_format) |
| 342 ) | 342 ) |
| 343 ) | 343 ) |
| 344 def release(base_dir, downloads_repository, key_file, platform, version, | 344 def release(base_dir, downloads_repository, key_file, platform, version, |
| 345 **kwargs): | 345 **kwargs): |
| 346 """ | 346 """ |
| 347 Run release automation. | 347 Run release automation. |
| 348 | 348 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 379 if build_available_subcommands(base_dir): | 379 if build_available_subcommands(base_dir): |
| 380 MAIN_PARSER.set_defaults(base_dir=base_dir) | 380 MAIN_PARSER.set_defaults(base_dir=base_dir) |
| 381 | 381 |
| 382 # If no args are provided, this module is run directly from the command | 382 # If no args are provided, this module is run directly from the command |
| 383 # line. argparse will take care of consuming sys.argv. | 383 # line. argparse will take care of consuming sys.argv. |
| 384 arguments = MAIN_PARSER.parse_args(args if len(args) > 0 else None) | 384 arguments = MAIN_PARSER.parse_args(args if len(args) > 0 else None) |
| 385 | 385 |
| 386 function = arguments.function | 386 function = arguments.function |
| 387 del arguments.function | 387 del arguments.function |
| 388 function(**vars(arguments)) | 388 function(**vars(arguments)) |
| OLD | NEW |