mirror of https://github.com/ARMmbed/mbed-os.git
Clean up formatting of device_management.py
parent
93309cd134
commit
a6163cb14f
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue