Skip to content

Commit 04888aa

Browse files
committed
Pylint improvements (9.9/10)
1 parent 886ec16 commit 04888aa

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

mbed/mbed.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,6 @@ def check_requirements(self, show_warning=False):
12451245
missing = []
12461246
except ProcessException:
12471247
warning("Unable to auto-install required Python modules.")
1248-
pass
12491248

12501249
except (IOError, ImportError, OSError):
12511250
pass
@@ -1385,7 +1384,7 @@ def set_cfg(self, *args, **kwargs):
13851384
def list_cfg(self, *args, **kwargs):
13861385
return Cfg(self.path).list(*args, **kwargs)
13871386

1388-
# Cfg classed used for handling the config backend
1387+
# Cfg classed used for handling the config backend
13891388
class Cfg(object):
13901389
path = None
13911390
file = ".mbed"
@@ -1415,7 +1414,6 @@ def set(self, var, val):
14151414
f.write('\n'.join(lines) + '\n')
14161415
except (IOError, OSError):
14171416
warning("Unable to write config file %s" % fl)
1418-
pass
14191417

14201418
# Gets config value
14211419
def get(self, var, default_val=None):
@@ -1797,7 +1795,7 @@ def publish(all_refs=None, msg=None, top=True):
17971795
repo.publish(all_refs)
17981796
else:
17991797
if top:
1800-
action("Nothing to publish to the remote repository (the source tree is unmodified)")
1798+
action("Nothing to publish to the remote repository (the source tree is unmodified)")
18011799
except ProcessException as e:
18021800
if e[0] != 1:
18031801
raise e
@@ -1987,7 +1985,7 @@ def sync(recursive=True, keep_refs=False, top=True):
19871985
def list_(detailed=False, prefix='', p_path=None, ignore=False):
19881986
repo = Repo.fromrepo()
19891987

1990-
print("%s (%s)" % (prefix + (relpath(p_path, repo.path) if p_path else repo.name), ((repo.url+('#'+str(repo.rev)[:12] if repo.rev else '') if detailed else str(repo.rev)[:12]) or 'no revision')))
1988+
print "%s (%s)" % (prefix + (relpath(p_path, repo.path) if p_path else repo.name), ((repo.url+('#'+str(repo.rev)[:12] if repo.rev else '') if detailed else str(repo.rev)[:12]) or 'no revision'))
19911989

19921990
for i, lib in enumerate(sorted(repo.libs, key=lambda l: l.path)):
19931991
if prefix:
@@ -2157,7 +2155,6 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
21572155
if not build:
21582156
build = os.path.join(program.path, program.build_dir, 'tests', target, tchain)
21592157

2160-
21612158
if test_spec:
21622159
# Preserve path to given test spec
21632160
test_spec = os.path.relpath(os.path.join(orig_path, test_spec), program.path)
@@ -2297,7 +2294,7 @@ def detect():
22972294
def config_(var=None, value=None, global_cfg=False, unset=False, list_config=False):
22982295
name = var
22992296
var = str(var).upper()
2300-
2297+
23012298
if list_config:
23022299
g = Global()
23032300
g_vars = g.list_cfg().items()
@@ -2306,7 +2303,7 @@ def config_(var=None, value=None, global_cfg=False, unset=False, list_config=Fal
23062303
for v in g_vars:
23072304
log("%s=%s\n" % (v[0], v[1]))
23082305
else:
2309-
log("No global configuration is set\n")
2306+
log("No global configuration is set\n")
23102307
log("\n")
23112308

23122309
p = Program(os.getcwd())
@@ -2389,7 +2386,7 @@ def main():
23892386

23902387
# Help messages adapt based on current dir
23912388
cwd_root = os.getcwd()
2392-
2389+
23932390
if sys.version_info[0] != 2 or sys.version_info[1] < 7:
23942391
error(
23952392
"mbed CLI is compatible with Python version >= 2.7 and < 3.0\n"
@@ -2434,4 +2431,4 @@ def main():
24342431

24352432

24362433
if __name__ == "__main__":
2437-
main()
2434+
main()

0 commit comments

Comments
 (0)