-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow component with no command/event/telemetry (#219)
- Loading branch information
Showing
1 changed file
with
5 additions
and
20 deletions.
There are no files selected for viewing
25 changes: 5 additions & 20 deletions
25
src/fprime/cookiecutter_templates/cookiecutter-fprime-component/hooks/pre_gen_project.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) |