Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: build.py

Issue 29727637: Issue 6503 - Fix builds on Windows (Closed)
Patch Set: Created March 20, 2018, 1:09 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 parser.add_argument(*args, **kwargs) 32 parser.add_argument(*args, **kwargs)
33 33
34 return partial(_make_argument, *args, **kwargs) 34 return partial(_make_argument, *args, **kwargs)
35 35
36 36
37 def argparse_command(valid_platforms=None, multi_platform=False, arguments=()): 37 def argparse_command(valid_platforms=None, multi_platform=False, arguments=()):
38 def wrapper(func): 38 def wrapper(func):
39 def func_wrapper(*args, **kwargs): 39 def func_wrapper(*args, **kwargs):
40 return func(*args, **kwargs) 40 return func(*args, **kwargs)
41 41
42 short_desc, long_desc = func.__doc__.split(os.linesep + os.linesep, 1) 42 short_desc, long_desc = func.__doc__.split('\n\n', 1)
43 43
44 ALL_COMMANDS.append({ 44 ALL_COMMANDS.append({
45 'name': func.__name__, 45 'name': func.__name__,
46 'description': long_desc, 46 'description': long_desc,
47 'help_text': short_desc, 47 'help_text': short_desc,
48 'valid_platforms': valid_platforms or KNOWN_PLATFORMS, 48 'valid_platforms': valid_platforms or KNOWN_PLATFORMS,
49 'multi_platform': multi_platform, 49 'multi_platform': multi_platform,
50 'function': func, 50 'function': func,
51 'arguments': arguments, 51 'arguments': arguments,
52 }) 52 })
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
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))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld