How to use the mutagen._util.loadfile function in mutagen

To help you get started, we’ve selected a few mutagen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github quodlibet / mutagen / tests / test___init__.py View on Github external
    @loadfile()
    def load(self, filething, arg=1):
        self.filename = filething.filename
        self.fileobj = filething.fileobj
        self.arg = arg
github quodlibet / mutagen / mutagen / dsf.py View on Github external
    @loadfile(writable=True)
    def delete(self, filething=None):
        self.tags = None
        delete(filething)
github quodlibet / mutagen / mutagen / _file.py View on Github external
    @loadfile()
    def load(self, filething, *args, **kwargs):
        raise NotImplementedError
github quodlibet / mutagen / mutagen / _file.py View on Github external
    @loadfile(writable=True)
    def save(self, filething=None, **kwargs):
        """save(filething=None, **kwargs)

        Save metadata tags.

        Raises:
            MutagenError: if saving wasn't possible
        """

        if self.tags is not None:
            return self.tags.save(filething, **kwargs)
github Source-Python-Dev-Team / Source.Python / addons / source-python / packages / site-packages / mutagen / flac.py View on Github external
    @convert_error(IOError, error)
    @loadfile(writable=True)
    def save(self, filething, deleteid3=False, padding=None):
        """Save metadata blocks to a file.

        Args:
            filething (filething)
            deleteid3 (bool): delete id3 tags while at it
            padding (PaddingFunction)

        If no filename is given, the one most recently loaded is used.
        """

        f = StrictFileObject(filething.fileobj)
        header = self.__check_header(f, filething.name)
        audio_offset = self.__find_audio_offset(f)
        # "fLaC" and maybe ID3
        available = audio_offset - header
github Source-Python-Dev-Team / Source.Python / addons / source-python / packages / site-packages / mutagen / aiff.py View on Github external
    @convert_error(IOError, error)
    @loadfile()
    def load(self, filething, **kwargs):
        """Load stream and tag information from a file."""

        fileobj = filething.fileobj

        try:
            self.tags = _IFFID3(fileobj, **kwargs)
        except ID3NoHeaderError:
            self.tags = None
        except ID3Error as e:
            raise error(e)
        else:
            self.tags.filename = self.filename

        fileobj.seek(0, 0)
        self.info = AIFFInfo(fileobj)
github rembo10 / headphones / lib / mutagen / flac.py View on Github external
    @loadfile()
    def load(self, filething):
        """Load file information from a filename."""

        fileobj = filething.fileobj

        self.metadata_blocks = []
        self.tags = None
        self.cuesheet = None
        self.seektable = None

        fileobj = StrictFileObject(fileobj)
        self.__check_header(fileobj, filething.name)
        while self.__read_metadata_block(fileobj):
            pass

        try:
github quodlibet / mutagen / mutagen / _tags.py View on Github external
    @loadfile()
    def load(self, filething, **kwargs):
        raise NotImplementedError
github clinton-hall / nzbToMedia / libs / mutagen / _file.py View on Github external
    @loadfile(writable=True)
    def save(self, filething, **kwargs):
        """save(filething=None, **kwargs)

        Save metadata tags.

        Raises:
            MutagenError: if saving wasn't possible
        """

        if self.tags is not None:
            return self.tags.save(filething, **kwargs)
github quodlibet / mutagen / mutagen / oggspeex.py View on Github external
@loadfile(method=False, writable=True)
def delete(filething):
    """ delete(filething)

    Arguments:
        filething (filething)
    Raises:
        mutagen.MutagenError

    Remove tags from a file.
    """

    t = OggSpeex(filething)
    filething.fileobj.seek(0)
    t.delete(filething)