def generate_output_events(self, source, key, val, line='2', hr=True,
                               show_name=False, colorize=True):
        """
        The function for generating CLI output RDAP events results.

        Args:
            source (:obj:`str`): The parent key 'network' or 'objects'
                (required).
            key (:obj:`str`): The event key 'events' or 'events_actor'
                (required).
            val (:obj:`dict`): The event dictionary (required).
            line (:obj:`str`): The line number (0-4). Determines indentation.
                Defaults to '0'.
            hr (:obj:`bool`): Enable human readable key translations. Defaults
                to True.
            show_name (:obj:`bool`): Show human readable name (default is to
                only show short). Defaults to False.
            colorize (:obj:`bool`): Colorize the console output with ANSI
                colors. Defaults to True.

        Returns:
            str: The generated output.
        """

        output = generate_output(
            line=line,
            short=HR_RDAP[source][key]['_short'] if hr else key,
            name=HR_RDAP[source][key]['_name'] if (hr and show_name) else None,
            is_parent=False if (val is None or
                                len(val) == 0) else True,
            value='None' if (val is None or
                             len(val) == 0) else None,
            colorize=colorize
        )

        if val is not None:

            count = 0
            for item in val:

                try:
                    action = item['action']
                except KeyError:
                    action = None

                try:
                    timestamp = item['timestamp']
                except KeyError:
                    timestamp = None

                try:
                    actor = item['actor']
                except KeyError:
                    actor = None

                if count > 0:
                    output += generate_output(
                        line=str(int(line)+1),
                        is_parent=True,
                        colorize=colorize
                    )

                output += generate_output(
                    line=str(int(line)+1),
                    short=HR_RDAP_COMMON[key]['action'][
                        '_short'] if hr else 'action',
                    name=HR_RDAP_COMMON[key]['action'][
                        '_name'] if (hr and show_name) else None,
                    value=action,
                    colorize=colorize
                )

                output += generate_output(
                    line=str(int(line)+1),
                    short=HR_RDAP_COMMON[key]['timestamp'][
                        '_short'] if hr else 'timestamp',
                    name=HR_RDAP_COMMON[key]['timestamp'][
                        '_name'] if (hr and show_name) else None,
                    value=timestamp,
                    colorize=colorize
                )

                output += generate_output(
                    line=str(int(line)+1),
                    short=HR_RDAP_COMMON[key]['actor'][
                        '_short'] if hr else 'actor',
                    name=HR_RDAP_COMMON[key]['actor'][
                        '_name'] if (hr and show_name) else None,
                    value=actor,
                    colorize=colorize
                )

                count += 1

        return output
def generate_output_events ( self , source , key , val , line = '2' , hr = True , show_name = False , colorize = True ) : output = generate_output ( line = line , short = HR_RDAP [ source ] [ key ] [ '_short' ] if hr else key , name = HR_RDAP [ source ] [ key ] [ '_name' ] if ( hr and show_name ) else None , is_parent = False if ( val is None or len ( val ) == 0 ) else True , value = 'None' if ( val is None or len ( val ) == 0 ) else None , colorize = colorize ) if val is not None : count = 0 for item in val : try : action = item [ 'action' ] except KeyError : action = None try : timestamp = item [ 'timestamp' ] except KeyError : timestamp = None try : actor = item [ 'actor' ] except KeyError : actor = None if count > 0 : output += generate_output ( line = str ( int ( line ) + 1 ) , is_parent = True , colorize = colorize ) output += generate_output ( line = str ( int ( line ) + 1 ) , short = HR_RDAP_COMMON [ key ] [ 'action' ] [ '_short' ] if hr else 'action' , name = HR_RDAP_COMMON [ key ] [ 'action' ] [ '_name' ] if ( hr and show_name ) else None , value = action , colorize = colorize ) output += generate_output ( line = str ( int ( line ) + 1 ) , short = HR_RDAP_COMMON [ key ] [ 'timestamp' ] [ '_short' ] if hr else 'timestamp' , name = HR_RDAP_COMMON [ key ] [ 'timestamp' ] [ '_name' ] if ( hr and show_name ) else None , value = timestamp , colorize = colorize ) output += generate_output ( line = str ( int ( line ) + 1 ) , short = HR_RDAP_COMMON [ key ] [ 'actor' ] [ '_short' ] if hr else 'actor' , name = HR_RDAP_COMMON [ key ] [ 'actor' ] [ '_name' ] if ( hr and show_name ) else None , value = actor , colorize = colorize ) count += 1 return output
The function for generating CLI output RDAP events results.

        Args:
            source (:obj:`str`): The parent key 'network' or 'objects'
                (required).
            key (:obj:`str`): The event key 'events' or 'events_actor'
                (required).
            val (:obj:`dict`): The event dictionary (required).
            line (:obj:`str`): The line number (0-4). Determines indentation.
                Defaults to '0'.
            hr (:obj:`bool`): Enable human readable key translations. Defaults
                to True.
            show_name (:obj:`bool`): Show human readable name (default is to
                only show short). Defaults to False.
            colorize (:obj:`bool`): Colorize the console output with ANSI
                colors. Defaults to True.

        Returns:
            str: The generated output.