(self, rows)
Reconfigure the given sheet into objects that are easier to process.
        The major change is to nest mapping and graph config rows under their
        "parent" rows, so that there's one row per case proeprty.

        This function also pulls out case detail tab headers and the case list form label,
        which will be processed separately from the case proeprty rows.

        Populates class attributes condensed_rows, case_list_form_label, case_list_menu_item_label,
        case search button labels, and tab_headers.
Reconfigure the given sheet into objects that are easier to process.
        The major change is to nest mapping and graph config rows under their
        "parent" rows, so that there's one row per case proeprty.
Reconfigure the given sheet into objects that are easier to process . The major change is to nest mapping and graph config rows under their parent rows so that there s one row per case proeprty .
def _get_condensed_rows(self, rows):
        '''
        Reconfigure the given sheet into objects that are easier to process.
        The major change is to nest mapping and graph config rows under their
        "parent" rows, so that there's one row per case proeprty.

        This function also pulls out case detail tab headers and the case list form label,
        which will be processed separately from the case proeprty rows.

        Populates class attributes condensed_rows, case_list_form_label, case_list_menu_item_label,
        case search button labels, and tab_headers.
        '''
        self.condensed_rows = []
        self.case_list_form_label = None
        self.case_list_menu_item_label = None
        self.search_label = None
        self.search_again_label = None
        self.tab_headers = [None for i in self.module.case_details.long.tabs]
        index_of_last_enum_in_condensed = -1
        index_of_last_graph_in_condensed = -1
        for i, row in enumerate(get_unicode_dicts(rows)):
            # If it's an enum case property, set index_of_last_enum_in_condensed
            if row['case_property'].endswith(" (ID Mapping Text)"):
                row['id'] = self._remove_description_from_case_property(row)
                self.condensed_rows.append(row)
                index_of_last_enum_in_condensed = len(self.condensed_rows) - 1

            # If it's an enum value, add it to its parent enum property
            elif row['case_property'].endswith(" (ID Mapping Value)"):
                row['id'] = self._remove_description_from_case_property(row)
                parent = self.condensed_rows[index_of_last_enum_in_condensed]
                parent['mappings'] = parent.get('mappings', []) + [row]

            # If it's a graph case property, set index_of_last_graph_in_condensed
            elif row['case_property'].endswith(" (graph)"):
                row['id'] = self._remove_description_from_case_property(row)
                self.condensed_rows.append(row)
                index_of_last_graph_in_condensed = len(self.condensed_rows) - 1

            # If it's a graph configuration item, add it to its parent
            elif row['case_property'].endswith(" (graph config)"):
                row['id'] = self._remove_description_from_case_property(row)
                parent = self.condensed_rows[index_of_last_graph_in_condensed]
                parent['configs'] = parent.get('configs', []) + [row]

            # If it's a graph series configuration item, add it to its parent
            elif row['case_property'].endswith(" (graph series config)"):
                trimmed_property = self._remove_description_from_case_property(row)
                row['id'] = trimmed_property.split(" ")[0]
                row['series_index'] = trimmed_property.split(" ")[1]
                parent = self.condensed_rows[index_of_last_graph_in_condensed]
                parent['series_configs'] = parent.get('series_configs', []) + [row]

            # If it's a graph annotation, add it to its parent
            elif row['case_property'].startswith("graph annotation "):
                row['id'] = int(row['case_property'].split(" ")[-1])
                parent = self.condensed_rows[index_of_last_graph_in_condensed]
                parent['annotations'] = parent.get('annotations', []) + [row]

            # It's the case list registration form label. Don't add it to condensed rows
            elif row['case_property'] == 'case_list_form_label':
                self.case_list_form_label = row

            # It's the case list menu item label. Don't add it to condensed rows
            elif row['case_property'] == 'case_list_menu_item_label':
                self.case_list_menu_item_label = row

            # It's a case search label. Don't add it to condensed rows
            elif row['case_property'] == 'search_label':
                self.search_label = row
            elif row['case_property'] == 'search_again_label':
                self.search_again_label = row

            # If it's a tab header, don't add it to condensed rows
            elif re.search(r'^Tab \d+$', row['case_property']):
                index = int(row['case_property'].split(' ')[-1])
                if index < len(self.tab_headers):
                    self.tab_headers[index] = row
                else:
                    message = _("Expected {0} case detail tabs for menu {1} but found row for Tab {2}. No changes "
                                "were made for menu {1}.").format(len(self.tab_headers), self.module.id + 1, index)
                    self.msgs.append((messages.error, message))

            # It's a normal case property
            else:
                row['id'] = row['case_property']
                self.condensed_rows.append(row)
def _get_condensed_rows ( self , rows ) : self . condensed_rows = [ ] self . case_list_form_label = None self . case_list_menu_item_label = None self . search_label = None self . search_again_label = None self . tab_headers = [ None for i in self . module . case_details . long . tabs ] index_of_last_enum_in_condensed = - 1 index_of_last_graph_in_condensed = - 1 for i , row in enumerate ( get_unicode_dicts ( rows ) ) : # If it's an enum case property, set index_of_last_enum_in_condensed if row [ 'case_property' ] . endswith ( " (ID Mapping Text)" ) : row [ 'id' ] = self . _remove_description_from_case_property ( row ) self . condensed_rows . append ( row ) index_of_last_enum_in_condensed = len ( self . condensed_rows ) - 1 # If it's an enum value, add it to its parent enum property elif row [ 'case_property' ] . endswith ( " (ID Mapping Value)" ) : row [ 'id' ] = self . _remove_description_from_case_property ( row ) parent = self . condensed_rows [ index_of_last_enum_in_condensed ] parent [ 'mappings' ] = parent . get ( 'mappings' , [ ] ) + [ row ] # If it's a graph case property, set index_of_last_graph_in_condensed elif row [ 'case_property' ] . endswith ( " (graph)" ) : row [ 'id' ] = self . _remove_description_from_case_property ( row ) self . condensed_rows . append ( row ) index_of_last_graph_in_condensed = len ( self . condensed_rows ) - 1 # If it's a graph configuration item, add it to its parent elif row [ 'case_property' ] . endswith ( " (graph config)" ) : row [ 'id' ] = self . _remove_description_from_case_property ( row ) parent = self . condensed_rows [ index_of_last_graph_in_condensed ] parent [ 'configs' ] = parent . get ( 'configs' , [ ] ) + [ row ] # If it's a graph series configuration item, add it to its parent elif row [ 'case_property' ] . endswith ( " (graph series config)" ) : trimmed_property = self . _remove_description_from_case_property ( row ) row [ 'id' ] = trimmed_property . split ( " " ) [ 0 ] row [ 'series_index' ] = trimmed_property . split ( " " ) [ 1 ] parent = self . condensed_rows [ index_of_last_graph_in_condensed ] parent [ 'series_configs' ] = parent . get ( 'series_configs' , [ ] ) + [ row ] # If it's a graph annotation, add it to its parent elif row [ 'case_property' ] . startswith ( "graph annotation " ) : row [ 'id' ] = int ( row [ 'case_property' ] . split ( " " ) [ - 1 ] ) parent = self . condensed_rows [ index_of_last_graph_in_condensed ] parent [ 'annotations' ] = parent . get ( 'annotations' , [ ] ) + [ row ] # It's the case list registration form label. Don't add it to condensed rows elif row [ 'case_property' ] == 'case_list_form_label' : self . case_list_form_label = row # It's the case list menu item label. Don't add it to condensed rows elif row [ 'case_property' ] == 'case_list_menu_item_label' : self . case_list_menu_item_label = row # It's a case search label. Don't add it to condensed rows elif row [ 'case_property' ] == 'search_label' : self . search_label = row elif row [ 'case_property' ] == 'search_again_label' : self . search_again_label = row # If it's a tab header, don't add it to condensed rows elif re . search ( r'^Tab \d+$' , row [ 'case_property' ] ) : index = int ( row [ 'case_property' ] . split ( ' ' ) [ - 1 ] ) if index < len ( self . tab_headers ) : self . tab_headers [ index ] = row else : message = _ ( "Expected {0} case detail tabs for menu {1} but found row for Tab {2}. No changes " "were made for menu {1}." ) . format ( len ( self . tab_headers ) , self . module . id + 1 , index ) self . msgs . append ( ( messages . error , message ) ) # It's a normal case property else : row [ 'id' ] = row [ 'case_property' ] self . condensed_rows . append ( row )