def open(self):
        """Open the subtitle file into an Aeidon project."""
        try:
            self.project.open_main(self.filename)
        except UnicodeDecodeError:
            with open(self.filename, 'rb') as openfile:
                encoding = get_encoding(openfile.read())

            try:
                self.project.open_main(self.filename, encoding)
            except UnicodeDecodeError:
                LOGGER.error("'%s' encountered a fatal encoding error",
                             self.filename)
                sys.exit(1)
            except:  # pylint: disable=W0702
                open_error(self.filename)

        except:  # pylint: disable=W0702
            open_error(self.filename)
def open ( self ) : try : self . project . open_main ( self . filename ) except UnicodeDecodeError : with open ( self . filename , 'rb' ) as openfile : encoding = get_encoding ( openfile . read ( ) ) try : self . project . open_main ( self . filename , encoding ) except UnicodeDecodeError : LOGGER . error ( "'%s' encountered a fatal encoding error" , self . filename ) sys . exit ( 1 ) except : open_error ( self . filename ) except : open_error ( self . filename )
Open the subtitle file into an Aeidon project.