Skip to content

Commit

Permalink
Allow component with no command/event/telemetry (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc authored Oct 14, 2024
1 parent 2530b89 commit 439c38c
Showing 1 changed file with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
from fprime.util.cookiecutter_wrapper import is_valid_name


# Check to ensure Component Name is valid
def verify_inputs(component_name, commands, events, telemetry, parameters):
if is_valid_name(component_name) != "valid":
raise ValueError(
"Unacceptable component name. Do not use spaces or special characters"
)
if commands == "no" and events == "no" and telemetry == "no" and parameters == "no":
raise ValueError(
"[ERROR] You must select at least one of the following options to have in your component: commands, events, telemetry, parameters"
)


verify_inputs(
"{{ cookiecutter.component_name }}",
"{{ cookiecutter.enable_commands }}",
"{{ cookiecutter.enable_events }}",
"{{ cookiecutter.enable_telemetry }}",
"{{ cookiecutter.enable_parameters }}",
)
# Check if the component name is valid
if is_valid_name("{{ cookiecutter.component_name }}") != "valid":
raise ValueError(
"Unacceptable component name. Do not use spaces or special characters"
)

0 comments on commit 439c38c

Please sign in to comment.