Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring conditional assignement with ternary operator #62

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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