def find_block_indexes(lines, key):
    """Find indices of opening and closing block.

    Note, this does not yet handle recursive blocks.

    For example:
    1  if statement1 {
    2    if statement2 {
    3    }
    4  }

    will return 1, 3.

    Args:
        lines: List of text lines.
        key: Search term which starts block.

    Returns: tuple of start and end of block.
    """
    total_lines = len(lines)
    start = None
    end = None
    for line_num in range(total_lines):
        line = lines[line_num]
        if key in line:
            for num in range(line_num, total_lines):
                line = lines[num]
                if '{' in line:
                    start = num
                if '}' in line:
                    end = num
                    break
            break
    return start, end
