33
33
34
34
35
35
LOG = logging .getLogger (__name__ )
36
- LOG_FORMAT = '[%(levelname)s] %(asctime)s - %(name)s - %(message)s'
36
+ LOG_FORMAT = '[%(levelname)s] %(asctime)s - %(name)s - %(message)s'
37
37
38
38
# Be sure that the tools directory is in the search path
39
39
ROOT = abspath (join (dirname (__file__ ), ".." ))
42
42
from tools .config import Config
43
43
from tools .options import extract_mcus
44
44
45
+
45
46
class MbedExtendedArgs (MainArgumentParser ):
46
47
def _addCreateArgs (self , parser , exclusions = []):
47
48
if 'payload' not in exclusions :
48
- parser .add_argument ('-p' , '--payload' ,
49
+ parser .add_argument (
50
+ '-p' , '--payload' ,
49
51
help = 'Supply a local copy of the payload file.'
50
- 'This option overrides any payload file supplied in a `-i` argument.' ,
52
+ 'This option overrides any payload file supplied in a '
53
+ '`-i` argument.' ,
51
54
metavar = 'FILE' ,
52
55
type = argparse .FileType ('rb' )
53
56
)
@@ -61,10 +64,7 @@ def _addCreateArgs(self, parser, exclusions=[]):
61
64
62
65
def wrap_payload (func ):
63
66
def inner (options ):
64
- if (not options .payload and
65
- options .mcu and
66
- options .build
67
- ):
67
+ if not options .payload and options .mcu and options .build :
68
68
mcus = extract_mcus (MbedExtendedArgs (), options )
69
69
sources = options .source_dir or ['.' ]
70
70
config = Config (mcus [0 ], sources )
@@ -146,7 +146,7 @@ def main():
146
146
"verify" : verify .main ,
147
147
"cert" : cert .main ,
148
148
"init" : wrap_init (init .main ),
149
- "update" : wrap_payload (update .main ),
149
+ "update" : wrap_payload (update .main ),
150
150
}[options .action ](options ) or 0
151
151
152
152
sys .exit (rc )
0 commit comments