예제 #1
0
    def check(self, main_log):
        """Checks the EAC logs."""
        logs = combined.split_combined(main_log)
        for log in logs:
            if len(log.concat_contents) < 20:
                raise UnrecognizedException('Cannot parse log file; log file too short')

            log.version = self.check_version(log)
            log.album = log.concat_contents[2]
            log.drive = self.check_drive(log)

            self.index_log(log)
            self.evaluate_settings(log)
            parsers.index_toc(log)
            self.is_there_a_htoa(log)
            self.check_tracks(log)
            parsers.parse_checksum(log, self.patterns['checksum'], 'V1.0 beta 1', 'EAC <1.0')
            if self.markup:
                markup(log, self.patterns, self.translation)

        main_log = combined.defragment(logs)
        validation.validate_track_count(main_log)
        validation.validate_track_settings(main_log)
        self.deduct_and_score(main_log)

        return main_log
예제 #2
0
파일: xld.py 프로젝트: doujincafe/hbcl
    def check(self, log):
        """Checks the XLD logs."""
        if len(log.contents) < 25:
            raise UnrecognizedException('Cannot parse log file; log file too short')

        log.version = self.check_version(log)
        log.album = log.concat_contents[2]
        log.drive = self.check_drive(log)
        self.check_cdr(log)

        self.index_log(log)
        self.evaluate_settings(log)
        parsers.index_toc(log)
        self.check_tracks(log)
        self.is_there_a_htoa(log)
        validation.validate_track_count(log)
        validation.validate_track_settings(log, xld=True)
        parsers.parse_checksum(
            log, self.patterns['checksum'], '20121222', 'XLD pre-142.2'
        )

        self.deduct_and_score(log)
        if self.markup:
            markup(log, self.patterns, self.translation)

        return log