r"""Gets the input from the user. Returns: str: The user's input.
(self)
| 75 | self.options_dict[str(index + 1)] = option |
| 76 | |
| 77 | def get_input(self) -> str: |
| 78 | r"""Gets the input from the user. |
| 79 | |
| 80 | Returns: |
| 81 | str: The user's input. |
| 82 | """ |
| 83 | while True: |
| 84 | human_input = input( |
| 85 | self.logger_color |
| 86 | + f"Please enter your choice ([1-{len(self.options_dict)}]): " |
| 87 | ) |
| 88 | print("\n") |
| 89 | if human_input in self.options_dict: |
| 90 | break |
| 91 | print_text_animated( |
| 92 | self.logger_color + "\n> Invalid choice. Please try again.\n" |
| 93 | ) |
| 94 | |
| 95 | return human_input |
| 96 | |
| 97 | def parse_input(self, human_input: str) -> str: |
| 98 | r"""Parses the user's input and returns a `BaseMessage` object. |
no test coverage detected