# 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/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
# class TestFileQuestion(interface.StringQuestion):
# class PlasoBaseScaffolder(interface.Scaffolder):
# class PlasoPluginScaffolder(PlasoBaseScaffolder):
# class PlasoParserScaffolder(PlasoBaseScaffolder):
#   def ValidateAnswer(self, answer: str):
#   def __init__(self):
#   def _GenerateFormatter(self) -> str:
#   def _GenerateFormatterTest(self) -> str:
#   def _GenerateParser(self) -> str:
#   def _GenerateParserTest(self) -> str:
#   def GetInitFileChanges(self) -> Iterator[Tuple[str, str]]:
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def GetQuestions(self) -> List[interface.BaseQuestion]:
#   def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
#   def GetFilesToCopy(self) -> Iterator[Tuple[str, str]]:
#   def RaiseIfNotReady(self):
#   def __init__(self):
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def __init__(self):
#   def GetJinjaContext(self) -> Dict[str, object]:
#   NAME = 'plaso_base'
#   DESCRIPTION = 'This is a scaffolder for plaso parsers and/or plugins'
#   PROJECT = definitions.DEFINITION_PLASO
#   TEMPLATE_PARSER_FILE = 'generic_plaso_parser.jinja2'
#   TEMPLATE_PARSER_TEST = 'generic_plaso_parser_test.jinja2'
#   TEMPLATE_FORMATTER_FILE = 'generic__plaso_formatter.jinja2'
#   TEMPLATE_FORMATTER_TEST = 'generic_plaso_formatter_test.jinja2'
#   QUESTIONS = []
# 
# 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
import sqlite3
from typing import Dict
from typing import Iterator
from typing import Tuple
from l2tscaffolder.lib import errors
from l2tscaffolder.scaffolders import interface
from l2tscaffolder.scaffolders import plaso
from l2tscaffolder.scaffolders import manager
    context['query_columns'] = self.query_columns
    context['required_tables'] = self.required_tables
    context['timestamp_columns'] = self.timestamp_columns
    return context

  def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
    """Generates files required for the SQLite plugin.

    Yields:
      tuple: file name and content of the file to be written to disk.

    Raises:
      errors.UnableToConfigure: if it is not possible to generate
          the files.
    """
    _, _, database_name = self.test_file.rpartition(os.sep)
    self.database_name = database_name

    self.data_types = {}
    sql_columns = {}
    timestamp_columns = {}

    for query_name, query in self.queries.items():
      self.data_types[query_name] = '{0:s}:{1:s}'.format(
          self._output_name.lower().replace('_', ':'), query_name.lower())
      timestamp_columns[query_name] = []
      sql_columns[query_name] = []

      for column in self._GetQueryColumns(query):
        if column == '*':

# 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/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
# class TestFileQuestion(interface.StringQuestion):
# class PlasoBaseScaffolder(interface.Scaffolder):
# class PlasoPluginScaffolder(PlasoBaseScaffolder):
# class PlasoParserScaffolder(PlasoBaseScaffolder):
#   def ValidateAnswer(self, answer: str):
#   def __init__(self):
#   def _GenerateFormatter(self) -> str:
#   def _GenerateFormatterTest(self) -> str:
#   def _GenerateParser(self) -> str:
#   def _GenerateParserTest(self) -> str:
#   def GetInitFileChanges(self) -> Iterator[Tuple[str, str]]:
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def GetQuestions(self) -> List[interface.BaseQuestion]:
#   def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
#   def GetFilesToCopy(self) -> Iterator[Tuple[str, str]]:
#   def RaiseIfNotReady(self):
#   def __init__(self):
#   def GetJinjaContext(self) -> Dict[str, object]:
#   def __init__(self):
#   def GetJinjaContext(self) -> Dict[str, object]:
#   NAME = 'plaso_base'
#   DESCRIPTION = 'This is a scaffolder for plaso parsers and/or plugins'
#   PROJECT = definitions.DEFINITION_PLASO
#   TEMPLATE_PARSER_FILE = 'generic_plaso_parser.jinja2'
#   TEMPLATE_PARSER_TEST = 'generic_plaso_parser_test.jinja2'
#   TEMPLATE_FORMATTER_FILE = 'generic__plaso_formatter.jinja2'
#   TEMPLATE_FORMATTER_TEST = 'generic_plaso_formatter_test.jinja2'
#   QUESTIONS = []
# 
# 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/scaffolders/plaso_sqlite.py
import os
import sqlite3
from typing import Dict
from typing import Iterator
from typing import Tuple
from l2tscaffolder.lib import errors
from l2tscaffolder.scaffolders import interface
from l2tscaffolder.scaffolders import plaso
from l2tscaffolder.scaffolders import manager

    context['query_columns'] = self.query_columns
    context['required_tables'] = self.required_tables
    context['timestamp_columns'] = self.timestamp_columns
    return context

  def GenerateFiles(self) -> Iterator[Tuple[str, str]]:
    """Generates files required for the SQLite plugin.

    Yields:
      tuple: file name and content of the file to be written to disk.

    Raises:
      errors.UnableToConfigure: if it is not possible to generate
          the files.
    """
    _, _, database_name = self.test_file.rpartition(os.sep)
    self.database_name = database_name

    self.data_types = {}
    sql_columns = {}
    timestamp_columns = {}

    for query_name, query in self.queries.items():
      self.data_types[query_name] = '{0:s}:{1:s}'.format(
          self._output_name.lower().replace('_', ':'), query_name.lower())
      timestamp_columns[query_name] = []
      sql_columns[query_name] = []

      for column in self._GetQueryColumns(query):
        if column == '*':

          raise errors.UnableToConfigure(