Clean up formatting of device_management.py

pull/7844/head
Jimmy Brisson 2018-08-21 10:35:27 -05:00
parent 93309cd134
commit a6163cb14f
1 changed files with 8 additions and 8 deletions

View File

@ -42,12 +42,15 @@ sys.path.insert(0, ROOT)
from tools.config import Config from tools.config import Config
from tools.options import extract_mcus from tools.options import extract_mcus
class MbedExtendedArgs(MainArgumentParser): class MbedExtendedArgs(MainArgumentParser):
def _addCreateArgs(self, parser, exclusions=[]): def _addCreateArgs(self, parser, exclusions=[]):
if 'payload' not in exclusions: if 'payload' not in exclusions:
parser.add_argument('-p', '--payload', parser.add_argument(
'-p', '--payload',
help='Supply a local copy of the payload file.' help='Supply a local copy of the payload file.'
'This option overrides any payload file supplied in a `-i` argument.', 'This option overrides any payload file supplied in a '
'`-i` argument.',
metavar='FILE', metavar='FILE',
type=argparse.FileType('rb') type=argparse.FileType('rb')
) )
@ -61,10 +64,7 @@ class MbedExtendedArgs(MainArgumentParser):
def wrap_payload(func): def wrap_payload(func):
def inner(options): def inner(options):
if (not options.payload and if not options.payload and options.mcu and options.build:
options.mcu and
options.build
):
mcus = extract_mcus(MbedExtendedArgs(), options) mcus = extract_mcus(MbedExtendedArgs(), options)
sources = options.source_dir or ['.'] sources = options.source_dir or ['.']
config = Config(mcus[0], sources) config = Config(mcus[0], sources)