Source code for plaso.cli.helpers.mysql_4n6time_output

# -*- coding: utf-8 -*-
"""The 4n6time MySQL database output module CLI arguments helper."""

from __future__ import unicode_literals

from plaso.lib import errors
from plaso.cli.helpers import interface
from plaso.cli.helpers import database_config
from plaso.cli.helpers import shared_4n6time_output
from plaso.cli.helpers import manager
from plaso.output import mysql_4n6time


[docs]class MySQL4n6TimeDatabaseArgumentsHelper( database_config.DatabaseArgumentsHelper): """4n6time MySQL database server CLI arguments helper.""" _DEFAULT_USERNAME = 'root'
_DEFAULT_PASSWORD = 'forensic'
[docs]class MySQL4n6TimeOutputArgumentsHelper(interface.ArgumentsHelper): """4n6time MySQL database output module CLI arguments helper.""" NAME = '4n6time_mysql' CATEGORY = 'output' DESCRIPTION = 'Argument helper for the 4n6Time MySQL output module.'
[docs] @classmethod def AddArguments(cls, argument_group): """Adds command line arguments the helper supports to an argument group. This function takes an argument parser or an argument group object and adds to it all the command line arguments this helper supports. Args: argument_group (argparse._ArgumentGroup|argparse.ArgumentParser): argparse group. """ shared_4n6time_output.Shared4n6TimeOutputArgumentsHelper.AddArguments( argument_group)
MySQL4n6TimeDatabaseArgumentsHelper.AddArguments(argument_group) # pylint: disable=arguments-differ
[docs] @classmethod def ParseOptions(cls, options, output_module): """Parses and validates options. Args: options (argparse.Namespace): parser options. output_module (OutputModule): output module to configure. Raises: BadConfigObject: when the output module object is of the wrong type. """ if not isinstance(output_module, mysql_4n6time.MySQL4n6TimeOutputModule): raise errors.BadConfigObject( 'Output module is not an instance of MySQL4n6TimeOutputModule') MySQL4n6TimeDatabaseArgumentsHelper.ParseOptions(options, output_module) shared_4n6time_output.Shared4n6TimeOutputArgumentsHelper.ParseOptions(
options, output_module) manager.ArgumentHelperManager.RegisterHelper(MySQL4n6TimeOutputArgumentsHelper)