Skip to content

Commit 5a14a1b

Browse files
committed
Further pylint fixes
1 parent 7f41a57 commit 5a14a1b

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

mbed/mbed.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def thunk(parsed_args):
949949
dict(name='--depth', nargs='?', help='Number of revisions to fetch the mbed-os repository when creating new program. Default: all revisions.'),
950950
dict(name='--protocol', nargs='?', help='Transport protocol when fetching the mbed-os repository when creating new program. Supported: https, http, ssh, git. Default: inferred from URL.'),
951951
help='Create a new program based on the specified source control management. Will create a new library when called from inside a local program. Supported SCMs: %s.' % (', '.join([s.name for s in scms.values()])))
952-
def new(name, scm='git', depth=None, protocol=None):
952+
def new(name, tscm='git', depth=None, protocol=None):
953953
global cwd_root
954954

955955
d_path = name or os.getcwd()
@@ -962,7 +962,7 @@ def new(name, scm='git', depth=None, protocol=None):
962962
# Find parent repository before the new one is created
963963
p_path = Repo.findrepo(d_path)
964964

965-
repo_scm = [s for s in scms.values() if s.name == scm.lower()]
965+
repo_scm = [s for s in scms.values() if s.name == tscm.lower()]
966966
if not repo_scm:
967967
error("Please specify one of the following source control management systems: %s" % ', '.join([s.name for s in scms.values()]), 1)
968968

@@ -1041,7 +1041,7 @@ def import_(url, path=None, depth=None, protocol=None, top=True):
10411041
@subcommand('deploy',
10421042
dict(name='--depth', nargs='?', help='Number of revisions to fetch from the remote repository. Default: all revisions.'),
10431043
dict(name='--protocol', nargs='?', help='Transport protocol for the source control management. Supported: https, http, ssh, git. Default: inferred from URL.'),
1044-
help="Import missing dependencies in the current program or library.")
1044+
help='Import missing dependencies in the current program or library.')
10451045
def deploy(depth=None, protocol=None):
10461046
repo = Repo.fromrepo()
10471047
repo.scm.ignores(repo)
@@ -1058,8 +1058,8 @@ def deploy(depth=None, protocol=None):
10581058

10591059
# Add library command
10601060
@subcommand('add',
1061-
dict(name='url', help="URL of the library"),
1062-
dict(name='path', nargs='?', help="Destination name or path. Default: current folder."),
1061+
dict(name='url', help='URL of the library'),
1062+
dict(name='path', nargs='?', help='Destination name or path. Default: current folder.'),
10631063
dict(name='--depth', nargs='?', help='Number of revisions to fetch from the remote repository. Default: all revisions.'),
10641064
dict(name='--protocol', nargs='?', help='Transport protocol for the source control management. Supported: https, http, ssh, git. Default: inferred from URL.'),
10651065
help='Add a library and its dependencies into the current %s or specified destination path.' % cwd_type)
@@ -1077,7 +1077,7 @@ def add(url, path=None, depth=None, protocol=None):
10771077

10781078
# Remove library
10791079
@subcommand('remove',
1080-
dict(name='path', help="Local library name or path"),
1080+
dict(name='path', help='Local library name or path'),
10811081
help='Remove specified library and its dependencies from the current %s.' % cwd_type)
10821082
def remove(path):
10831083
repo = Repo.fromrepo()
@@ -1093,7 +1093,7 @@ def remove(path):
10931093

10941094
# Publish command
10951095
@subcommand('publish',
1096-
dict(name=['-A', '--all'], action="store_true", help="Publish all branches, including new. Default: push only the current branch."),
1096+
dict(name=['-A', '--all'], action='store_true', help='Publish all branches, including new. Default: push only the current branch.'),
10971097
help='Publish current %s and its dependencies to associated remote repository URLs.' % cwd_type)
10981098
def publish(all=None, top=True):
10991099
if top:
@@ -1129,10 +1129,10 @@ def publish(all=None, top=True):
11291129

11301130
# Update command
11311131
@subcommand('update',
1132-
dict(name='rev', nargs='?', help="Revision hash, tag or branch"),
1133-
dict(name=['-C', '--clean'], action="store_true", help="Perform a clean update and discard all local changes. WARNING: This action cannot be undone. Use with caution."),
1134-
dict(name=['-F', '--force'], action="store_true", help="Enforce the original layout and will remove any local libraries and also libraries containing uncommitted or unpublished changes. WARNING: This action cannot be undone. Use with caution."),
1135-
dict(name=['-I', '--ignore'], action="store_true", help="Ignore errors regarding unpiblished libraries, unpublished or uncommitted changes, and attempt to update from associated remote repository URLs."),
1132+
dict(name='rev', nargs='?', help='Revision hash, tag or branch'),
1133+
dict(name=['-C', '--clean'], action='store_true', help='Perform a clean update and discard all local changes. WARNING: This action cannot be undone. Use with caution.'),
1134+
dict(name=['-F', '--force'], action='store_true', help='Enforce the original layout and will remove any local libraries and also libraries containing uncommitted or unpublished changes. WARNING: This action cannot be undone. Use with caution.'),
1135+
dict(name=['-I', '--ignore'], action='store_true', help='Ignore errors regarding unpublished libraries, unpublished or uncommitted changes, and attempt to update from associated remote repository URLs.'),
11361136
dict(name='--depth', nargs='?', help='Number of revisions to fetch from the remote repository. Default: all revisions.'),
11371137
dict(name='--protocol', nargs='?', help='Transport protocol for the source control management. Supported: https, http, ssh, git. Default: inferred from URL.'),
11381138
help='Update current %s and its dependencies from associated remote repository URLs.' % cwd_type)
@@ -1259,8 +1259,8 @@ def sync(recursive=True, keep_refs=False, top=True):
12591259

12601260
# List command
12611261
@subcommand('ls',
1262-
dict(name=['-a', '--all'], action='store_true', help="List repository URL and hash pairs"),
1263-
dict(name=['-I', '--ignore'], action="store_true", help="Ignore errors regarding missing libraries."),
1262+
dict(name=['-a', '--all'], action='store_true', help='List repository URL and hash pairs'),
1263+
dict(name=['-I', '--ignore'], action='store_true', help='Ignore errors regarding missing libraries.'),
12641264
help='View the current %s dependency tree.' % cwd_type)
12651265
def list_(all=False, prefix='', p_path=None, ignore=False):
12661266
repo = Repo.fromrepo()
@@ -1280,7 +1280,7 @@ def list_(all=False, prefix='', p_path=None, ignore=False):
12801280

12811281
# Command status for cross-SCM status of repositories
12821282
@subcommand('status',
1283-
dict(name=['-I', '--ignore'], action="store_true", help="Ignore errors regarding missing libraries."),
1283+
dict(name=['-I', '--ignore'], action='store_true', help='Ignore errors regarding missing libraries.'),
12841284
help='Show status of the current %s and its dependencies.' % cwd_type)
12851285
def status(ignore=False):
12861286
repo = Repo.fromrepo()
@@ -1296,12 +1296,12 @@ def status(ignore=False):
12961296

12971297
# Compile command which invokes the mbed OS native build system
12981298
@subcommand('compile',
1299-
dict(name=['-t', '--toolchain'], help="Compile toolchain. Example: ARM, uARM, GCC_ARM, IAR"),
1300-
dict(name=['-m', '--mcu'], help="Compile target. Example: K64F, NUCLEO_F401RE, NRF51822..."),
1301-
dict(name='--source', action="append", help="Source directory. Default: . (current dir)"),
1302-
dict(name='--build', help="Build directory. Default: .build/"),
1303-
dict(name='--library', dest="compile_library", action="store_true", help="Compile the current %s as a static library." % cwd_type),
1304-
dict(name='--tests', dest="compile_tests", action="store_true", help="Compile tests in TESTS directory."),
1299+
dict(name=['-t', '--toolchain'], help='Compile toolchain. Example: ARM, uARM, GCC_ARM, IAR'),
1300+
dict(name=['-m', '--mcu'], help='Compile target. Example: K64F, NUCLEO_F401RE, NRF51822...'),
1301+
dict(name='--source', action='append', help='Source directory. Default: . (current dir)'),
1302+
dict(name='--build', help='Build directory. Default: .build/'),
1303+
dict(name='--library', dest='compile_library', action='store_true', help='Compile the current %s as a static library.' % cwd_type),
1304+
dict(name='--tests', dest='compile_tests', action='store_true', help='Compile tests in TESTS directory.'),
13051305
dict(name='--test_spec', dest="test_spec", help="Destination path for a test spec file that can be used by the Greentea automated test tool. (Default is 'test_spec.json')"),
13061306
help='Compile program using the native mbed OS build system.')
13071307
def compile(toolchain=None, mcu=None, source=False, build=False, compile_library=False, compile_tests=False, test_spec="test_spec.json"):
@@ -1384,9 +1384,9 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
13841384

13851385
# Test command
13861386
@subcommand('test',
1387-
dict(name=['-l', '--list'], action="store_true", help="List all of the available tests"),
1387+
dict(name=['-l', '--list'], dest='tlist', action='store_true', help='List all of the available tests'),
13881388
help='Find and build tests in a program and its libraries.')
1389-
def test(list=False):
1389+
def test(tlist=False):
13901390
# Gather remaining arguments
13911391
args = remainder
13921392
# Find the root of the program
@@ -1400,7 +1400,7 @@ def test(list=False):
14001400
# Prepare environment variables
14011401
env = os.environ.copy()
14021402
env['PYTHONPATH'] = '.'
1403-
if list:
1403+
if tlist:
14041404
# List all available tests (by default in a human-readable format)
14051405
try:
14061406
popen(['python', 'mbed-os/tools/test.py', '-l'] + args, env=env)
@@ -1410,8 +1410,8 @@ def test(list=False):
14101410

14111411
# Export command
14121412
@subcommand('export',
1413-
dict(name=['-i', '--ide'], help="IDE to create project files for. Example: UVISION,DS5,IAR", required=True),
1414-
dict(name=['-m', '--mcu'], help="Export for target MCU. Example: K64F, NUCLEO_F401RE, NRF51822..."),
1413+
dict(name=['-i', '--ide'], help='IDE to create project files for. Example: UVISION,DS5,IAR', required=True),
1414+
dict(name=['-m', '--mcu'], help='Export for target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...'),
14151415
help='Generate project files for desktop IDEs for the current program.')
14161416
def export(ide=None, mcu=None):
14171417
# Gather remaining arguments
@@ -1443,9 +1443,9 @@ def export(ide=None, mcu=None):
14431443

14441444
# Build system and exporters
14451445
@subcommand('target',
1446-
dict(name='name', nargs='?', help="Default target name. Example: K64F, NUCLEO_F401RE, NRF51822..."),
1446+
dict(name='name', nargs='?', help='Default target name. Example: K64F, NUCLEO_F401RE, NRF51822...'),
14471447
help='Set default target for the current program.')
1448-
def target(name=None):
1448+
def target_(name=None):
14491449
# Find the root of the program
14501450
program = Program.get_program(os.getcwd(), True)
14511451
# Change directories to the program root to use mbed OS tools
@@ -1458,9 +1458,9 @@ def target(name=None):
14581458
action('"%s" now set as default target for program "%s"' % (name, program.name))
14591459

14601460
@subcommand('toolchain',
1461-
dict(name='name', nargs='?', help="Default toolchain name. Example: ARM, uARM, GCC_ARM, IAR"),
1461+
dict(name='name', nargs='?', help='Default toolchain name. Example: ARM, uARM, GCC_ARM, IAR'),
14621462
help='Sets default toolchain for the current program.')
1463-
def toolchain(name=None):
1463+
def toolchain_(name=None):
14641464
# Find the root of the program
14651465
program = Program.get_program(os.getcwd(), True)
14661466
# Change directories to the program root to use mbed OS tools

0 commit comments

Comments
 (0)