Esempio n. 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)
Esempio n. 2
0
def OggVideoFile(filename):
    """Generic Ogg video file."""
    options = [OggTheoraFile]
    return guess_format(filename, options)
Esempio n. 3
0
def OggAudioFile(filename):
    """Generic Ogg audio file."""
    options = [OggFLACFile, OggSpeexFile, OggVorbisFile]
    return guess_format(filename, options)
Esempio n. 4
0
def OggVideoFile(filename):
    """Generic Ogg video file."""
    options = [OggTheoraFile]
    return guess_format(filename, options)
Esempio n. 5
0
def OggAudioFile(filename):
    """Generic Ogg audio file."""
    options = [OggFLACFile, OggSpeexFile, OggVorbisFile]
    return guess_format(filename, options)