(self, rows)
return self.msgs
This handles updating module/form names and menu media
        (the contents of the "Menus and forms" sheet in the multi-tab upload).
This handles updating module/form names and menu media
        (the contents of the "Menus and forms" sheet in the multi-tab upload).
This handles updating module / form names and menu media ( the contents of the Menus and forms sheet in the multi - tab upload ) .
def update(self, rows):
        """
        This handles updating module/form names and menu media
        (the contents of the "Menus and forms" sheet in the multi-tab upload).
        """
        self.msgs = []
        for row in get_unicode_dicts(rows):
            sheet_name = row.get('menu_or_form', '')
            # The unique_id column is populated on the "Menus_and_forms" sheet in multi-sheet translation files,
            # and in the "name / menu media" row in single-sheet translation files.
            unique_id = row.get('unique_id')

            if not unique_id and sheet_name in self.sheet_name_to_unique_id:
                # If we don't have a value for unique_id, try to fetch it from self.sheet_name_to_unique_id
                unique_id = self.sheet_name_to_unique_id[sheet_name]

            try:
                if unique_id:
                    document = get_menu_or_form_by_unique_id(self.app, unique_id, sheet_name)
                else:
                    document = get_menu_or_form_by_sheet_name(self.app, sheet_name)
            except (ModuleNotFoundException, FormNotFoundException, ValueError) as err:
                self.msgs.append((messages.error, str(err)))
                continue

            self.update_translation_dict('default_', document.name, row)

            # Update menu media
            for lang in self.langs:
                image_header = 'image_%s' % lang
                if image_header in row:
                    document.set_icon(lang, row[image_header])

                audio_header = 'audio_%s' % lang
                if audio_header in row:
                    document.set_audio(lang, row[audio_header])

        return self.msgs
def update ( self , rows ) : self . msgs = [ ] for row in get_unicode_dicts ( rows ) : sheet_name = row . get ( 'menu_or_form' , '' ) # The unique_id column is populated on the "Menus_and_forms" sheet in multi-sheet translation files, # and in the "name / menu media" row in single-sheet translation files. unique_id = row . get ( 'unique_id' ) if not unique_id and sheet_name in self . sheet_name_to_unique_id : # If we don't have a value for unique_id, try to fetch it from self.sheet_name_to_unique_id unique_id = self . sheet_name_to_unique_id [ sheet_name ] try : if unique_id : document = get_menu_or_form_by_unique_id ( self . app , unique_id , sheet_name ) else : document = get_menu_or_form_by_sheet_name ( self . app , sheet_name ) except ( ModuleNotFoundException , FormNotFoundException , ValueError ) as err : self . msgs . append ( ( messages . error , str ( err ) ) ) continue self . update_translation_dict ( 'default_' , document . name , row ) # Update menu media for lang in self . langs : image_header = 'image_%s' % lang if image_header in row : document . set_icon ( lang , row [ image_header ] ) audio_header = 'audio_%s' % lang if audio_header in row : document . set_audio ( lang , row [ audio_header ] ) return self . msgs