(self, api_client=None, sketch_from_flag=None, conf_file='')
Initialize the state object.

        Args:
            sketch_from_flag: Sketch ID if provided by flag.
Initialize the state object.
Initialize the state object .
def __init__(self, api_client=None, sketch_from_flag=None, conf_file=''):
        """Initialize the state object.

        Args:
            sketch_from_flag: Sketch ID if provided by flag.
        """
        self.api = api_client
        self.sketch_from_flag = sketch_from_flag

        if not api_client:
            try:
                # TODO: Consider other config sections here as well.
                self.api = timesketch_config.get_client(load_cli_config=True)
                if not self.api:
                    raise RequestConnectionError
            except RequestConnectionError:
                click.echo('ERROR: Cannot connect to the Timesketch server.')
                sys.exit(1)

        self.config_assistant = timesketch_config.ConfigAssistant()
        self.config_assistant.load_config_file(conf_file, load_cli_config=True)
def __init__ ( self , api_client = None , sketch_from_flag = None , conf_file = '' ) : self . api = api_client self . sketch_from_flag = sketch_from_flag if not api_client : try : # TODO: Consider other config sections here as well. self . api = timesketch_config . get_client ( load_cli_config = True ) if not self . api : raise RequestConnectionError except RequestConnectionError : click . echo ( 'ERROR: Cannot connect to the Timesketch server.' ) sys . exit ( 1 ) self . config_assistant = timesketch_config . ConfigAssistant ( ) self . config_assistant . load_config_file ( conf_file , load_cli_config = True )