Skip to content

Commit

Permalink
feat: support Prompt in AccountIdsConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Sep 19, 2024
1 parent d32a8e3 commit ed7870f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lean/models/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def ask_user_for_input(self, default_value, logger: Logger, hide_input: bool = F
raise ValueError(f'user input not allowed with {self.__class__.__name__}')


class AccountIdsConfiguration(ChoiceUserInput):
class AccountIdsConfiguration(PromptUserInput, ChoiceUserInput):

def __init__(self, config_json_object):
super().__init__(config_json_object)
Expand All @@ -447,7 +447,9 @@ def ask_user_for_input(self, default_value, logger: Logger, hide_input: bool = F
:param hide_input: Whether to hide the input (not used for this type of input, which is never hidden).
:return: The value provided by the user.
"""
if self._input_method == "choice":
if self._input_method == "prompt":
return PromptUserInput.ask_user_for_input(self, default_value, logger)
elif self._input_method == "choice":
return ChoiceUserInput.ask_user_for_input(self, default_value, logger)
else:
raise ValueError(f"Undefined input method type {self._input_method}")
Expand Down

0 comments on commit ed7870f

Please sign in to comment.