# Path: awscfncli2/cli/utils/colormaps.py
# STACK_STATUS_TO_COLOR = ColorMap(_STACK_STATUS_TO_COLOR)


import time
import threading
import click
import botocore.exceptions
from .colormaps import STACK_STATUS_TO_COLOR
            if first_run:
                if latest_events > 0:
                    if n < event_count - latest_events:
                        continue

            # tail sub stack events
            if e.resource_type == 'AWS::CloudFormation::Stack' and \
                    e.physical_resource_id and \
                    e.physical_resource_id not in visited_stacks:
                visited_stacks.add(e.physical_resource_id)

                cfn = session.resource('cloudformation',
                                       region_name=stack.meta.client.meta.region_name)
                sub_stack = cfn.Stack(e.physical_resource_id)

                start_tail_stack_events_daemon(
                    session,
                    sub_stack,
                    latest_events=latest_events,
                    check_interval=check_interval + 1,
                    indent=indent + 2,
                    prefix=e.logical_resource_id)
            # print the event
            if indent > 0:
                click.echo(' ' * indent, nl=False)
                click.secho('[%s] ' % prefix, bold=True, nl=False)

            click.echo(e.timestamp.strftime('%x %X'), nl=False)
            click.echo(' - ', nl=False)
            click.secho(e.resource_status, nl=False,

# Path: awscfncli2/cli/utils/colormaps.py
# STACK_STATUS_TO_COLOR = ColorMap(_STACK_STATUS_TO_COLOR)


# Path: awscfncli2/cli/utils/events.py
import time
import threading
import click
import botocore.exceptions
from .colormaps import STACK_STATUS_TO_COLOR

            if first_run:
                if latest_events > 0:
                    if n < event_count - latest_events:
                        continue

            # tail sub stack events
            if e.resource_type == 'AWS::CloudFormation::Stack' and \
                    e.physical_resource_id and \
                    e.physical_resource_id not in visited_stacks:
                visited_stacks.add(e.physical_resource_id)

                cfn = session.resource('cloudformation',
                                       region_name=stack.meta.client.meta.region_name)
                sub_stack = cfn.Stack(e.physical_resource_id)

                start_tail_stack_events_daemon(
                    session,
                    sub_stack,
                    latest_events=latest_events,
                    check_interval=check_interval + 1,
                    indent=indent + 2,
                    prefix=e.logical_resource_id)
            # print the event
            if indent > 0:
                click.echo(' ' * indent, nl=False)
                click.secho('[%s] ' % prefix, bold=True, nl=False)

            click.echo(e.timestamp.strftime('%x %X'), nl=False)
            click.echo(' - ', nl=False)
            click.secho(e.resource_status, nl=False,

                        **STACK_STATUS_TO_COLOR[e.resource_status])