Skip to content

Commit

Permalink
remove: not used class AccountIdsConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Sep 20, 2024
1 parent c5d69f3 commit 5a85d0c
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions lean/models/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ def factory(config_json_object) -> 'Configuration':
return BrokerageEnvConfiguration.factory(config_json_object)
elif config_json_object["type"] == "oauth-token":
return AuthConfiguration.factory(config_json_object)
elif config_json_object["type"] == "input-account-id":
return AccountIdsConfiguration.factory(config_json_object)
else:
raise ValueError(
f'Undefined input method type {config_json_object["type"]}')
Expand Down Expand Up @@ -421,40 +419,6 @@ 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(PromptUserInput, ChoiceUserInput):

def __init__(self, config_json_object):
super().__init__(config_json_object)

def factory(config_json_object) -> 'AccountIdsConfiguration':
"""Creates an instance of the child classes.
:param config_json_object: the json object dict with configuration info
:return: An instance of AuthConfiguration.
"""
if config_json_object["type"] == "input-account-id":
return AccountIdsConfiguration(config_json_object)
else:
raise ValueError(
f'Undefined input method type {config_json_object["type"]}')

def ask_user_for_input(self, default_value, logger: Logger, hide_input: bool = False):
"""Prompts user to provide input while validating the type of input
against the expected type
:param default_value: The default to prompt to the user.
:param logger: The instance of logger class.
: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 == "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}")


class FilterEnvConfiguration(BrokerageEnvConfiguration):
"""This class adds extra filters to user filters."""

Expand Down

0 comments on commit 5a85d0c

Please sign in to comment.