Skip to content

Commit

Permalink
Refactoring cond assign with if expr (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibFrgsGmz authored May 4, 2022
1 parent 613d1df commit 2875043
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/fprime/fbuild/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,11 @@ def get_port_input(namespace):
dir_name = get_valid_input(f'Directory Name [{defaults["dir_name"]}]: ')
namespace = get_valid_input(f'Port Namespace [{defaults["namespace"]}]: ')
while not args_done:
if arg_list == []:
add_arg = confirm("Would you like to add an argument?: ")
else:
add_arg = confirm("Would you like to add another argument?: ")
add_arg = (
confirm("Would you like to add another argument?: ")
if arg_list
else confirm("Would you like to add an argument?: ")
)
if add_arg:
arg_name = get_valid_input("Argument name: ")
arg_type = get_valid_input(
Expand Down
9 changes: 5 additions & 4 deletions src/fprime/fbuild/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ def load(settings_file: Path, platform: str = "fprime"):
fprime_location = IniSettings.read_safe_path(
confparse, "fprime", "framework_path", settings_file
)
if not fprime_location:
fprime_location = IniSettings.find_fprime(settings_file.parent)
else:
fprime_location = Path(fprime_location[0])
fprime_location = (
Path(fprime_location[0])
if fprime_location
else IniSettings.find_fprime(settings_file.parent)
)
# Read project root if it is available
proj_root = IniSettings.read_safe_path(
confparse, "fprime", "project_root", settings_file
Expand Down

0 comments on commit 2875043

Please sign in to comment.