(self, filetype, mimetype)
Replaces an existing FileType with the given *mimetype* in
        :attr:`self.supported_magic` with the given *filetype*.  Example::

            >>> import terminal
            >>> term = terminal.Terminal()
            >>> class NewPDF = class(terminal.PDFile)
            >>> # Open PDFs immediately in a new window
            >>> NewPDF.html_template = "<script>window.open({link})</script>"
            >>> NewPDF.html_icon_template = NewPDF.html_template # Ignore icon
            >>> term.update_magic(NewPDF, mimetype="application/pdf")
Replaces an existing FileType with the given *mimetype* in
        :attr:`self.supported_magic` with the given *filetype*.  Example::
Replaces an existing FileType with the given * mimetype * in : attr : self . supported_magic with the given * filetype * . Example ::
def update_magic(self, filetype, mimetype):
        """
        Replaces an existing FileType with the given *mimetype* in
        :attr:`self.supported_magic` with the given *filetype*.  Example::

            >>> import terminal
            >>> term = terminal.Terminal()
            >>> class NewPDF = class(terminal.PDFile)
            >>> # Open PDFs immediately in a new window
            >>> NewPDF.html_template = "<script>window.open({link})</script>"
            >>> NewPDF.html_icon_template = NewPDF.html_template # Ignore icon
            >>> term.update_magic(NewPDF, mimetype="application/pdf")
        """
        # Find the matching magic filetype
        for i, Type in enumerate(self.supported_magic):
            if Type.mimetype == mimetype:
                break
        # Replace self.magic and self.magic_map
        del self.magic[Type.re_header]
        del self.magic_map[Type.re_header]
        self.magic.update({filetype.re_header: filetype.re_capture})
        self.magic_map.update({filetype.re_header: filetype})
        # Finally replace the existing filetype in supported_magic
        self.supported_magic[i] = filetype
def update_magic ( self , filetype , mimetype ) : # Find the matching magic filetype for i , Type in enumerate ( self . supported_magic ) : if Type . mimetype == mimetype : break # Replace self.magic and self.magic_map del self . magic [ Type . re_header ] del self . magic_map [ Type . re_header ] self . magic . update ( { filetype . re_header : filetype . re_capture } ) self . magic_map . update ( { filetype . re_header : filetype } ) # Finally replace the existing filetype in supported_magic self . supported_magic [ i ] = filetype