# Path: l2tscaffolder/frontend/output_handler.py
# class BaseOutputHandler:
#   def Confirm(self, text: str, default=True, abort=True):
#   def PrintError(self, text: str):
#   def PrintInfo(self, text: str):
#   def PrintNewLine(self):
#   def PrintOutput(self, text: str):
#   def PromptError(self, text: str) -> str:
#   def PromptInfo(self, text: str) -> str:
#   def PromptInfoWithDefault(
#       self, text: str, input_type: type, default: object) -> str:
# 
# Path: l2tscaffolder/helpers/git.py
# class GitHelper(cli.CLIHelper):
#   def __init__(self, project_path: str):
#   def AddFileToTrack(self, file_path: str):
#   def HasBranch(self, branch_name: str) -> bool:
#   def GenerateBranchName(self, module_name: str) -> str:
#   def GetActiveBranch(self) -> str:
#   def RunCommand(self, command: str) -> Tuple[int, str, str]:
#   def SwitchToBranch(self, branch: str) -> int:
#   def CreateBranch(self, branch: str) -> int:
# 
# Path: l2tscaffolder/lib/engine.py
# class ScaffolderEngine:
#   def __init__(self):
#   def _RaiseIfNotReady(self):
#   def GenerateFiles(self) -> Iterator[str]:
#   def SetModuleName(self, module_name: str):
#   def SetScaffolder(self, scaffolder: scaffolder_interface.Scaffolder):
#   def SetProjectRootPath(self, root_path: str):
#   def StoreScaffolderAttribute(
#       self, name: str, value: object, value_type: Type):
# 
# Path: l2tscaffolder/lib/errors.py
# class Error(Exception):
# class EngineNotConfigured(Error):
# class FileHandlingError(Error):
# class NoValidDefinition(Error):
# class ScaffolderNotConfigured(Error):
# class UnableToConfigure(Error):
# class WrongCliInput(Error):
# 
# Path: l2tscaffolder/definitions/interface.py
# class ScaffolderDefinition:
#   NAME = definitions.DEFINITION_UNDEFINED
#   def ValidatePath(self, root_path: str) -> bool:
# 
# Path: l2tscaffolder/definitions/manager.py
# class DefinitionManager:
#   def DeregisterDefinition(
#       cls, definition_class: Type[interface.ScaffolderDefinition]):
#   def GetDefinitionByName(
#       cls, name: str) -> Type[interface.ScaffolderDefinition]:
#   def GetDefinitionNames(cls) -> Iterator[str]:
#   def GetDefinitionObjects(cls) -> Iterator[interface.ScaffolderDefinition]:
#   def RegisterDefinition(
#       cls, definition_class: Type[interface.ScaffolderDefinition]):
# 
# Path: l2tscaffolder/scaffolders/interface.py
# class BaseQuestion:
# class DictQuestion(BaseQuestion):
# class IntQuestion(BaseQuestion):
# class ListQuestion(BaseQuestion):
# class StringQuestion(BaseQuestion):
# class Scaffolder:
#   TYPE = None
#   TYPE = dict
#   TYPE = int
#   TYPE = list
#   TYPE = str
#   NAME = 'base_parser'
#   DESCRIPTION = ''
#   PROJECT = definitions.DEFINITION_PLASO
#   QUESTIONS = []
#   def __init__(self, attribute: str, prompt: str):
#   def _ValidateType(self, answer: object):
#   def ValidateAnswer(self, answer: object):
#   def __init__(self, attribute, prompt, key_prompt, value_prompt):
#   def __init__(self):
#   def GetInitFileChanges(self) -> Iterator[Tuple[str, str]]:
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def GetQuestions(self) -> List[BaseQuestion]:
#   def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
#   def GetFilesToCopy(self) -> Iterator[Tuple[str, str]]:
#   def RaiseIfNotReady(self):
#   def SetOutputName(self, output_name: str):
#   def SetAttribute(self, name: str, value: object, value_type: type):
# 
# Path: l2tscaffolder/scaffolders/manager.py
# class ScaffolderManager:
#   def DeregisterScaffolder(cls, scaffolder_class: Type[interface.Scaffolder]):
#   def GetScaffolderClasses(cls) -> Iterator[Type[interface.Scaffolder]]:
#   def GetScaffolderNames(cls) -> Iterator[str]:
#   def GetScaffolderInformation(cls) -> Iterator[Tuple[str, str]]:
#   def GetScaffolderObjectByName(
#       cls, scaffolder_name) -> Optional[interface.Scaffolder]:
#   def GetScaffolderObjects(cls) -> Dict[str, interface.Scaffolder]:
#   def GetScaffolderQuestions(cls) -> List[interface.BaseQuestion]:
#   def GetScaffolderQuestionByName(
#       cls, scaffolder_name: str) -> List[interface.BaseQuestion]:
#   def GetScaffolders(cls) -> Iterator[Tuple[str, Type[interface.Scaffolder]]]:
#   def RegisterScaffolder(cls, scaffolder_class: Type[interface.Scaffolder]):
#   def RegisterScaffolders(
#       cls, scaffolder_classes: List[Type[interface.Scaffolder]]):


import os
from typing import Dict
from typing import List
from l2tscaffolder.frontend import output_handler as handler
from l2tscaffolder.helpers import git
from l2tscaffolder.lib import engine
from l2tscaffolder.lib import errors
from l2tscaffolder.definitions import interface as definition_interface
from l2tscaffolder.definitions import manager as definition_manager
from l2tscaffolder.scaffolders import interface as scaffolder_interface
from l2tscaffolder.scaffolders import manager as scaffolder_manager
          if not gather_answer:
            raise

  def GetDefinition(
      self,
      definition_string: str) -> definition_interface.ScaffolderDefinition:
    """Returns the definition object as chosen by the user.

    Args:
      definition_string (str): definition name, read from user input.

    Returns:
      definition_interface.ScaffolderDefinition: the chosen definition object.
    """
    definitions = list(
        definition_manager.DefinitionManager.GetDefinitionNames())

    self._output_handler.PrintNewLine()
    if not definition_string:
      self._output_handler.PrintInfo('Available definitions: ')
      definition_string = ''
      while not definition_string:
        try:
          definition_string = self._GetSelection(definitions, 'Definition')
        except KeyError as e:
          self._output_handler.PrintError('{0!s}'.format(e))

    if definition_string in definitions:
      self._output_handler.PrintOutput(
          '{0:s} chosen.'.format(definition_string))

# Path: l2tscaffolder/frontend/output_handler.py
# class BaseOutputHandler:
#   def Confirm(self, text: str, default=True, abort=True):
#   def PrintError(self, text: str):
#   def PrintInfo(self, text: str):
#   def PrintNewLine(self):
#   def PrintOutput(self, text: str):
#   def PromptError(self, text: str) -> str:
#   def PromptInfo(self, text: str) -> str:
#   def PromptInfoWithDefault(
#       self, text: str, input_type: type, default: object) -> str:
# 
# Path: l2tscaffolder/helpers/git.py
# class GitHelper(cli.CLIHelper):
#   def __init__(self, project_path: str):
#   def AddFileToTrack(self, file_path: str):
#   def HasBranch(self, branch_name: str) -> bool:
#   def GenerateBranchName(self, module_name: str) -> str:
#   def GetActiveBranch(self) -> str:
#   def RunCommand(self, command: str) -> Tuple[int, str, str]:
#   def SwitchToBranch(self, branch: str) -> int:
#   def CreateBranch(self, branch: str) -> int:
# 
# Path: l2tscaffolder/lib/engine.py
# class ScaffolderEngine:
#   def __init__(self):
#   def _RaiseIfNotReady(self):
#   def GenerateFiles(self) -> Iterator[str]:
#   def SetModuleName(self, module_name: str):
#   def SetScaffolder(self, scaffolder: scaffolder_interface.Scaffolder):
#   def SetProjectRootPath(self, root_path: str):
#   def StoreScaffolderAttribute(
#       self, name: str, value: object, value_type: Type):
# 
# Path: l2tscaffolder/lib/errors.py
# class Error(Exception):
# class EngineNotConfigured(Error):
# class FileHandlingError(Error):
# class NoValidDefinition(Error):
# class ScaffolderNotConfigured(Error):
# class UnableToConfigure(Error):
# class WrongCliInput(Error):
# 
# Path: l2tscaffolder/definitions/interface.py
# class ScaffolderDefinition:
#   NAME = definitions.DEFINITION_UNDEFINED
#   def ValidatePath(self, root_path: str) -> bool:
# 
# Path: l2tscaffolder/definitions/manager.py
# class DefinitionManager:
#   def DeregisterDefinition(
#       cls, definition_class: Type[interface.ScaffolderDefinition]):
#   def GetDefinitionByName(
#       cls, name: str) -> Type[interface.ScaffolderDefinition]:
#   def GetDefinitionNames(cls) -> Iterator[str]:
#   def GetDefinitionObjects(cls) -> Iterator[interface.ScaffolderDefinition]:
#   def RegisterDefinition(
#       cls, definition_class: Type[interface.ScaffolderDefinition]):
# 
# Path: l2tscaffolder/scaffolders/interface.py
# class BaseQuestion:
# class DictQuestion(BaseQuestion):
# class IntQuestion(BaseQuestion):
# class ListQuestion(BaseQuestion):
# class StringQuestion(BaseQuestion):
# class Scaffolder:
#   TYPE = None
#   TYPE = dict
#   TYPE = int
#   TYPE = list
#   TYPE = str
#   NAME = 'base_parser'
#   DESCRIPTION = ''
#   PROJECT = definitions.DEFINITION_PLASO
#   QUESTIONS = []
#   def __init__(self, attribute: str, prompt: str):
#   def _ValidateType(self, answer: object):
#   def ValidateAnswer(self, answer: object):
#   def __init__(self, attribute, prompt, key_prompt, value_prompt):
#   def __init__(self):
#   def GetInitFileChanges(self) -> Iterator[Tuple[str, str]]:
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def GetQuestions(self) -> List[BaseQuestion]:
#   def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
#   def GetFilesToCopy(self) -> Iterator[Tuple[str, str]]:
#   def RaiseIfNotReady(self):
#   def SetOutputName(self, output_name: str):
#   def SetAttribute(self, name: str, value: object, value_type: type):
# 
# Path: l2tscaffolder/scaffolders/manager.py
# class ScaffolderManager:
#   def DeregisterScaffolder(cls, scaffolder_class: Type[interface.Scaffolder]):
#   def GetScaffolderClasses(cls) -> Iterator[Type[interface.Scaffolder]]:
#   def GetScaffolderNames(cls) -> Iterator[str]:
#   def GetScaffolderInformation(cls) -> Iterator[Tuple[str, str]]:
#   def GetScaffolderObjectByName(
#       cls, scaffolder_name) -> Optional[interface.Scaffolder]:
#   def GetScaffolderObjects(cls) -> Dict[str, interface.Scaffolder]:
#   def GetScaffolderQuestions(cls) -> List[interface.BaseQuestion]:
#   def GetScaffolderQuestionByName(
#       cls, scaffolder_name: str) -> List[interface.BaseQuestion]:
#   def GetScaffolders(cls) -> Iterator[Tuple[str, Type[interface.Scaffolder]]]:
#   def RegisterScaffolder(cls, scaffolder_class: Type[interface.Scaffolder]):
#   def RegisterScaffolders(
#       cls, scaffolder_classes: List[Type[interface.Scaffolder]]):


# Path: l2tscaffolder/frontend/frontend.py
import os
from typing import Dict
from typing import List
from l2tscaffolder.frontend import output_handler as handler
from l2tscaffolder.helpers import git
from l2tscaffolder.lib import engine
from l2tscaffolder.lib import errors
from l2tscaffolder.definitions import interface as definition_interface
from l2tscaffolder.definitions import manager as definition_manager
from l2tscaffolder.scaffolders import interface as scaffolder_interface
from l2tscaffolder.scaffolders import manager as scaffolder_manager

          if not gather_answer:
            raise

  def GetDefinition(
      self,
      definition_string: str) -> definition_interface.ScaffolderDefinition:
    """Returns the definition object as chosen by the user.

    Args:
      definition_string (str): definition name, read from user input.

    Returns:
      definition_interface.ScaffolderDefinition: the chosen definition object.
    """
    definitions = list(
        definition_manager.DefinitionManager.GetDefinitionNames())

    self._output_handler.PrintNewLine()
    if not definition_string:
      self._output_handler.PrintInfo('Available definitions: ')
      definition_string = ''
      while not definition_string:
        try:
          definition_string = self._GetSelection(definitions, 'Definition')
        except KeyError as e:
          self._output_handler.PrintError('{0!s}'.format(e))

    if definition_string in definitions:
      self._output_handler.PrintOutput(
          '{0:s} chosen.'.format(definition_string))

      def_class = definition_manager.DefinitionManager.GetDefinitionByName(