コード例 #1
0
 def _load_check(self, filename):
     # Check that file has not been removed since thread was queued
     # Don't load if we are stopping.
     if self.state != File.PENDING:
         log.debug("File not loaded because it was removed: %r",
                   self.filename)
         return None
     if self.tagger.stopping:
         log.debug("File not loaded because %s is stopping: %r",
                   PICARD_APP_NAME, self.filename)
         return None
     try:
         # Try loading based on extension first
         return self._load(filename)
     except Exception:
         from picard.formats import guess_format
         # If it fails, force format guessing and try loading again
         file_format = guess_format(filename)
         if not file_format and type(file_format) == type(self):
             raise
         return file_format._load(filename)
コード例 #2
0
def OggVideoFile(filename):
    """Generic Ogg video file."""
    options = [OggTheoraFile]
    return guess_format(filename, options)
コード例 #3
0
def OggAudioFile(filename):
    """Generic Ogg audio file."""
    options = [OggFLACFile, OggSpeexFile, OggVorbisFile]
    return guess_format(filename, options)
コード例 #4
0
ファイル: vorbis.py プロジェクト: mineo/picard
def OggVideoFile(filename):
    """Generic Ogg video file."""
    options = [OggTheoraFile]
    return guess_format(filename, options)
コード例 #5
0
ファイル: vorbis.py プロジェクト: mineo/picard
def OggAudioFile(filename):
    """Generic Ogg audio file."""
    options = [OggFLACFile, OggSpeexFile, OggVorbisFile]
    return guess_format(filename, options)