# 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

    Yields:
      Tuple[str, str]: path to the init file and the entry to add to it.
    """
    formatter_string = 'from plaso.formatters import {0:s}\n'.format(
        self._output_name)
    formatter_init_path = os.path.join(self._formatter_path, '__init__.py')
    yield formatter_init_path, formatter_string

    parser_string = 'from {0:s} import {1:s}\n'.format(
        self._parser_path.replace(os.sep, '.'), self._output_name)
    parser_init_path = os.path.join(self._parser_path, '__init__.py')
    yield parser_init_path, parser_string

  def GetJinjaContext(self) -> Dict[str, object]:
    """Returns a dict that can be used as a context for Jinja2 templates.

    Returns:
      dict: containing:
        str: name of Jinja argument.
        object: Jinja argument value.
    """
    context = super(PlasoBaseScaffolder, self).GetJinjaContext()

    context['class_name'] = self.class_name
    context['test_file'] = self.test_file
    context['test_file_path'] = self.test_file_path

    return context


# 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


    Yields:
      Tuple[str, str]: path to the init file and the entry to add to it.
    """
    formatter_string = 'from plaso.formatters import {0:s}\n'.format(
        self._output_name)
    formatter_init_path = os.path.join(self._formatter_path, '__init__.py')
    yield formatter_init_path, formatter_string

    parser_string = 'from {0:s} import {1:s}\n'.format(
        self._parser_path.replace(os.sep, '.'), self._output_name)
    parser_init_path = os.path.join(self._parser_path, '__init__.py')
    yield parser_init_path, parser_string

  def GetJinjaContext(self) -> Dict[str, object]:
    """Returns a dict that can be used as a context for Jinja2 templates.

    Returns:
      dict: containing:
        str: name of Jinja argument.
        object: Jinja argument value.
    """
    context = super(PlasoBaseScaffolder, self).GetJinjaContext()

    context['class_name'] = self.class_name
    context['test_file'] = self.test_file
    context['test_file_path'] = self.test_file_path

    return context


  def GetQuestions(self) -> List[interface.BaseQuestion]: