def load_annot(self):
        """Action: load a file for annotations."""
        if self.parent.info.filename is not None:
            filename = splitext(self.parent.info.filename)[0] + '_scores.xml'
        else:
            filename = None

        filename, _ = QFileDialog.getOpenFileName(self, 'Load annotation file',
                                                  filename,
                                                  'Annotation File (*.xml)')

        if filename == '':
            return

        try:
            self.update_notes(filename, False)
        except FileNotFoundError:
            msg = 'Annotation file not found'
            self.parent.statusBar().showMessage(msg)
            lg.info(msg)
def load_annot ( self ) : if self . parent . info . filename is not None : filename = splitext ( self . parent . info . filename ) [ 0 ] + '_scores.xml' else : filename = None filename , _ = QFileDialog . getOpenFileName ( self , 'Load annotation file' , filename , 'Annotation File (*.xml)' ) if filename == '' : return try : self . update_notes ( filename , False ) except FileNotFoundError : msg = 'Annotation file not found' self . parent . statusBar ( ) . showMessage ( msg ) lg . info ( msg )
Action: load a file for annotations.