'Required:
Nothing
Return:
Nothing
Logic:
Reverse the list of dictionaries. Iterate through the list and
get the indent for each list. If the current indent is less than
or equal to the indent in the dictionary, close that level.
Keep track of how many levels you close. Reduce the list by that
many levels.
Reverse the list again.'

def __close_lists(self):

    if ((self.__line_num < 25) and self.__found_appt):
        sys.stderr.write('in    closing    out    lists\n')
        sys.stderr.write(('current_indent    is    "%s"\n' % self.__left_indent))
    current_indent = self.__left_indent
    self.__all_lists.reverse()
    num_levels_closed = 0
    for the_dict in self.__all_lists:
        list_indent = the_dict.get('left-indent')
        if ((self.__line_num < 25) and self.__found_appt):
            sys.stderr.write(('last    indent    is    "%s"' % list_indent))
        if (current_indent <= list_indent):
            self.__write_end_item()
            self.__write_end_list()
            num_levels_closed += 1
    self.__all_lists = self.__all_lists[num_levels_closed:]
    self.__all_lists.reverse()
