Skip to content

Commit fb420f0

Browse files
committed
Change flag names based on PR comments
1 parent a675604 commit fb420f0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

mbed/mbed.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,7 @@ def requirements_contains(self, library_name):
16181618
with open(os.path.join(req_path, req_file), 'r') as f:
16191619
return library_name in f.read()
16201620

1621-
def check_requirements(self, show_warning_only=False):
1621+
def check_requirements(self, require_install=False):
16221622
skip_requirements = self.get_cfg("NO_REQUIREMENTS", False)
16231623
if skip_requirements:
16241624
action("Skipping installed requirements check due to configuration flag.")
@@ -1641,7 +1641,7 @@ def check_requirements(self, show_warning_only=False):
16411641
if not pkg in installed_packages:
16421642
missing.append(pkg)
16431643

1644-
if missing and install_requirements and not show_warning_only:
1644+
if missing and install_requirements and require_install:
16451645
try:
16461646
action("Auto-installing missing Python modules (%s)..." % ', '.join(missing))
16471647
pquery([python_cmd, '-m', 'pip', 'install', '-q', '-r', os.path.join(req_path, req_file)])
@@ -1661,10 +1661,10 @@ def check_requirements(self, show_warning_only=False):
16611661
elif os.name == 'posix':
16621662
msg += "\nOn Posix systems (Linux, etc) you might have to switch to superuser account or use \"sudo\""
16631663

1664-
if show_warning_only:
1665-
warning(msg)
1666-
else:
1664+
if require_install:
16671665
error(msg, 1)
1666+
else:
1667+
warning(msg)
16681668

16691669
return True
16701670

@@ -1686,7 +1686,7 @@ def post_action(self, check_reqs=True):
16861686
shutil.copy(os.path.join(mbed_tools_path, 'default_settings.py'), os.path.join(self.path, 'mbed_settings.py'))
16871687

16881688
if check_reqs:
1689-
self.check_requirements()
1689+
self.check_requirements(True)
16901690

16911691
def add_tools(self, path):
16921692
if not os.path.exists(path):
@@ -2637,7 +2637,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
26372637
args = remainder
26382638
# Find the root of the program
26392639
program = Program(getcwd(), True)
2640-
program.check_requirements(True)
2640+
program.check_requirements()
26412641
# Remember the original path. this is needed for compiling only the libraries and tests for the current folder.
26422642
orig_path = getcwd()
26432643
orig_target = target
@@ -2799,7 +2799,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False,
27992799
args = remainder
28002800
# Find the root of the program
28012801
program = Program(getcwd(), True)
2802-
program.check_requirements(True)
2802+
program.check_requirements()
28032803
# Check if current Mbed OS support icetea
28042804
icetea_supported = program.requirements_contains('icetea')
28052805

@@ -2982,7 +2982,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False,
29822982
def dev_mgmt(toolchain=None, target=None, source=False, profile=False, build=False):
29832983
orig_path = getcwd()
29842984
program = Program(getcwd(), True)
2985-
program.check_requirements()
2985+
program.check_requirements(True)
29862986
with cd(program.path):
29872987
tools_dir = program.get_tools()
29882988

@@ -3039,7 +3039,7 @@ def export(ide=None, target=None, source=False, profile=["debug"], clean=False,
30393039
# Find the root of the program
30403040
program = Program(getcwd(), True)
30413041
if not no_requirements:
3042-
program.check_requirements(True)
3042+
program.check_requirements()
30433043
# Remember the original path. this is needed for compiling only the libraries and tests for the current folder.
30443044
orig_path = getcwd()
30453045
orig_target = target
@@ -3093,7 +3093,7 @@ def detect():
30933093
args = remainder
30943094
# Find the root of the program
30953095
program = Program(getcwd(), False)
3096-
program.check_requirements(True)
3096+
program.check_requirements()
30973097
# Change directories to the program root to use mbed OS tools
30983098
with cd(program.path):
30993099
tools_dir = program.get_tools_dir()

0 commit comments

Comments
 (0)