# Path: l2tscaffolder/lib/definitions.py
# DEFINITION_UNDEFINED = 'undefined'
# DEFINITION_PLASO = 'plaso'
# DEFINITION_TIMESKETCH = 'timesketch'
# DEFINITION_TURBINIA = 'turbinia'
# 
# 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/lib/mapping_helper.py
# class MappingHelper:
#   _DEFAULT_PATH_FORMATTER = '.style.yapf'
#   _DEFAULT_PATH_TEMPLATE = 'templates'
#   def __init__(self, template_path: str='', formatter_path: str=''):
#   def _RemoveWhitespaceAtEndOfLine(self, template: str) -> str:
#   def _RemoveEscapeError(self, template: str) -> str:
#   def _RemoveYapfComment(self, template: str) -> str:
#   def GenerateClassName(self, scaffolder_name: str) -> str:
#   def RenderTemplate(self, template_filename: str, context: dict) -> str:
# 
# 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):


import os
import logging
from typing import Dict
from typing import Iterator
from typing import List
from typing import Tuple
from l2tscaffolder.lib import definitions
from l2tscaffolder.lib import errors
from l2tscaffolder.lib import mapping_helper
from l2tscaffolder.scaffolders import interface
  def GetFilesToCopy(self) -> Iterator[Tuple[str, str]]:
    """Return a list of files that need to be copied.

    Raises:
      IOError: when the test file does not exist.

    Yields:
      tuple: containing:
        str: file name of source.
        str: file name of destination.
    """
    if not self.test_file:
      raise IOError('A plaso parser cannot be generated without a test file.')

    if not os.path.isfile(self.test_file):
      raise IOError('Test file [{0:s}] does not exist.'.format(self.test_file))

    test_file_name = os.path.basename(self.test_file)
    self.test_file_path = os.path.join('test_data', test_file_name)

    yield self.test_file, self.test_file_path

  def RaiseIfNotReady(self):
    """Checks to see if all attributes are set to start generating files.

    Raises:
      ScaffolderNotConfigured: if the scaffolder is not fully configured.
    """
    super(PlasoBaseScaffolder, self).RaiseIfNotReady()
    if not os.path.isfile(self.test_file):

# Path: l2tscaffolder/lib/definitions.py
# DEFINITION_UNDEFINED = 'undefined'
# DEFINITION_PLASO = 'plaso'
# DEFINITION_TIMESKETCH = 'timesketch'
# DEFINITION_TURBINIA = 'turbinia'
# 
# 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/lib/mapping_helper.py
# class MappingHelper:
#   _DEFAULT_PATH_FORMATTER = '.style.yapf'
#   _DEFAULT_PATH_TEMPLATE = 'templates'
#   def __init__(self, template_path: str='', formatter_path: str=''):
#   def _RemoveWhitespaceAtEndOfLine(self, template: str) -> str:
#   def _RemoveEscapeError(self, template: str) -> str:
#   def _RemoveYapfComment(self, template: str) -> str:
#   def GenerateClassName(self, scaffolder_name: str) -> str:
#   def RenderTemplate(self, template_filename: str, context: dict) -> str:
# 
# 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/plaso.py
import os
import logging
from typing import Dict
from typing import Iterator
from typing import List
from typing import Tuple
from l2tscaffolder.lib import definitions
from l2tscaffolder.lib import errors
from l2tscaffolder.lib import mapping_helper
from l2tscaffolder.scaffolders import interface

  def GetFilesToCopy(self) -> Iterator[Tuple[str, str]]:
    """Return a list of files that need to be copied.

    Raises:
      IOError: when the test file does not exist.

    Yields:
      tuple: containing:
        str: file name of source.
        str: file name of destination.
    """
    if not self.test_file:
      raise IOError('A plaso parser cannot be generated without a test file.')

    if not os.path.isfile(self.test_file):
      raise IOError('Test file [{0:s}] does not exist.'.format(self.test_file))

    test_file_name = os.path.basename(self.test_file)
    self.test_file_path = os.path.join('test_data', test_file_name)

    yield self.test_file, self.test_file_path

  def RaiseIfNotReady(self):
    """Checks to see if all attributes are set to start generating files.

    Raises:
      ScaffolderNotConfigured: if the scaffolder is not fully configured.
    """
    super(PlasoBaseScaffolder, self).RaiseIfNotReady()
    if not os.path.isfile(self.test_file):

      errors.ScaffolderNotConfigured(